• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_plugin_active函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_plugin_active函数的典型用法代码示例。如果您正苦于以下问题:PHP is_plugin_active函数的具体用法?PHP is_plugin_active怎么用?PHP is_plugin_active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_plugin_active函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: cs_get_path_locate

 function cs_get_path_locate()
 {
     if (!function_exists('get_plugins') || !function_exists('is_plugin_active')) {
         include_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     foreach (get_plugins() as $key => $value) {
         if (strpos($key, 'cs-framework.php') !== false) {
             if (is_plugin_active($key)) {
                 $basename = '/' . str_replace('/cs-framework.php', '', $key);
                 $dir = WP_PLUGIN_DIR . $basename;
                 $uri = WP_PLUGIN_URL . $basename;
             }
         }
     }
     if (!isset($basename)) {
         $dirname = wp_normalize_path(dirname(__FILE__));
         $plugin_dir = wp_normalize_path(WP_PLUGIN_DIR);
         $located_plugin = preg_match('#' . $plugin_dir . '#', $dirname) ? true : false;
         $directory = $located_plugin ? $plugin_dir : get_template_directory();
         $directory_uri = $located_plugin ? WP_PLUGIN_URL : get_template_directory_uri();
         $basename = str_replace(wp_normalize_path($directory), '', $dirname);
         $dir = $directory . $basename;
         $uri = $directory_uri . $basename;
     }
     return apply_filters('cs_get_path_locate', array('basename' => wp_normalize_path($basename), 'dir' => wp_normalize_path($dir), 'uri' => $uri));
 }
开发者ID:xmandxx,项目名称:Teahouse-Wordpress-Theme,代码行数:26,代码来源:cs-framework-path.php


示例2: _wprp_upgrade_plugin

/**
 * Update a plugin
 *
 * @access private
 * @param mixed $plugin
 * @return array
 */
function _wprp_upgrade_plugin($plugin)
{
    include_once ABSPATH . 'wp-admin/includes/admin.php';
    if (!_wprp_supports_plugin_upgrade()) {
        return array('status' => 'error', 'error' => 'WordPress version too old for plugin upgrades');
    }
    $skin = new WPRP_Plugin_Upgrader_Skin();
    $upgrader = new Plugin_Upgrader($skin);
    $is_active = is_plugin_active($plugin);
    // Do the upgrade
    ob_start();
    $result = $upgrader->upgrade($plugin);
    $data = ob_get_contents();
    ob_clean();
    if (!$result && !is_null($result) || $data) {
        return array('status' => 'error', 'error' => 'file_permissions_error');
    } elseif (is_wp_error($result)) {
        return array('status' => 'error', 'error' => $result->get_error_code());
    }
    if ($skin->error) {
        return array('status' => 'error', 'error' => $skin->error);
    }
    // If the plugin was activited, we have to re-activate it
    // @todo Shouldn't this use activate_plugin?
    if ($is_active) {
        $current = get_option('active_plugins', array());
        $current[] = plugin_basename(trim($plugin));
        sort($current);
        update_option('active_plugins', $current);
    }
    return array('status' => 'success');
}
开发者ID:redferriswheel,项目名称:ZachFonville,代码行数:39,代码来源:wprp.plugins.php


示例3: __construct

 /**
  * Закрытый конструктор класса. Реализация паттерна SingleTon
  * Мы проверяем, установлен ли плагин woocommerce, выставляем соответствующий флаг и вешаем на событие init
  * инициализацию хуков для woocommerce
  */
 protected function __construct()
 {
     include_once ABSPATH . 'wp-admin/includes/plugin.php';
     if ($this->_isWoocommerceInstalled = is_plugin_active('woocommerce/woocommerce.php')) {
         add_action('init', array($this, '_initHooks'));
     }
 }
开发者ID:ArCoLab,项目名称:wp-affiliate-shop,代码行数:12,代码来源:woocommerce.php


示例4: testFakePluginsActive

 /**
  * @group now
  */
 public function testFakePluginsActive()
 {
     $fake_plugins = $this->mock_plugin_paths();
     foreach ($fake_plugins as $path) {
         $this->assertTrue(is_plugin_active($path), $path);
     }
 }
开发者ID:Shelob9,项目名称:plugin-love,代码行数:10,代码来源:test-log.php


示例5: _apf_check_fields_condition

 /**
  * @hook APF_hw_condition_rules: apf_check_fields_condition
  * @param $result
  * @param $params
  * @return mixed
  */
 public static function _apf_check_fields_condition($result, $params)
 {
     if ($params['match_page'] && isset($and_bind['plugins'])) {
         $result['plugins'] = is_plugin_active($and_bind['plugins']['act_values']) && $and_bind['plugins']['compare'] == 'actived' || !is_plugin_active($and_bind['plugins']['act_values']) && $and_bind['plugins']['compare'] == 'deactived';
     }
     return $result;
 }
开发者ID:hoangsoft90,项目名称:hw-hoangweb-plugin,代码行数:13,代码来源:dynamic-conditions-metabox.php


示例6: bbconnect_add_local_avatar_form

function bbconnect_add_local_avatar_form($args = null)
{
    // SET THE DEFAULTS TO BE OVERRIDDEN AS DESIRED
    $defaults = array('fdata' => false, 'fvalue' => false, 'faction' => false, 'ftype' => false);
    // PARSE THE INCOMING ARGS
    $args = wp_parse_args($args, $defaults);
    // EXTRACT THE VARIABLES
    extract($args, EXTR_SKIP);
    if (is_user_logged_in()) {
        if ('-edit' == $faction) {
            if (is_plugin_active('add-local-avatar/avatars.php') && false != $fdata) {
                $ala = new add_local_avatars();
                $ala->avatar_uploader_option($fdata);
            }
        } else {
            if ('-view' == $faction) {
                echo '<div class="user-avatar-wrap"><div id="user-avatar-display-image">' . get_avatar($fdata->ID, 150) . '</div></div>';
            } else {
            }
        }
    } else {
        if (false != $fdata) {
            echo '<div class="user-avatar-wrap"><div id="user-avatar-display-image">' . get_avatar($fdata->ID, 150) . '</div></div>';
        }
    }
}
开发者ID:whatthefork,项目名称:bbconnect,代码行数:26,代码来源:bbconnect-user-plugins.php


示例7: __construct

 /**
  * Constructor.
  */
 public function __construct()
 {
     switch (true) {
         case is_plugin_active('ithemes-sync/init.php'):
             // iThemes Sync
             add_action('wp_ajax_nopriv_ithemes_sync_request', array(&$this, 'init'), 15);
             add_filter('github_updater_remote_update_request', array(__CLASS__, 'iThemes_Sync'));
             break;
         case is_plugin_active('iwp-client/init.php'):
             // InfiniteWP
             add_filter('github_updater_remote_update_request', array(__CLASS__, 'InfiniteWP'));
             break;
         case is_plugin_active('worker/init.php'):
             // ManageWP - Worker
             add_filter('github_updater_remote_update_request', array(__CLASS__, 'ManageWP'));
             break;
         case is_plugin_active('mainwp/mainwp.php'):
             // MainWP
             add_filter('github_updater_remote_update_request', array(__CLASS__, 'MainWP'));
             break;
         case is_plugin_active('wpremote/plugin.php'):
             // WP-Remote
             add_filter('github_updater_remote_update_request', array(__CLASS__, 'WP_Remote'));
             break;
     }
 }
开发者ID:sirhair,项目名称:SH_WP_PluginRepo,代码行数:29,代码来源:Remote_Update.php


示例8: isJWTAuthEnabled

 public static function isJWTAuthEnabled()
 {
     if (!function_exists('is_plugin_active')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     return is_plugin_active('wp-jwt-auth/JWT_AUTH.php');
 }
开发者ID:erik-pantheon,项目名称:wp-auth0,代码行数:7,代码来源:WP_Auth0.php


示例9: is_active

 /**
  * Whether the plugin is active.
  *
  * @since 1.0.0
  *
  * @return boolean
  */
 public function is_active()
 {
     if (is_multisite()) {
         return $this->is_installed() && is_plugin_active_for_network($this->get_file());
     }
     return $this->is_installed() && is_plugin_active($this->get_file());
 }
开发者ID:audiotheme,项目名称:audiotheme-agent,代码行数:14,代码来源:Plugin.php


示例10: get_enable_plugins

 /**
  * Get the plugins that installed and activated from predefined third party list
  *
  * @return array|void
  */
 function get_enable_plugins()
 {
     if (!$this->_third_parties) {
         return;
     }
     if (!$this->_plugins) {
         if (!function_exists('is_plugin_activate')) {
             require_once ABSPATH . '/wp-includes/plugin.php';
         }
         $active = array();
         $inactive = array();
         foreach ($this->_third_parties as $class_name => $options) {
             $plugin_file = $options['plugin_file'];
             $plugin_path = WP_PLUGIN_DIR . '/' . $plugin_file;
             if (file_exists($plugin_path)) {
                 $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file);
                 $plugin_data['slug'] = $class_name;
                 if (is_plugin_active($plugin_file)) {
                     $active[$plugin_file] = $plugin_data;
                     $active[$plugin_file]['status'] = 'activated';
                 } else {
                     $inactive[$plugin_file] = $plugin_data;
                     $inactive[$plugin_file]['status'] = 'inactive';
                 }
             }
         }
         $this->_plugins = array_merge($active, $inactive);
     }
     return $this->_plugins;
 }
开发者ID:enlacee,项目名称:anb.platicom.com.pe,代码行数:35,代码来源:class-lpr-export.php


示例11: cvtx_grund_action

/**
 * themed output of cvtx_antrag_grund
 * 
 * @param post_id Do you want a specific posts grund?
 */
function cvtx_grund_action($post_id = false)
{
    if (!isset($post_id) || !$post_id) {
        global $post;
    } else {
        $post = get_post($post_id);
    }
    if (is_object($post)) {
        // Fetch explanation
        $grund = get_post_meta($post->ID, $post->post_type . '_grund', true);
        // Purify explanation
        if (is_plugin_active('html-purified/html-purified.php')) {
            global $cvtx_purifier, $cvtx_purifier_config;
            $grund = $cvtx_purifier->purify($grund, $cvtx_purifier_config);
        }
        // Trim explanation
        $grund = trim($grund);
        // Anything left to print?
        if (!empty($grund)) {
            // Convert line breaks to paragraphs
            $grund = '<p>' . preg_replace('/[\\r\\n]+/', '</p><p>', $grund) . '</p>';
            // Print explanation
            echo '<strong>' . __('Explanation', 'cvtx') . ':</strong> ';
            printf('%1$s', $grund);
        }
    }
}
开发者ID:alexfecke,项目名称:cvtx,代码行数:32,代码来源:cvtx_theme.php


示例12: options

 /**
  * This method is used to retrieve the configurable options of the element.
  * @return array The list of options that compose the element and then passed as the argument for the render() function
  */
 function options()
 {
     global $wpdb;
     $revslider_options = array();
     if (!function_exists('is_plugin_active')) {
         include_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     if (is_plugin_active('revslider/revslider.php')) {
         // Table name
         $table_name = $wpdb->prefix . "revslider_sliders";
         // Get sliders
         $rev_sliders = $wpdb->get_results("SELECT title,alias FROM {$table_name}");
         // Iterate over the sliders
         if (!empty($rev_sliders)) {
             foreach ($rev_sliders as $key => $item) {
                 if (isset($item->alias) && isset($item->title)) {
                     $revslider_options[$item->alias] = $item->title;
                 }
             }
         }
     }
     $uid = $this->data['uid'];
     $options = array('has_tabs' => true, 'general' => array('title' => 'General options', 'options' => array(array("name" => __("Background Style", 'zn_framework'), "description" => __("Select the background style you want to use. Please note that styles can be created\n\t\t\t\t\t\t\t\t\tfrom the unlimited headers options in the theme admin's page.", 'zn_framework'), "id" => "ww_header_style", "std" => "", "type" => "select", "options" => WpkZn::getThemeHeaders(true), "class" => ""), array("name" => __("Select slider", 'zn_framework'), "description" => __("Select the desired slider you want to use. Please note that the slider can be created\n\t\t\t\t\t\t\t\t\tfrom inside the Revolution Slider options page.", 'zn_framework'), "id" => "revslider_id", "std" => "", "type" => "select", "options" => $revslider_options), array("name" => __("Use Paralax effect", 'zn_framework'), "description" => __("Select yes if you have used the paralax classes\n\t\t\t\t\t\t\t\t\t\t\twhen you created your slider.", 'zn_framework'), "id" => "revslider_paralax", "std" => "0", "type" => "select", "options" => array(0 => __('No', 'zn_framework'), 1 => __('Yes', 'zn_framework'))), array("name" => __("Bottom masks override", 'zn_framework'), "description" => __("The new masks are svg based, vectorial and color adapted.", 'zn_framework'), "id" => "hm_header_bmasks", "std" => "none", "type" => "select", "options" => array('none' => __('None, just rely on Background style.', 'zn_framework'), 'shadow' => __('Shadow Up', 'zn_framework'), 'shadow_ud' => __('Shadow Up and down', 'zn_framework'), 'mask1' => __('Raster Mask 1 (Old, not recommended)', 'zn_framework'), 'mask2' => __('Raster Mask 2 (Old, not recommended)', 'zn_framework'), 'mask3' => __('Vector Mask 3 CENTER (New! From v4.0)', 'zn_framework'), 'mask3 mask3l' => __('Vector Mask 3 LEFT (New! From v4.0)', 'zn_framework'), 'mask3 mask3r' => __('Vector Mask 3 RIGHT (New! From v4.0)', 'zn_framework'), 'mask4' => __('Vector Mask 4 CENTER (New! From v4.0)', 'zn_framework'), 'mask4 mask4l' => __('Vector Mask 4 LEFT (New! From v4.0)', 'zn_framework'), 'mask4 mask4r' => __('Vector Mask 4 RIGHT (New! From v4.0)', 'zn_framework'), 'mask5' => __('Vector Mask 5 (New! From v4.0)', 'zn_framework'), 'mask6' => __('Vector Mask 6 (New! From v4.0)', 'zn_framework'))))), 'other' => array('title' => 'Other Options', 'options' => array(array('id' => 'css_class', 'name' => 'CSS class', 'description' => 'Enter a css class that will be applied to this element. You can than edit the custom css, either in the Page builder\'s CUSTOM CSS (which is loaded only into that particular page), or in Kallyas options > Advanced > Custom CSS which will load the css into the entire website.', 'type' => 'text', 'std' => ''))), 'help' => znpb_get_helptab(array('video' => 'http://support.hogash.com/kallyas-videos/#pP-ktSGJabg', 'docs' => 'http://support.hogash.com/documentation/revolution-slider/', 'copy' => $uid, 'general' => true)));
     return $options;
 }
开发者ID:rock1media,项目名称:wordpress,代码行数:29,代码来源:TH_RevolutionSlider.php


示例13: edible_install

/**
 * action executed when plugin is activated
 */
function edible_install()
{
    // check for wp-api
    if (!is_plugin_active('rest-api/plugin.php')) {
        exit('you need the wp-api v2 plugin');
    }
}
开发者ID:zz-james,项目名称:edibleurban2,代码行数:10,代码来源:edible-urban.php


示例14: activity_admin_post_category_check

function activity_admin_post_category_check($post_id, $post, $update)
{
    if (is_admin()) {
        if (is_plugin_active('activity/activity.php')) {
            $post_cat = wp_get_post_categories($post_id);
            if (empty($post_cat)) {
                return;
            } else {
                $activity_cat = intval(get_option('activity_category'));
                $is_post_activity = in_array($activity_cat, $post_cat);
                if ($is_post_activity) {
                    if (strpos($_SERVER['REQUEST_URI'], '/wp-admin/admin.php?page=activity_admin') === false) {
                        $post_cat = array_diff($post_cat, array($activity_cat));
                        if (empty($post_cat)) {
                            $post_cat = array(1);
                        }
                        $post_data = array('ID' => $post_id, 'post_category' => $post_cat);
                        $post_update = wp_update_post($post_data);
                        header('Location: ' . get_site_url() . '/wp-admin/admin.php?page=activity_admin&action=error_add_activity');
                        exit;
                    }
                }
            }
        }
    }
}
开发者ID:chadhao,项目名称:WordPress_Dev,代码行数:26,代码来源:functions.php


示例15: post_register_meta_boxes

/**
 * Register meta boxes
 *
 * @return void
 */
function post_register_meta_boxes($meta_boxes)
{
    /**
     * Prefix of meta keys (optional)
     * Use underscore (_) at the beginning to make keys hidden
     * Alt.: You also can make prefix empty to disable it
     */
    // Better has an underscore as last sign
    $prefix = 'YOUR_PREFIX_';
    if (is_plugin_active('contus-video-gallery/hdflvvideoshare.php') || is_plugin_active('all-in-one-video-pack/all_in_one_video_pack.php')) {
        // 1st meta box
        $meta_boxes[] = array('id' => 'standard', 'title' => __('Post Settings', 'rwmb'), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'autosave' => true, 'fields' => array(array('name' => __('Video ID', 'cactusthemes'), 'id' => "tm_video_id", 'desc' => __('Paste the id from Video Gallery (Contus Video Player) or Kaltura Video Flatform', 'cactusthemes'), 'type' => 'text', 'std' => __('', 'cactusthemes'), 'clone' => false), array('name' => __('Video URL', 'cactusthemes'), 'id' => "tm_video_url", 'desc' => __('Paste the url from popular video sites like YouTube or Vimeo. For example: <br/><code>http://www.youtube.com/watch?v=nTDNLUzjkpg</code><br/>or<br/><code>http://vimeo.com/23079092</code>', 'cactusthemes'), 'type' => 'text', 'std' => __('', 'cactusthemes'), 'clone' => false), array('name' => __('Video File', 'cactusthemes'), 'desc' => __('Paste your video file url to here. Supported Video Formats: mp4, m4v, webmv, webm, ogv and flv.<br/><b>About Cross-platform and Cross-browser Support</b><br/>If you want your video works in all platforms and browsers(HTML5 and Flash), you should provide various video formats for same video, if the video files are ready, enter one url per line.<br/> For Example:<br/> <code>http://yousite.com/sample-video.m4v</code><br/><code>http://yousite.com/sample-video.ogv</code><br/> <b>Recommended Format Solution:</b> webmv + m4v + ogv. ', 'cactusthemes'), 'id' => "tm_video_file", 'type' => 'textarea', 'cols' => 20, 'rows' => 7), array('name' => __('Video Code', 'cactusthemes'), 'desc' => __('Paste the raw video code to here, such as <code>&lt;</code><code>object</code><code>&gt;</code>,<code>&lt;</code><code>embed</code><code>&gt;</code> or <code>&lt;</code><code>iframe</code><code>&gt;</code> code.', 'cactusthemes'), 'id' => "tm_video_code", 'type' => 'textarea', 'cols' => 20, 'rows' => 7), array('name' => __('Duration', 'cactusthemes'), 'id' => "time_video", 'desc' => __(''), 'type' => 'text', 'std' => __('', 'cactusthemes'), 'clone' => false), array('name' => __('Show Hide Feature Image', 'cactusthemes'), 'id' => "show_feature_image", 'type' => 'select', 'options' => array('3' => __('Default', 'cactusthemes'), '2' => __('Show', 'cactusthemes'), '1' => __('Hide', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Video Layout/Feature Image', 'cactusthemes'), 'id' => "page_layout", 'type' => 'select', 'options' => array('def' => __('Default', 'cactusthemes'), 'full_width' => __('Full Width', 'cactusthemes'), 'inbox' => __('Inboxed', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Page Layout', 'cactusthemes'), 'id' => "single_ly_ct_video", 'type' => 'select', 'options' => array('def' => __('Default', 'cactusthemes'), 'full' => __('Full Width', 'cactusthemes'), 'right' => __('Sidebar Right', 'cactusthemes'), 'left' => __('Sidebar Left', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Background Image', 'cactusthemes'), 'id' => "ct_bg_image", 'type' => 'image_advanced', 'max_file_uploads' => 4), array('name' => __('Background repeat', 'cactusthemes'), 'id' => "ct_bg_repeat", 'type' => 'select', 'options' => array('no-repeat' => __('No Repeat', 'cactusthemes'), 'repeat' => __('Repeat All', 'cactusthemes'), 'repeat-x' => __('Repeat Horizontally', 'cactusthemes'), 'repeat-y' => __('Repeat Vertically', 'cactusthemes'), 'inherit' => __('Inherit', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Background attachment', 'cactusthemes'), 'id' => "ct_bg_attachment", 'type' => 'select', 'options' => array('' => __('', 'cactusthemes'), 'fixed' => __('Fixed', 'cactusthemes'), 'scroll' => __('Scroll', 'cactusthemes'), 'inherit' => __('Inherit', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Background position', 'cactusthemes'), 'id' => "ct_bg_position", 'type' => 'select', 'options' => array('' => __('', 'cactusthemes'), 'left top' => __('Left Top', 'cactusthemes'), 'left center' => __('Left Center', 'cactusthemes'), 'left bottom' => __('Left Bottom', 'cactusthemes'), 'center top' => __('Center Top', 'cactusthemes'), 'center center' => __('Center Center', 'cactusthemes'), 'center bottom' => __('Center Bottom', 'cactusthemes'), 'right top' => __('Right Top', 'cactusthemes'), 'right center' => __('Right center', 'cactusthemes'), 'right bottom' => __('Right bottom', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false)));
    } else {
        // 1st meta box
        $meta_boxes[] = array('id' => 'standard', 'title' => __('Post Settings', 'rwmb'), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'autosave' => true, 'fields' => array(array('name' => __('Video URL', 'cactusthemes'), 'id' => "tm_video_url", 'desc' => __('Paste the url from popular video sites like YouTube or Vimeo. For example: <br/><code>http://www.youtube.com/watch?v=nTDNLUzjkpg</code><br/>or<br/><code>http://vimeo.com/23079092</code>', 'cactusthemes'), 'type' => 'text', 'std' => __('', 'cactusthemes'), 'clone' => false), array('name' => __('Video File', 'cactusthemes'), 'desc' => __('Paste your video file url to here. Supported Video Formats: mp4, m4v, webmv, webm, ogv and flv.<br/><b>About Cross-platform and Cross-browser Support</b><br/>If you want your video works in all platforms and browsers(HTML5 and Flash), you should provide various video formats for same video, if the video files are ready, enter one url per line.<br/> For Example:<br/> <code>http://yousite.com/sample-video.m4v</code><br/><code>http://yousite.com/sample-video.ogv</code><br/> <b>Recommended Format Solution:</b> webmv + m4v + ogv. ', 'cactusthemes'), 'id' => "tm_video_file", 'type' => 'textarea', 'cols' => 20, 'rows' => 7), array('name' => __('Video Code', 'cactusthemes'), 'desc' => __('Paste the raw video code to here, such as <code>&lt;</code><code>object</code><code>&gt;</code>,<code>&lt;</code><code>embed</code><code>&gt;</code> or <code>&lt;</code><code>iframe</code><code>&gt;</code> code.', 'cactusthemes'), 'id' => "tm_video_code", 'type' => 'textarea', 'cols' => 20, 'rows' => 7), array('name' => __('Duration', 'cactusthemes'), 'id' => "time_video", 'desc' => __(''), 'type' => 'text', 'std' => __('', 'cactusthemes'), 'clone' => false), array('name' => __('Show Hide Feature Image', 'cactusthemes'), 'id' => "show_feature_image", 'type' => 'select', 'options' => array('3' => __('Default', 'cactusthemes'), '2' => __('Show', 'cactusthemes'), '1' => __('Hide', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Video Layout/Feature Image', 'cactusthemes'), 'id' => "page_layout", 'type' => 'select', 'options' => array('def' => __('Default', 'cactusthemes'), 'full_width' => __('Full Width', 'cactusthemes'), 'inbox' => __('Inboxed', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Page Layout', 'cactusthemes'), 'id' => "single_ly_ct_video", 'type' => 'select', 'options' => array('def' => __('Default', 'cactusthemes'), 'full' => __('Full Width', 'cactusthemes'), 'right' => __('Sidebar Right', 'cactusthemes'), 'left' => __('Sidebar Left', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Background Image', 'cactusthemes'), 'id' => "ct_bg_image", 'type' => 'image_advanced', 'max_file_uploads' => 4), array('name' => __('Background repeat', 'cactusthemes'), 'id' => "ct_bg_repeat", 'type' => 'select', 'options' => array('no-repeat' => __('No Repeat', 'cactusthemes'), 'repeat' => __('Repeat All', 'cactusthemes'), 'repeat-x' => __('Repeat Horizontally', 'cactusthemes'), 'repeat-y' => __('Repeat Vertically', 'cactusthemes'), 'inherit' => __('Inherit', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Background attachment', 'cactusthemes'), 'id' => "ct_bg_attachment", 'type' => 'select', 'options' => array('' => __('', 'cactusthemes'), 'fixed' => __('Fixed', 'cactusthemes'), 'scroll' => __('Scroll', 'cactusthemes'), 'inherit' => __('Inherit', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false), array('name' => __('Background position', 'cactusthemes'), 'id' => "ct_bg_position", 'type' => 'select', 'options' => array('' => __('', 'cactusthemes'), 'left top' => __('Left Top', 'cactusthemes'), 'left center' => __('Left Center', 'cactusthemes'), 'left bottom' => __('Left Bottom', 'cactusthemes'), 'center top' => __('Center Top', 'cactusthemes'), 'center center' => __('Center Center', 'cactusthemes'), 'center bottom' => __('Center Bottom', 'cactusthemes'), 'right top' => __('Right Top', 'cactusthemes'), 'right center' => __('Right center', 'cactusthemes'), 'right bottom' => __('Right bottom', 'cactusthemes')), 'multiple' => false, 'std' => '', 'placeholder' => false)));
    }
    // 2nd meta box
    $meta_boxes[] = array('title' => __('Videos Auto Fetch Data', 'cactusthemes'), 'context' => 'side', 'fields' => array(array('name' => __('', 'cactusthemes'), 'id' => "fetch_info", 'type' => 'checkbox_list', 'desc' => __('Check above checkbox if you do not want to auto-fetch video data after save/edit. To chose which fields to fetch, go to appearance > Theme option > General ', 'cactusthemes'), 'options' => array('1' => __('<strong>DO NOT FETCH</strong>', 'cactusthemes')))));
    // 3rd meta box
    $meta_boxes[] = array('title' => __('Social Locker', 'cactusthemes'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Social Locker shortcode', 'cactusthemes'), 'id' => "social_locker", 'type' => 'text', 'desc' => __('Enter shortcode to lock video player, for example: [sociallocker][/sociallocker]', 'cactusthemes'))));
    if (is_plugin_active('video-ads/video-ads-management.php')) {
        // 4th meta box
        $meta_boxes[] = array('title' => __('Video Ads', 'cactusthemes'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Ads ID', 'cactusthemes'), 'id' => "video_ads_id", 'type' => 'text', 'desc' => __('Enter Ads ID or 0 to get random active ads', 'cactusthemes'))));
    }
    // 5rd meta box
    $meta_boxes[] = array('title' => __('Player Logic', 'cactusthemes'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Player logic', 'cactusthemes'), 'id' => "player_logic", 'type' => 'text', 'desc' => __('Enter shortcode (ex: [my_shortcode][player][/my_shortcode], <strong>[player]</strong> is required)<br>or condition function (ex: <b>is_user_logged_in() && is_sticky()</b> ) to control video player visiblitily', 'cactusthemes')), array('name' => __('Alternative Content', 'cactusthemes'), 'id' => "player_logic_alt", 'type' => 'textarea', 'desc' => __('Content to display when Condition is false (Not work with Shortcodes)', 'cactusthemes'))));
    return $meta_boxes;
}
开发者ID:davidHuanghw,项目名称:david_blog,代码行数:33,代码来源:post-metadata.php


示例16: render

 /**
  * Render a message if the zero spam plugin isn't active
  *
  * If it is active, dismiss and return an empty string.
  *
  * @since 1.2.3
  *
  * @return string
  */
 public function render()
 {
     if (is_plugin_active('zero-spam/zero-spam.php') or !current_user_can('update_plugins')) {
         return '';
     }
     return $this->render_message(sprintf(__('Did you know there is an excellent and free way to keep spam comments from ever getting submitted? We heartily recommend installing <a href="%s">GoodBye Captcha</a>.', 'Postmatic'), 'https://wordpress.org/plugins/goodbye-captcha/'));
 }
开发者ID:postmatic,项目名称:beta-dist,代码行数:16,代码来源:zero-spam-notice.php


示例17: lbmn_get_footerid_by_pageid

/**
 * ----------------------------------------------------------------------
 * Get the custom footer post (lbmn_footer content type) id for the current page
 */
function lbmn_get_footerid_by_pageid($current_pageid)
{
    if (is_plugin_active('ds-live-composer/ds-live-composer.php')) {
        // Check if current page has custom footer ID set
        $footer_post_id = '';
        // Fist, make sure rwmb plugin installed and fucntion is available
        // and if not 404 or no search results page otherwise rwmb_meta throw a notice
        if (have_posts() && function_exists('rwmb_meta')) {
            $footer_post_id = rwmb_meta('lbmn_custom_footer_id', array(), $current_pageid);
        }
        // If no custom footer set get default footer defined in Theme Customizer
        if (!$footer_post_id) {
            // Get footer page ID defined in Theme Customizer
            $footer_post_id = get_theme_mod('lbmn_footer_design');
            // If no footer set in Theme Customizer check what default we have set
            // I don't want to run 'get_page_by_title' on every page load
            if (!$footer_post_id) {
                // Get default footer custom post id
                $footer_design_default = get_page_by_title(LBMN_FOOTER_DESIGN_TITLE_DEFAULT, 'ARRAY_A', 'lbmn_footer');
                if (isset($footer_design_default)) {
                    $footer_design_default = $footer_design_default['ID'];
                } else {
                    $footer_design_default = '';
                }
                $footer_post_id = get_theme_mod('lbmn_footer_design', $footer_design_default);
            }
        }
        return $footer_post_id;
    } else {
        return false;
    }
}
开发者ID:shimion,项目名称:localinsurance-theme,代码行数:36,代码来源:functions-extras.php


示例18: test_can_place_in_section

 public function test_can_place_in_section()
 {
     wp_set_current_user($this->users['admin']);
     // Simulate move to top level
     $gc_one = get_post($this->posts['grandchild_one']);
     $gc_two = get_post($this->posts['grandchild_two']);
     $this->assertTrue($this->navman->can_place_in_section($gc_one, $this->posts['child']));
     // Don't allow top level posts
     $this->plugin->settings->update(array('allow_top' => false));
     $gc_one->post_parent = 0;
     $this->assertFalse($this->navman->can_place_in_section($gc_one, $this->posts['child']));
     $this->assertTrue($this->navman->can_place_in_section($gc_two, $this->posts['child']));
     // Simulate previously in nav exception
     $this->assertTrue($this->navman->can_place_in_section($gc_one, 0));
     // Re-allow top level posts
     $this->plugin->settings->update(array('allow_top' => true));
     // Coverage for section editor logic
     if (!is_plugin_active('bu-section-editing/bu-section-editing.php')) {
         return;
     }
     wp_set_current_user($this->users['section_editor']);
     // Simulate move to top level
     $post = get_post($this->posts['grandchild_one']);
     $post->post_parent = 0;
     // Top level moves deneid, regardless of allow top setting or previously in navigation condition
     $this->assertFalse($this->navman->can_place_in_section($post, $this->posts['child']));
     $this->assertFalse($this->navman->can_place_in_section($post, 0));
     // Simulate move under sibling (allowed) page
     $post->post_parent = $this->posts['grandchild_two'];
     $this->assertTrue($this->navman->can_place_in_section($post, $this->posts['child']));
     // Simulate move under parent (denied) page
     $post->post_parent = $this->posts['parent'];
     $this->assertFalse($this->navman->can_place_in_section($post, $this->posts['child']));
 }
开发者ID:iamapioneer,项目名称:sdas,代码行数:34,代码来源:test-admin-manager.php


示例19: registerSettings

 /**
  * register settings for our plugin
  */
 function registerSettings()
 {
     //register our settings
     register_setting('wtb_seo_settings_main_group', 'wtb_seo_main', array($this, 'sanitize'));
     add_settings_section('wtb_seo_settings_main_section', __('On-Page and Post Options', 'wtb_seo'), null, 'wtb_seo_settings');
     // ideal density
     add_settings_field('ideal_density', __('Ideal keyword density (default: 3%)', 'wtb_seo'), array($this, 'create_an_ideal_density_field'), 'wtb_seo_settings', 'wtb_seo_settings_main_section');
     // ideal lenght
     add_settings_field('ideal_lenght', __('Ideal post lenght (default: 250)', 'wtb_seo'), array($this, 'create_an_ideal_lenght_field'), 'wtb_seo_settings', 'wtb_seo_settings_main_section');
     // checkboxes to check
     add_settings_field('to_check', __('Parameter to check', 'wtb_seo'), array($this, 'create_to_check_fields'), 'wtb_seo_settings', 'wtb_seo_settings_main_section');
     // wfd or density
     add_settings_field('wdf_vs_density', __('Keyword density or WDF to show', 'wtb_seo'), array($this, 'create_an_wdf_vs_density_field'), 'wtb_seo_settings', 'wtb_seo_settings_main_section');
     // custom post types
     add_settings_section('wtb_seo_settings_cpt_section', __('Activate in custom post types', 'wtb_seo'), null, 'wtb_seo_settings');
     add_settings_field('cpt', __('Custom post types', 'wtb_seo'), array($this, 'create_an_custom_post_types_fields'), 'wtb_seo_settings', 'wtb_seo_settings_cpt_section');
     // woocommerce
     if (is_plugin_active('woocommerce/woocommerce.php')) {
         add_settings_section('wtb_seo_settings_woo_section', __('WooCommerce settings', 'wtb_seo'), null, 'wtb_seo_settings');
         add_settings_field('check_short_description', __('Check short description', 'wtb_seo'), array($this, 'create_check_short_description'), 'wtb_seo_settings', 'wtb_seo_settings_woo_section');
     }
     // auto refresh
     add_settings_section('wtb_seo_settings_ar_section', __('Auto refresh settings', 'wtb_seo'), null, 'wtb_seo_settings');
     add_settings_field('disable_auto_refresh', __('Disabled', 'wtb_seo'), array($this, 'create_auto_refresh_disable'), 'wtb_seo_settings', 'wtb_seo_settings_ar_section');
     add_settings_field('auto_refresh_time', __('Auto refresh after (sec.)', 'wtb_seo'), array($this, 'create_auto_refresh_time'), 'wtb_seo_settings', 'wtb_seo_settings_ar_section');
 }
开发者ID:repupress,项目名称:onpage-post-seo-wordpress-plugin,代码行数:29,代码来源:settings.php


示例20: deactivate_featured_item_conditional

function deactivate_featured_item_conditional()
{
    if (is_plugin_active('ux-featured-item/portfolio-post-type.php')) {
        deactivate_plugins('ux-featured-item/portfolio-post-type.php');
        flush_rewrite_rules();
    }
}
开发者ID:javipaur,项目名称:TiendaVirtual,代码行数:7,代码来源:featured-items.php



注:本文中的is_plugin_active函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_plugin_active_for_network函数代码示例发布时间:2022-05-15
下一篇:
PHP is_player函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap