コード例 #1
0
ファイル: plugin-main.php プロジェクト: keshvenderg/cloudshop
     *
     * @param \Aelia\WC\Settings settings_controller The controller that will handle
     * the plugin settings.
     * @param \Aelia\WC\Messages messages_controller The controller that will handle
     * the messages produced by the plugin.
     */
    public function __construct($settings_controller = null, $messages_controller = null)
    {
        // Load Composer autoloader
        require_once __DIR__ . '/vendor/autoload.php';
        parent::__construct($settings_controller, $messages_controller);
        $this->initialize_integration();
    }
    protected function initialize_integration()
    {
        $this->subscriptions_integration = new Subscriptions_Integration();
    }
    /**
     * Determines if one of plugin's admin pages is being rendered. Override it
     * if plugin implements pages in the Admin section.
     *
     * @return bool
     */
    protected function rendering_plugin_admin_page()
    {
        global $post, $woocommerce;
        return isset($post) && $post->post_type == 'product';
    }
}
$GLOBALS[WC_Aelia_CS_Subscriptions_Plugin::$plugin_slug] = WC_Aelia_CS_Subscriptions_Plugin::factory();
コード例 #2
0
 /**
  * Returns the path where the Admin Views can be found.
  *
  * @return string
  */
 protected function admin_views_path()
 {
     return WC_Aelia_CS_Subscriptions_Plugin::plugin_path() . '/views/admin';
 }