本文整理汇总了PHP中is_plugin_active函数的典型用法代码示例。如果您正苦于以下问题:PHP is_plugin_active函数的具体用法?PHP is_plugin_active怎么用?PHP is_plugin_active使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_plugin_active函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例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');
}
示例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'));
}
}
示例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);
}
}
示例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;
}
示例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>';
}
}
}
示例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;
}
}
示例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');
}
示例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());
}
示例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;
}
示例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);
}
}
}
示例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;
}
示例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');
}
}
示例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;
}
}
}
}
}
}
示例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><</code><code>object</code><code>></code>,<code><</code><code>embed</code><code>></code> or <code><</code><code>iframe</code><code>></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><</code><code>object</code><code>></code>,<code><</code><code>embed</code><code>></code> or <code><</code><code>iframe</code><code>></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;
}