当前位置: 首页>>代码示例>>PHP>>正文


PHP cmb2_get_option函数代码示例

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


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

示例1: set_up_client

 /**
  * Sets up the client object with
  * the authentication token and
  * checks if the token is still valid
  *
  * @since 0.5.0
  */
 private function set_up_client()
 {
     $token = (string) cmb2_get_option($this->plugin_name, '_wpgp_gist_token');
     if (empty($token)) {
         return new \WP_Error('no_github_token', 'No GitHub OAuth token available.');
     }
     $this->authenticate($token);
     return $token;
 }
开发者ID:petermac-,项目名称:WP-Gistpen,代码行数:16,代码来源:Gist.php

示例2: custo_get_option

/**
 * Wrapper function around custo_get_option
 * @since  1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function custo_get_option($key = '')
{
    global $custo_options;
    if (function_exists('cmb2_get_option')) {
        return cmb2_get_option($custo_options->key, $key);
    } else {
        $options = get_option($custo_options->key);
        return isset($options[$key]) ? $options[$key] : false;
    }
}
开发者ID:nasir-mandal,项目名称:custo-framework,代码行数:16,代码来源:index.php

示例3: export_gistpen

 /**
  * Exports a Gistpen to Gist based on its ID
  *
  * If the Zip doesn't have a Gist ID, create a new Gist,
  * or update an existing Gist if it does.
  *
  * @param  int              $zip_id   Zip ID of exporting Gistpen
  * @return string|\WP_Error           Zip ID on success, WP_Error on failure
  */
 public function export_gistpen($zip_id)
 {
     if (false === cmb2_get_option($this->plugin_name, '_wpgp_gist_token')) {
         return $zip_id;
     }
     $commit = $this->database->query('commit')->latest_by_head_id($zip_id);
     if ('on' !== $commit->get_sync() || 'none' !== $commit->get_gist_id()) {
         return $zip_id;
     }
     if ('none' === $commit->get_head_gist_id()) {
         $result = $this->create_gist($commit);
     } else {
         $result = $this->update_gist($commit);
     }
     if (is_wp_error($result)) {
         return $result;
     }
     return $zip_id;
 }
开发者ID:petermac-,项目名称:WP-Gistpen,代码行数:28,代码来源:Sync.php

示例4: emails

 public function emails($post_id)
 {
     if (empty($post_id)) {
         return;
     }
     $toClient = array('content' => cmb2_get_option($this->key, '_fdc_client_email_content'));
     $toYou = array('email' => cmb2_get_option($this->key, '_fdc_you_email_address'), 'content' => cmb2_get_option($this->key, '_fdc_you_email_content'));
     do_action('fdc_before_email_send', $post_id, $toClient, $toYou);
 }
开发者ID:taunoha,项目名称:px-form-data-collector,代码行数:9,代码来源:index.php

示例5: wppg_user_stylesheet

 function wppg_user_stylesheet()
 {
     $adm = cmb2_get_option('idp-slider-subpage', true);
     $bootstrap_act = $adm['bootstrap_act'];
     if ($bootstrap_act == 'on') {
         wp_register_style('wppg_bootstrap_min_css', plugins_url('/user_css/bootstrap.min.css', __FILE__));
         wp_register_style('wppg_bootstrap-theme_min_css', plugins_url('/user_css/bootstrap-theme.min.css', __FILE__));
         wp_enqueue_style(array("wppg_bootstrap_min_css", "wppg_bootstrap-theme_min_css"));
     }
     wp_register_style('wppg_slider_css', plugins_url('/user_css/slider.css', __FILE__));
     wp_enqueue_style("wppg_slider_css");
 }
开发者ID:watson-77,项目名称:idp-slider-lite,代码行数:12,代码来源:idp-slider-lite.php

示例6: wp_responsive_images_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function wp_responsive_images_get_option($key = '')
{
    return cmb2_get_option(wp_responsive_images_admin()->key, $key);
}
开发者ID:JayWood,项目名称:wordpress-responsive-image-replacement,代码行数:10,代码来源:wp-responsive-images-settings.php

示例7: everindustrial_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string $key Options array key
 * @return mixed        Option value
 */
function everindustrial_get_option($key = '')
{
    return cmb2_get_option(everindustrial_admin()->key, $key);
}
开发者ID:Groonya,项目名称:black-and-white-portfolio,代码行数:10,代码来源:theme-options.php

示例8: ucsd_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function ucsd_get_option($key = '')
{
    return cmb2_get_option(ucsd_admin()->key, $key);
}
开发者ID:jacobwarren,项目名称:starterv2,代码行数:10,代码来源:custom-fields.php

示例9: cmb2_get_option

<footer id="site_footer" class="site-footer">
	<div class="wrapper">
		
		<div class="line">
			<svg><use xlink:href="#egg-cross"></use></svg>
		</div>

		<div class="meta">
			<svg class='logo'><use xlink:href="#logo-full"></use></svg>
		</div>
	
		<div class="meta">
		<?php 
$hashtag = cmb2_get_option('eggman_options', 'footer');
echo '<p>' . $hashtag . '</p>';
?>
		</div>

		<div class="line">
			<svg><use xlink:href="#bacon-cross"></use></svg>
		</div>

		<small>&copy; <?php 
echo date("Y");
?>
 All rights reserved. Thomas Januszewski </small>

	</div>
</footer>

<?php 
开发者ID:jcitysinner,项目名称:eggman,代码行数:31,代码来源:footer.php

示例10: wds_page_builder_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function wds_page_builder_get_option($key = '')
{
    return cmb2_get_option(WDS_Page_Builder_Options()->key, $key);
}
开发者ID:Art2u,项目名称:WDS-Simple-Page-Builder,代码行数:10,代码来源:options.php

示例11: activity_stock_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function activity_stock_get_option($key = '')
{
    $val = cmb2_get_option(activity_stock_admin()->key, $key);
    return $val;
}
开发者ID:edgimopeter,项目名称:ActivityCenter,代码行数:11,代码来源:stock_copy_page.php

示例12: cmb2_get_option

<?php

$twitteruser = cmb2_get_option('eggman_options', 'twitter');
$notweets = 4;
$consumerkey = cmb2_get_option('eggman_options', 'twitterconsumerkey');
$consumersecret = cmb2_get_option('eggman_options', 'twitterconsumersecret');
$accesstoken = cmb2_get_option('eggman_options', 'twitteraccesstoken');
$accesstokensecret = cmb2_get_option('eggman_options', 'twitteraccesstokensecret');
function getConnectionWithAccessToken($cons_key, $cons_secret, $oauth_token, $oauth_token_secret)
{
    $connection = new TwitterOAuth($cons_key, $cons_secret, $oauth_token, $oauth_token_secret);
    return $connection;
}
$connection = getConnectionWithAccessToken($consumerkey, $consumersecret, $accesstoken, $accesstokensecret);
$cache_tweet = 'cache_file_tweet';
if (file_exists($cache_tweet) && filemtime($cache_tweet) > time() - 60 * 60) {
    $tweets = unserialize(file_get_contents($cache_tweet));
} else {
    $tweets = $connection->get('https://api.twitter.com/1.1/favorites/list.json?screen_name=' . $twitteruser . '&count=' . $notweets);
    if (@property_exists($tweets, 'errors')) {
        $tweets = unserialize(file_get_contents($cache_tweet));
    } else {
        file_put_contents($cache_tweet, serialize($tweets));
    }
}
$i = 0;
foreach ($tweets as $key => $value) {
    if ($i == 6) {
        break;
    }
    $has = '';
开发者ID:jcitysinner,项目名称:eggman,代码行数:31,代码来源:social_twitter.php

示例13: wds_login_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function wds_login_get_option($key = '')
{
    return cmb2_get_option(wds_login_options()->key, $key);
}
开发者ID:Art2u,项目名称:WDS-Custom-Login-Page,代码行数:10,代码来源:options.php

示例14: get_meta

 /**
  * Returns term meta with options to return a subset
  * @since  0.1.3
  * @param  string  $term_id  The term id for the options we're getting
  * @param  string  $key      Term meta key to check
  * @return mixed             Requested value | false
  */
 public function get_meta($term_id, $key = '')
 {
     if (!class_exists('CMB2')) {
         return;
     }
     $this->do_override_filters($term_id);
     return cmb2_get_option($this->id($term_id), $key);
 }
开发者ID:cnasikas,项目名称:Taxonomy_MetaData,代码行数:15,代码来源:Taxonomy_MetaData_CMB2.php

示例15: scroll_progress_get_option

/**
 * Wrapper function around cmb2_get_option
 * @since  0.1.0
 * @param  string  $key Options array key
 * @return mixed        Option value
 */
function scroll_progress_get_option($key = '')
{
    return cmb2_get_option(scroll_progress_admin()->key, $key);
}
开发者ID:weerapat,项目名称:wp-daily,代码行数:10,代码来源:scroll-progress-options.php


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