Esempio n. 1
0
/**
 * re-order list of actived plugins
 */
function _hwpagenav_move_after_yarpp_when_activation()
{
    if (!is_admin()) {
        return;
    }
    if (function_exists('hw_reorder_actived_plugins')) {
        hw_reorder_actived_plugins('hw-pagenavi/hw_pagenavi.php', 'wp-pagenavi/wp-pagenavi.php');
    }
}
/**
 * re-order list of actived plugins
 */
function _hwmenu_move_after_yarpp_when_activation()
{
    if (!is_admin()) {
        return;
    }
    if (function_exists('hw_reorder_actived_plugins')) {
        hw_reorder_actived_plugins('hw-menu/menu.php', 'hw-skin/hw-skin.php');
    }
}
/**
 * re-order list of actived plugins
 */
function _hwrp_move_after_yarpp_when_activation()
{
    if (!is_admin()) {
        return;
    }
    if (function_exists('hw_reorder_actived_plugins')) {
        hw_reorder_actived_plugins('hw-yarpp/hw-yarpp.php', 'yet-another-related-posts-plugin/yarpp.php');
    }
}
/**
 * order plugins to be loaded before all other plugins
 */
function hw_move_at_first_when_activation()
{
    if (!is_admin()) {
        return;
    }
    // ensure path to this file is via main wp plugin path
    hw_reorder_actived_plugins(HW_HOANGWEB_PLUGIN_SLUG, 0);
    /*$active_plugins = get_option('active_plugins');
      $this_plugin_key = array_search($this_plugin, $active_plugins);
      if ($this_plugin_key) { // if it's 0 it's the first plugin already, no need to continue
          array_splice($active_plugins, $this_plugin_key, 1);
          array_unshift($active_plugins, $this_plugin);
          update_option('active_plugins', $active_plugins);
      }*/
}
/**
* order plugins to be loaded before all other plugins
*/
function _hwskin_move_at_first_when_activation()
{
    if (!is_admin()) {
        return;
    }
    if (function_exists('hw_reorder_actived_plugins')) {
        hw_reorder_actived_plugins('hw-skin/hw-skin.php', 'hw-hoangweb/hoangweb.php');
        //move this plugin at first list
    } else {
        wp_die('Sory, Bạn cần kích hoạt plugin hw-hoangweb trước.');
        /*
                // ensure path to this file is via main wp plugin path
                $this_plugin = HW_SKIN::get_this_plugin();
                $active_plugins = get_option('active_plugins');
                $this_plugin_key = array_search($this_plugin, $active_plugins);
                if ($this_plugin_key) { // if it's 0 it's the first plugin already, no need to continue
                    array_splice($active_plugins, $this_plugin_key, 1);
                    array_unshift($active_plugins, $this_plugin);
                    update_option('active_plugins', $active_plugins);
                }*/
    }
}