コード例 #1
0
/**
 * @param $add_on
 *
 * @return bool
 */
function learn_press_disable_add_on($add_on)
{
    $registered = learn_press_get_add_ons();
    $enabled_addons = learn_press_get_enabled_add_ons(array('break_cache' => true));
    $success = false;
    if (!empty($enabled_addons[$add_on])) {
        unset($enabled_addons[$add_on]);
        if (update_option('enabled_add_ons', $enabled_addons)) {
            if (!empty($registered[$add_on])) {
                do_action('learn_press_add_on_disabled', $registered[$add_on]);
            }
            flush_rewrite_rules();
            $success = true;
        }
    }
    return $success;
}
コード例 #2
0
ファイル: add-ons.php プロジェクト: shrimp2t/LearnPress
 public function prepare_items()
 {
     global $status, $plugins, $totals, $page, $orderby, $order, $s;
     wp_reset_vars(array('orderby', 'order', 's'));
     $columns = $this->get_columns();
     $hidden = $this->get_hidden_columns();
     $sortable = $this->get_sortable_columns();
     $this->_column_headers = array($columns, $hidden, $sortable);
     /**
      * Filter the full array of plugins to list in the Plugins list table.
      *
      * @since 3.0.0
      *
      * @see get_plugins()
      *
      * @param array $plugins An array of plugins to display in the list table.
      */
     $plugins = array('all' => learn_press_get_add_ons(), 'search' => array(), 'active' => array(), 'inactive' => array(), 'recently_activated' => array(), 'upgrade' => array(), 'mustuse' => array(), 'dropins' => array());
     $this->items = array();
     foreach ($plugins[$status] as $plugin_file => $plugin_data) {
         // Translate, Don't Apply Markup, Sanitize HTML
         $this->items[$plugin_file] = _get_plugin_data_markup_translate($plugin_file, $plugin_data, false, true);
     }
     //$this->items = learn_press_get_add_ons();
     //$this->items = $plugins;// array_slice( $this->items, $start, $plugins_per_page );
 }
コード例 #3
0
ファイル: learnpress.php プロジェクト: guruku/LearnPress
 /**
  * Include files of enabled add ons
  */
 public function include_enable_add_on()
 {
     $enabled_addons = learn_press_get_enabled_add_ons();
     $add_ons = learn_press_get_add_ons();
     // Init all enabled addons
     foreach ((array) $add_ons as $slug => $params) {
         if (isset($enabled_addons[$slug])) {
             if (!empty($params['file']) && is_file($params['file'])) {
                 include_once $params['file'];
             }
         }
     }
 }
コード例 #4
0
function learn_press_add_ons_content_tab_installed($current)
{
    $add_ons = learn_press_get_add_ons();
    learn_press_add_on_tab_description(__('All add-ons that you have installed', 'learn_press'));
    learn_press_output_add_ons_list($add_ons, $current);
}