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


PHP hybrid_get_setting函数代码示例

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


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

示例1: hybrid_enqueue_script

/**
 * Function to load JavaScript at appropriate time. Loads comment reply script only if 
 * users choose to use nested comments. Users should load custom JavaScript with 
 * wp_enqueue_script() in their child theme's functions.php file.
 *
 * If selected, the drop-downs.js file will be loaded, which is a bundled version of the
 * Superfish jQuery plugin.
 *
 * @since 0.1
 * @link http://codex.wordpress.org/Function_Reference/wp_enqueue_script
 * @link http://users.tpg.com.au/j_birch/plugins/superfish
 */
function hybrid_enqueue_script() {

	/* Don't load any scripts in the admin. */
	if ( is_admin() )
		return;

	/* Comment reply. */
	if ( is_singular() && get_option( 'thread_comments' ) && comments_open() )
		wp_enqueue_script( 'comment-reply' );

	/* Superfish drop-down menus. */
	if ( hybrid_get_setting( 'superfish_js' ) )
		wp_enqueue_script( 'drop-downs', esc_url( apply_atomic( 'drop_downs_script', THEME_JS . '/drop-downs.js' ) ), array( 'jquery' ), 1.4, true );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:26,代码来源:media.php

示例2: hybrid_meta_box_theme_display_footer

/**
 * Creates a meta box that allows users to customize their footer.
 *
 * @since 1.2.0
 * @uses wp_editor() Creates an instance of the WordPress text/content editor.
 * @return void
 */
function hybrid_meta_box_theme_display_footer()
{
    /* Add a textarea using the wp_editor() function to make it easier on users to add custom content. */
    wp_editor(esc_textarea(hybrid_get_setting('footer_insert')), hybrid_settings_field_id('footer_insert'), array('tinymce' => false, 'textarea_name' => hybrid_settings_field_name('footer_insert')));
    ?>

	<p>
		<span class="description"><?php 
    _e('You can add custom <acronym title="Hypertext Markup Language">HTML</acronym> and/or shortcodes, which will be automatically inserted into your theme.', 'hybrid-core');
    ?>
</span>
	</p>

<?php 
}
开发者ID:aguerojahannes,项目名称:aguerojahannes.com,代码行数:22,代码来源:meta-box-theme-footer.php

示例3: hybrid_post_meta_box_args

/**
 * Creates the settings for the post meta box depending on some things in how the theme is
 * set up.
 *
 * @since 0.7
 * @param string $type The post_type of the current post in the post editor.
 */
function hybrid_post_meta_box_args( $type = '' ) {

	/* Get theme information. */
	$prefix = hybrid_get_prefix();
	$domain = hybrid_get_textdomain();

	/* If no post type is given, default to 'post'. */
	if ( empty( $type ) )
		$type = 'post';

	/* If the disable SEO plugin setting is not selected, allow the input of custom meta. */
	if ( !hybrid_get_setting( 'seo_plugin' ) ) {
		$meta['title'] = array( 'name' => 'Title', 'title' => __( 'Title:', $domain ), 'type' => 'text' );
		$meta['description'] = array( 'name' => 'Description', 'title' => __( 'Description:', $domain ), 'type' => 'textarea' );
		$meta['keywords'] = array( 'name' => 'Keywords', 'title' => __( 'Keywords:', $domain ), 'type' => 'text' );
	}

	/* Integrates with the custom field series extension. */
	if ( function_exists( 'custom_field_series' ) )
		$meta['series'] = array( 'name' => 'Series', 'title' => __( 'Series:', $domain ), 'type' => 'text' );

	/* Input box for a custom thumbnail. */
	$meta['thumbnail'] = array( 'name' => 'Thumbnail', 'title' => __( 'Thumbnail:', $domain ), 'type' => 'text' );

	/* If there are any custom post templates, allow the user to select one. */
	if ( 'page' != $type && 'attachment' != $type ) {
		$post_type_object = get_post_type_object( $type );

		if ( $post_type_object->singular_label || $post_type_object->name ) {
			$templates = hybrid_get_post_templates( array( 'label' => array( "{$post_type_object->labels->singular_name} Template", "{$post_type_object->name} Template" ) ) );

			if ( 0 != count( $templates ) )
				$meta['template'] = array( 'name' => "_wp_{$type}_template", 'title' => __( 'Template:', $domain ), 'type' => 'select', 'options' => $templates, 'use_key_and_value' => true );
		}
	}

	/* Add post layouts option if current theme supports them. */
	if ( current_theme_supports( 'post-layouts' ) )
		$meta['post_layout'] = array( 'name' => 'Layout', 'title' => __( 'Layout:', $domain ), 'type' => 'select', 'options' => array( '1c', '2c-l', '2c-r', '3c-l', '3c-r', '3c-c' ) );

	/* $prefix_$type_meta_boxes filter is deprecated. Use $prefix_$type_meta_box_args instead. */
	$meta = apply_filters( "{$prefix}_{$type}_meta_boxes", $meta );

	return apply_filters( "{$prefix}_{$type}_meta_box_args", $meta );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:52,代码来源:meta-box.php

示例4: hybrid_meta_box_theme_display_footer

/**
 * Creates a settings box that allows users to customize their footer. A basic textarea is given that
 * allows HTML and shortcodes to be input.
 *
 * @since 1.2.0
 */
function hybrid_meta_box_theme_display_footer()
{
    $domain = hybrid_get_textdomain();
    ?>

	<p>
		<span class="description"><?php 
    _e('You can add custom <acronym title="Hypertext Markup Language">HTML</acronym> and/or shortcodes, which will be automatically inserted into your theme.', $domain);
    ?>
</span>
	</p>

	<p>
		<textarea id="<?php 
    echo hybrid_settings_field_id('footer_insert');
    ?>
" name="<?php 
    echo hybrid_settings_field_name('footer_insert');
    ?>
" cols="60" rows="5"><?php 
    echo esc_textarea(hybrid_get_setting('footer_insert'));
    ?>
</textarea>
	</p>

	<?php 
    if (current_theme_supports('hybrid-core-shortcodes')) {
        ?>
		<p>
			<?php 
        printf(__('Shortcodes: %s', $domain), '<code>[the-year]</code>, <code>[site-link]</code>, <code>[wp-link]</code>, <code>[theme-link]</code>, <code>[child-link]</code>, <code>[loginout-link]</code>, <code>[query-counter]</code>');
        ?>
		</p>
	<?php 
    }
}
开发者ID:nixter,项目名称:d.school,代码行数:42,代码来源:meta-box-theme-footer.php

示例5: cakifo_tweet_button

/**
 *  Display the tweet button
 *
 * @param  array   $args Array with arguments
 * @staticvar integer $i Used to count how many times the function has been referenced
 * @return string         The tweet button
 * @since Cakifo 1.3
 */
function cakifo_tweet_button($args = array())
{
    /**
     * Count how many times the function has been referenced
     * @var integer
     */
    static $i = 0;
    $i++;
    /**
     * Default values for the button
     * @var array
     */
    $defaults = array('before' => '', 'after' => '', 'href' => wp_get_shortlink(), 'via' => hybrid_get_setting('twitter_username'), 'text' => the_title_attribute('echo=0'), 'related' => '', 'layout' => 'vertical', 'counturl' => get_permalink());
    // Merge them
    $args = wp_parse_args($args, $defaults);
    /**
     * Set up variables
     */
    $post_id = get_queried_object_id();
    $url = trailingslashit($args['href']);
    $counturl = trailingslashit($args['counturl']);
    $cache_interval = 60;
    $refresh_interval = 3660;
    $retweet_count = null;
    $count = 0;
    $counter = '';
    // Retweet data (Twitter API)
    $retweet_meta = get_post_meta($post_id, "retweet_{$i}_cache", true);
    if ($retweet_meta != '') {
        $retweet_pieces = explode(':', $retweet_meta);
        $retweet_timestamp = (int) $retweet_pieces[0];
        $retweet_count = (int) $retweet_pieces[1];
    }
    // Expire retweet cache
    if ($retweet_count === null || time() > $retweet_timestamp + $cache_interval) {
        $retweet_response = wp_remote_get('http://urls.api.twitter.com/1/urls/count.json?url=' . $counturl);
        if (!is_wp_error($retweet_response)) {
            $retweet_data = json_decode(wp_remote_retrieve_body($retweet_response), true);
            if (isset($retweet_data['count']) && isset($retweet_data['url']) && $retweet_data['url'] === $counturl) {
                if ((int) $retweet_data['count'] >= $retweet_count || time() > $retweet_timestamp + $refresh_interval) {
                    $retweet_count = $retweet_data['count'];
                    if ($retweet_meta == '') {
                        add_post_meta($post_id, "retweet_{$i}_cache", time() . ':' . $retweet_count);
                    } else {
                        update_post_meta($post_id, "retweet_{$i}_cache", time() . ':' . $retweet_count);
                    }
                }
            }
        }
        // $retweet_response
    }
    // expire retweet cache
    /**
     * Check for "retweet_count_start" custom field
     *
     * Manually set the starting number of retweets for a post that existed before the Tweet Button was created
     * the number can be roughly calculated by subtracting the twitter API's retweet count
     * from the estimated number of retweets according to the topsy, backtype, or tweetmeme services
     */
    $retweet_count_start = get_post_meta($post_id, "retweet_{$i}_count_start", true);
    /* Calculate the total count to display */
    $count = $retweet_count + (int) $retweet_count_start;
    if ($count > 9999) {
        $count = $count / 1000;
        $count = number_format($count, 1) . 'K';
    } else {
        $count = number_format($count);
    }
    /**
     * Construct the tweet button query string
     */
    $twitter_params = '?text=' . urlencode($args['text']) . '+-';
    $twitter_params .= '&amp;url=' . urlencode($url);
    $twitter_params .= '&amp;counturl=' . urlencode($args['counturl']);
    $twitter_params .= $args['via'] ? '&amp;via=' . $args['via'] : '';
    $twitter_params .= $args['related'] ? '&amp;related=' . $args['related'] : '';
    if ($args['layout'] != 'none') {
        $counter = '<a class="twitter-count" href="http://twitter.com/search?q=' . urlencode($url) . '" target="_blank">' . $count . '</a>';
    }
    // HTML for the tweet button
    $twitter_share = '
		<div class="twitter-share twitter-button-size-' . sanitize_html_class($args['layout']) . '">
			<a class="twitter-button" rel="external nofollow" title="Share this on Twitter" href="http://twitter.com/share' . $twitter_params . '" target="_blank">Tweet</a>' . $counter . '
		</div>
	';
    return $args['before'] . $twitter_share . $args['after'];
}
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:95,代码来源:tweet_button.php

示例6: hybrid_document_title

hybrid_document_title();
?>
</title>

	<meta name="viewport" content="width=device-width,initial-scale=1" />

	<link rel="profile" href="http://gmpg.org/xfn/11" />

	<link rel="pingback" href="<?php 
bloginfo('pingback_url');
?>
" />

	<!-- use favicon set in theme options -->
	<link rel="Shortcut Icon" href="<?php 
echo esc_attr(hybrid_get_setting('favicon_upload'));
?>
" type="image/x-icon" />

	<?php 
wp_head();
// wp_head
?>



</head>



<body <?php 
开发者ID:aldelpech,项目名称:clea-cb,代码行数:31,代码来源:header-test1.php

示例7: hybrid_footer_content

/**
 * Standardized function for outputting the footer content.
 *
 * @since 1.4.0
 * @access public
 * @return void
 */
function hybrid_footer_content()
{
    /* Only run the code if the theme supports the Hybrid Core theme settings. */
    if (current_theme_supports('hybrid-core-theme-settings')) {
        echo apply_atomic_shortcode('footer_content', hybrid_get_setting('footer_insert'));
    }
}
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:14,代码来源:utility.php

示例8: spine2_wp_head

/**
 * Insert customizer styles to document head
 */
function spine2_wp_head()
{
    $body_color = hybrid_get_setting('body_color');
    $headline_color = hybrid_get_setting('headline_color');
    $link_color = hybrid_get_setting('link_color');
    $link_hover_color = hybrid_get_setting('link_hover_color');
    $output = "<style>" . PHP_EOL . " /* Customizer styles*/" . PHP_EOL;
    if (!empty($body_color)) {
        $output .= "body { color: {$body_color}; } ";
    }
    if (!empty($headline_color)) {
        $output .= "h1, h2, h3, h4, h5, h6 { color: {$headline_color} } ";
    }
    if (!empty($link_color)) {
        $output .= "a { color: {$link_color}; } ";
    }
    if (!empty($link_hover_color)) {
        $output .= "a:hover { color: {$link_hover_color}; } ";
    }
    echo $output .= " </style>" . PHP_EOL;
}
开发者ID:JunnLearning,项目名称:dk,代码行数:24,代码来源:functions.php

示例9: hatch_theme_meta_box

function hatch_theme_meta_box()
{
    ?>

	<table class="form-table">
	    
		<!-- Favicon upload -->
		<tr class="favicon_url">
			<th>
				<label for="<?php 
    echo esc_attr(hybrid_settings_field_id('hatch_favicon_url'));
    ?>
"><?php 
    _e('Favicon:', 'hatch');
    ?>
</label>
			</th>
			<td>
				<input type="text" id="<?php 
    echo esc_attr(hybrid_settings_field_id('hatch_favicon_url'));
    ?>
" name="<?php 
    echo esc_attr(hybrid_settings_field_name('hatch_favicon_url'));
    ?>
" value="<?php 
    echo esc_url(hybrid_get_setting('hatch_favicon_url'));
    ?>
" />
				<input id="hatch_favicon_upload_button" class="button" type="button" value="Upload" />
				<br />
				<span class="description"><?php 
    _e('Upload favicon image (recommended max size: 32x32).', 'hatch');
    ?>
</span>
				
				<?php 
    /* Display uploaded image */
    if (hybrid_get_setting('hatch_favicon_url')) {
        ?>
                    <p><img src="<?php 
        echo esc_url(hybrid_get_setting('hatch_favicon_url'));
        ?>
" alt="" /></p>
				<?php 
    }
    ?>
			</td>
		</tr>
		
		<!-- Logo upload -->
		<tr class="logo_url">
			<th>
				<label for="<?php 
    echo esc_attr(hybrid_settings_field_id('hatch_logo_url'));
    ?>
"><?php 
    _e('Logo:', 'hatch');
    ?>
</label>
			</th>
			<td>
				<input type="text" id="<?php 
    echo esc_attr(hybrid_settings_field_id('hatch_logo_url'));
    ?>
" name="<?php 
    echo esc_attr(hybrid_settings_field_name('hatch_logo_url'));
    ?>
" value="<?php 
    echo esc_url(hybrid_get_setting('hatch_logo_url'));
    ?>
" />
				<input id="hatch_logo_upload_button" class="button" type="button" value="Upload" />
				<br />
				<span class="description"><?php 
    _e('Upload logo image (recommended max width: 200px).', 'hatch');
    ?>
</span>
				
				<?php 
    /* Display uploaded image */
    if (hybrid_get_setting('hatch_logo_url')) {
        ?>
                    <p><img src="<?php 
        echo esc_url(hybrid_get_setting('hatch_logo_url'));
        ?>
" alt="" /></p>
				<?php 
    }
    ?>
			</td>
		</tr>
		
		<!-- Author Description -->
		<tr>
			<th>
				<label for="<?php 
    echo esc_attr(hybrid_settings_field_id('hatch_author_bio'));
    ?>
"><?php 
    _e('Author:', 'hatch');
//.........这里部分代码省略.........
开发者ID:jazzindizzin,项目名称:Quality-Timber-Doors,代码行数:101,代码来源:functions-admin.php

示例10: bloginfo

?>
; charset=<?php 
bloginfo('charset');
?>
" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		
	<!-- Mobile viewport optimized -->
	<meta name="viewport" content="width=device-width,initial-scale=1">
	
	<?php 
if (hybrid_get_setting('oxygen_favicon_url')) {
    ?>
		<!-- Favicon -->
		<link rel="shortcut icon" href="<?php 
    echo hybrid_get_setting('oxygen_favicon_url');
    ?>
" />
	<?php 
}
?>
	
	<!-- Title -->
	<title><?php 
hybrid_document_title();
?>
</title>
	
	<link rel="profile" href="http://gmpg.org/xfn/11" />
	<link rel="pingback" href="<?php 
bloginfo('pingback_url');
开发者ID:RA2WP,项目名称:RA2WP,代码行数:31,代码来源:header.php

示例11: do_atomic

 *
 * Displays information at the top of the page about archive and search results when viewing those pages.
 * This is not shown on the front page or singular views.
 *
 * @package Cakifo
 * @subpackage Template
 */
?>

<?php 
do_atomic('before_loop_meta');
// cakifo_before_loop_meta
?>

<?php 
if (is_home() && !is_front_page() && hybrid_get_setting('featured_show')) {
    ?>

	<?php 
    global $wp_query;
    ?>

	<div class="loop-meta loop-meta-home">

		<h1 class="loop-title"><span><?php 
    echo get_post_field('post_title', $wp_query->get_queried_object_id());
    ?>
</span></h1>

		<div class="loop-description">
			<?php 
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:31,代码来源:loop-meta.php

示例12: mirai_footer

function mirai_footer()
{
    $footer_insert = hybrid_get_setting('footer_insert');
    if (!empty($footer_insert)) {
        echo '<div class="footer-insert">' . do_shortcode($footer_insert) . '</div>';
    }
}
开发者ID:ryanmr,项目名称:mirai-theme,代码行数:7,代码来源:functions.php

示例13: oxygen_theme_meta_box

function oxygen_theme_meta_box()
{
    ?>

	<table class="form-table">
	    
		<!-- Favicon upload -->
		<tr class="favicon_url">
			<th>
				<label for="<?php 
    echo hybrid_settings_field_id('oxygen_favicon_url');
    ?>
"><?php 
    _e('Favicon:', hybrid_get_parent_textdomain());
    ?>
</label>
			</th>
			<td>
				<input type="text" id="<?php 
    echo hybrid_settings_field_id('oxygen_favicon_url');
    ?>
" name="<?php 
    echo hybrid_settings_field_name('oxygen_favicon_url');
    ?>
" value="<?php 
    echo esc_attr(hybrid_get_setting('oxygen_favicon_url'));
    ?>
" />
				<input id="oxygen_favicon_upload_button" class="button" type="button" value="Upload" />
				<br />
				<span class="description"><?php 
    _e('Upload favicon image (recommended max size: 32x32).', hybrid_get_parent_textdomain());
    ?>
</span>
				
				<?php 
    /* Display uploaded image */
    if (hybrid_get_setting('oxygen_favicon_url')) {
        ?>
                    <p><img src="<?php 
        echo hybrid_get_setting('oxygen_favicon_url');
        ?>
" alt=""/></p>
				<?php 
    }
    ?>
			</td>
		</tr>
		
		<!-- Logo upload -->
		<tr class="logo_url">
			<th>
				<label for="<?php 
    echo hybrid_settings_field_id('oxygen_logo_url');
    ?>
"><?php 
    _e('Logo:', hybrid_get_parent_textdomain());
    ?>
</label>
			</th>
			<td>
				<input type="text" id="<?php 
    echo hybrid_settings_field_id('oxygen_logo_url');
    ?>
" name="<?php 
    echo hybrid_settings_field_name('oxygen_logo_url');
    ?>
" value="<?php 
    echo esc_attr(hybrid_get_setting('oxygen_logo_url'));
    ?>
" />
				<input id="oxygen_logo_upload_button" class="button" type="button" value="Upload" />
				<br />
				<span class="description"><?php 
    _e('Upload logo image.', hybrid_get_parent_textdomain());
    ?>
</span>
				
				<?php 
    /* Display uploaded image */
    if (hybrid_get_setting('oxygen_logo_url')) {
        ?>
                    <p><img src="<?php 
        echo hybrid_get_setting('oxygen_logo_url');
        ?>
" alt=""/></p>
				<?php 
    }
    ?>
			</td>
		</tr>		
		
		<!-- Title font family -->
		<tr>
			<th>
				<label for="<?php 
    echo hybrid_settings_field_id('oxygen_font_family');
    ?>
"><?php 
    _e('Title font family:', hybrid_get_parent_textdomain());
//.........这里部分代码省略.........
开发者ID:nukulb,项目名称:bugsbounty-blog,代码行数:101,代码来源:functions-admin.php

示例14: array

 * Child Themes can replace it via {section-slider.php}
 *
 * @package Cakifo
 * @subpackage Template
 */
?>

<?php 
/**
 * Select posts from the selected categories
 */
if (hybrid_get_setting('featured_category')) {
    $feature_query = array('cat' => hybrid_get_setting('featured_category'), 'showposts' => hybrid_get_setting('featured_posts'), 'ignore_sticky_posts' => 1, 'post_status' => 'publish', 'no_found_rows' => true);
    // No selected categories, use Sticky Posts
} else {
    $feature_query = array('post__in' => get_option('sticky_posts'), 'showposts' => hybrid_get_setting('featured_posts'), 'post_status' => 'publish', 'no_found_rows' => true);
}
?>

<?php 
$loop = new WP_Query($feature_query);
?>

<?php 
if ($loop->have_posts()) {
    ?>

	<?php 
    do_atomic('before_slider');
    // cakifo_before_slider
    ?>
开发者ID:JerryXie96,项目名称:PBSMUNC2013WebSite,代码行数:31,代码来源:section-slider.php

示例15: home_url

							
							<?php 
if (hybrid_get_setting('ascetica_logo_url')) {
    ?>
			
								
								<h1 id="site-title">
									<a href="<?php 
    echo home_url();
    ?>
" title="<?php 
    echo bloginfo('name');
    ?>
" rel="Home">
										<img class="logo" src="<?php 
    echo esc_url(hybrid_get_setting('ascetica_logo_url'));
    ?>
" alt="<?php 
    echo bloginfo('name');
    ?>
" />
									</a>
								</h1>
							
							<?php 
} else {
    ?>
							
								<?php 
    hybrid_site_title();
    ?>
开发者ID:arturo-mayorga,项目名称:am_com,代码行数:30,代码来源:header.php


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