本文整理汇总了PHP中hybrid_get_textdomain函数的典型用法代码示例。如果您正苦于以下问题:PHP hybrid_get_textdomain函数的具体用法?PHP hybrid_get_textdomain怎么用?PHP hybrid_get_textdomain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hybrid_get_textdomain函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the theme framework, loads the required files, and calls the
* functions needed to run the theme.
*
* @since 0.7
*/
function init() {
/* Define theme constants. */
$this->constants();
/* Load theme functions. */
$this->functions();
/* Load theme extensions. */
$this->extensions();
/* Load legacy files and functions. */
$this->legacy();
/* Load admin files. */
$this->admin();
/* Theme prefix for creating things such as filter hooks (i.e., "$prefix_hook_name"). */
$this->prefix = hybrid_get_prefix();
/* Load theme textdomain. */
$domain = hybrid_get_textdomain();
$locale = get_locale();
load_textdomain( $domain, locate_template( array( "languages/{$domain}-{$locale}.mo", "{$domain}-{$locale}.mo" ) ) );
/* Initialize the theme's default actions. */
$this->actions();
/* Initialize the theme's default filters. */
$this->filters();
/* Theme init hook. */
do_action( "{$this->prefix}_init" );
}
开发者ID:nerdfiles,项目名称:sideshowtramps.com,代码行数:40,代码来源:hybrid.php
示例2: Hybrid_Widget_Calendar
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.6
*/
function Hybrid_Widget_Calendar() {
$this->prefix = hybrid_get_prefix();
$this->textdomain = hybrid_get_textdomain();
$widget_ops = array( 'classname' => 'calendar', 'description' => __( 'An advanced widget that gives you total control over the output of your calendar.', $this->textdomain ) );
$control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => "{$this->prefix}-calendar" );
$this->WP_Widget( "{$this->prefix}-calendar", __( 'Calendar', $this->textdomain ), $widget_ops, $control_ops );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:12,代码来源:widget-calendar.php
示例3: Hybrid_Widget_Bookmarks
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.6
*/
function Hybrid_Widget_Bookmarks() {
$this->prefix = hybrid_get_prefix();
$this->textdomain = hybrid_get_textdomain();
$widget_ops = array( 'classname' => 'bookmarks', 'description' => __( 'An advanced widget that gives you total control over the output of your bookmarks (links).', $this->textdomain ) );
$control_ops = array( 'width' => 800, 'height' => 350, 'id_base' => "{$this->prefix}-bookmarks" );
$this->WP_Widget( "{$this->prefix}-bookmarks", __( 'Bookmarks', $this->textdomain ), $widget_ops, $control_ops );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:12,代码来源:widget-bookmarks.php
示例4: hybrid_meta_revised
/**
* Add the revised meta tag on single posts and pages (or any post type). This shows the last time the post
* was modified.
*
* @since 0.4.0
*/
function hybrid_meta_revised() {
$revised = '';
if ( is_singular() )
$revised = '<meta name="revised" content="' . get_the_modified_time( esc_attr__( 'l, F jS, Y, g:i a', hybrid_get_textdomain() ) ) . '" />' . "\n";
echo apply_atomic( 'meta_revised', $revised );
}
开发者ID:nerdfiles,项目名称:mabrylaw.com,代码行数:14,代码来源:core-seo.php
示例5: Hybrid_Widget_Search
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.6
*/
function Hybrid_Widget_Search() {
$this->prefix = hybrid_get_prefix();
$this->textdomain = hybrid_get_textdomain();
$widget_ops = array( 'classname' => 'search', 'description' => __( 'An advanced widget that gives you total control over the output of your search form.', $this->textdomain ) );
$control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-search" );
$this->WP_Widget( "{$this->prefix}-search", __( 'Search', $this->textdomain ), $widget_ops, $control_ops );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:12,代码来源:widget-search.php
示例6: Hybrid_Widget_Nav_Menu
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.6
*/
function Hybrid_Widget_Nav_Menu() {
$this->prefix = hybrid_get_prefix();
$this->textdomain = hybrid_get_textdomain();
$widget_ops = array( 'classname' => 'nav-menu', 'description' => __( 'An advanced widget that gives you total control over the output of your menus.', $this->textdomain ) );
$control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-nav-menu" );
$this->WP_Widget( "{$this->prefix}-nav-menu", __( 'Navigation Menu', $this->textdomain ), $widget_ops, $control_ops );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:12,代码来源:widget-nav-menu.php
示例7: custom_field_series
/**
* Grabs series by custom field. Checks for other articles in the series.
* Series identified custom field key 'Series' and unique value.
*
* @todo Fix the multiple hyphens in the series class.
* @todo Allow filtering of title.
*
* @since 0.1
* @param array $args Array of arguments.
*/
function custom_field_series( $args = array() ) {
global $post;
$textdomain = hybrid_get_textdomain();
$series_meta = get_metadata( 'post', $post->ID, 'Series', true );
if ( $series_meta ) {
$defaults = array(
'order' => 'DESC',
'orderby' => 'ID',
'include' => '',
'exclude' => '',
'post_type' => 'any',
'numberposts' => -1,
'meta_key' => 'Series',
'meta_value' => $series_meta,
'echo' => true
);
$args = apply_filters( 'custom_field_series_args', $args );
$args = wp_parse_args( $args, $defaults );
$series_posts = get_posts( $args );
if ( $series_posts ) {
$class = str_replace( array( '_', ' ', ' ' ) , '-', $series_meta );
$class = preg_replace('/[^A-Za-z0-9-]/', '', $class );
$class = strtolower( $class );
$series = '<div class="series series-' . $class . '">';
$series .= '<h4 class="series-title">' . __( 'Articles in this series', $textdomain) . '</h4>';
$series .= '<ul>';
foreach ( $series_posts as $serial ) {
if ( $serial->ID == $post->ID )
$series .= '<li class="current-post">' . $serial->post_title . '</li>';
else
$series .= '<li><a href="' . get_permalink( $serial->ID ) . '" title="' . esc_attr( $serial->post_title ) . '">' . $serial->post_title . '</a></li>';
}
$series .= '</ul></div>';
}
}
$series = apply_filters( 'custom_field_series', $series );
if ( $args['echo'] && $series )
echo $series;
elseif ( $series )
return $series;
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:68,代码来源:custom-field-series.php
示例8: hybrid_get_sidebars
/**
* Returns an array of the core framework's available sidebars for use in themes. We'll just set the
* ID (array keys), name, and description of each sidebar. The other sidebar arguments will be set when the
* sidebar is registered.
*
* @since 1.2.0
*/
function hybrid_get_sidebars()
{
/* Get the theme textdomain. */
$domain = hybrid_get_textdomain();
/* Set up an array of sidebars. */
$sidebars = array('primary' => array('name' => _x('Primary', 'sidebar', $domain), 'description' => __('The main (primary) widget area, most often used as a sidebar.', $domain)), 'secondary' => array('name' => _x('Secondary', 'sidebar', $domain), 'description' => __('The second most important widget area, most often used as a secondary sidebar.', $domain)), 'subsidiary' => array('name' => _x('Subsidiary', 'sidebar', $domain), 'description' => __('A widget area loaded in the footer of the site.', $domain)), 'header' => array('name' => _x('Header', 'sidebar', $domain), 'description' => __('Displayed within the site\'s header area.', $domain)), 'before-content' => array('name' => _x('Before Content', 'sidebar', $domain), 'description' => __('Loaded before the page\'s main content area.', $domain)), 'after-content' => array('name' => _x('After Content', 'sidebar', $domain), 'description' => __('Loaded after the page\'s main content area.', $domain)), 'after-singular' => array('name' => _x('After Singular', 'sidebar', $domain), 'description' => __('Loaded on singular post (page, attachment, etc.) views before the comments area.', $domain)));
/* Return the sidebars. */
return $sidebars;
}
开发者ID:nixter,项目名称:d.school,代码行数:16,代码来源:sidebars.php
示例9: hybrid_post_meta_box_args
/**
* Creates the settings for the post meta box depending on some things in how the theme are set up. Most
* of the available options depend on theme-supported features of the framework.
*
* @since 0.7.0
* @param string $type The post type of the current post in the post editor.
*/
function hybrid_post_meta_box_args( $type = '' ) {
/* Set up some default variables. */
$prefix = hybrid_get_prefix();
$domain = hybrid_get_textdomain();
$meta = array();
/* If no post type is given, default to 'post'. */
if ( empty( $type ) )
$type = 'post';
/* If the current theme supports the 'hybrid-core-seo' feature. */
if ( current_theme_supports( 'hybrid-core-seo' ) ) {
$meta['title'] = array( 'name' => 'Title', 'title' => sprintf( __( 'Document Title: %s', $domain ), '<code><title></code>' ), 'type' => 'text' );
$meta['description'] = array( 'name' => 'Description', 'title' => sprintf( __( 'Meta Description: %s', $domain ), '<code><meta></code>' ), 'type' => 'textarea' );
$meta['keywords'] = array( 'name' => 'Keywords', 'title' => sprintf( __( 'Meta Keywords: %s', $domain ), '<code><meta></code>' ), 'type' => 'text' );
}
/* If the current theme supports the 'custom-field-series' extension. */
if ( current_theme_supports( 'custom-field-series' ) )
$meta['series'] = array( 'name' => 'Series', 'title' => __( 'Series:', $domain ), 'type' => 'text' );
/* If the current theme supports the 'get-the-image' extension. */
if ( current_theme_supports( 'get-the-image' ) )
$meta['thumbnail'] = array( 'name' => 'Thumbnail', 'title' => __( 'Thumbnail:', $domain ), 'type' => 'text' );
/* If the current theme supports the 'post-stylesheets' extension. */
if ( current_theme_supports( 'post-stylesheets' ) )
$meta['stylesheet'] = array( 'name' => 'Stylesheet', 'title' => __( 'Stylesheet:', $domain ), 'type' => 'text' );
/* If the current theme supports the 'hybrid-core-template-hierarchy' and is not a page or attachment. */
if ( current_theme_supports( 'hybrid-core-template-hierarchy' ) && 'page' != $type && 'attachment' != $type ) {
/* Get the post type object. */
$post_type_object = get_post_type_object( $type );
/* If the post type object returns a singular name or name. */
if ( !empty( $post_type_object->labels->singular_name ) || !empty( $post_type_object->name ) ) {
/* Get a list of available custom templates for the post type. */
$templates = hybrid_get_post_templates( array( 'label' => array( "{$post_type_object->labels->singular_name} Template", "{$post_type_object->name} Template" ) ) );
/* If templates found, allow user to select one. */
if ( 0 != count( $templates ) )
$meta['template'] = array( 'name' => "_wp_{$type}_template", 'title' => __( 'Template:', $domain ), 'type' => 'select', 'options' => $templates, 'use_key_and_value' => true );
}
}
/* $prefix_$type_meta_boxes filter is deprecated. Use $prefix_$type_meta_box_args instead. */
$meta = apply_filters( "{$prefix}_{$type}_meta_boxes", $meta );
/* Allow per-post_type filtering of the meta box arguments. */
return apply_filters( "{$prefix}_{$type}_meta_box_args", $meta );
}
开发者ID:nerdfiles,项目名称:mabrylaw.com,代码行数:61,代码来源:post-meta-box.php
示例10: __construct
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
function __construct()
{
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_textdomain();
/* Set up the widget options. */
$widget_options = array('classname' => 'archives', 'description' => esc_html__('An advanced widget that gives you total control over the output of your archives.', $this->textdomain));
/* Set up the widget control options. */
$control_options = array('width' => 525, 'height' => 350);
/* Create the widget. */
$this->WP_Widget('hybrid-archives', __('Archives', $this->textdomain), $widget_options, $control_options);
}
开发者ID:nixter,项目名称:d.school,代码行数:15,代码来源:widget-archives.php
示例11: __construct
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
function __construct()
{
/* Set the widget prefix. */
$this->prefix = hybrid_get_prefix();
/* Set the widget textdomain. */
$this->textdomain = hybrid_get_textdomain();
/* Set up the widget options. */
$widget_options = array('classname' => 'calendar', 'description' => esc_html__('An advanced widget that gives you total control over the output of your calendar.', $this->textdomain));
/* Set up the widget control options. */
$control_options = array('width' => 200, 'height' => 350);
/* Create the widget. */
$this->WP_Widget('hybrid-calendar', __('Calendar', $this->textdomain), $widget_options, $control_options);
}
开发者ID:nixter,项目名称:d.school,代码行数:17,代码来源:widget-calendar.php
示例12: hybrid_meta_box_post_display_template
/**
* Displays the post template meta box.
*
* @since 1.2.0
*/
function hybrid_meta_box_post_display_template($object, $box)
{
/* Get the post type object. */
$post_type_object = get_post_type_object($object->post_type);
/* If the post type object returns a singular name or name. */
if (!empty($post_type_object->labels->singular_name) || !empty($post_type_object->name)) {
/* Get a list of available custom templates for the post type. */
$templates = hybrid_get_post_templates(array('label' => array("{$post_type_object->labels->singular_name} Template", "{$post_type_object->name} Template")));
}
?>
<input type="hidden" name="hybrid-core-post-meta-box-template" value="<?php
echo wp_create_nonce(basename(__FILE__));
?>
" />
<p>
<?php
if (0 != count($templates)) {
?>
<select name="hybrid-post-template" id="hybrid-post-template" class="widefat">
<option value=""></option>
<?php
foreach ($templates as $label => $template) {
?>
<option value="<?php
echo esc_attr($template);
?>
" <?php
selected(esc_attr(get_post_meta($object->ID, "_wp_{$post_type_object->name}_template", true)), esc_attr($template));
?>
><?php
echo esc_html($label);
?>
</option>
<?php
}
?>
</select>
<?php
} else {
?>
<?php
_e('No templates exist for this post type.', hybrid_get_textdomain());
?>
<?php
}
?>
</p>
<?php
}
开发者ID:nixter,项目名称:d.school,代码行数:56,代码来源:meta-box-post-template.php
示例13: hybrid_meta_box_post_display_seo
/**
* Displays the post SEO meta box.
*
* @since 1.2.0
*/
function hybrid_meta_box_post_display_seo($object, $box)
{
$domain = hybrid_get_textdomain();
?>
<input type="hidden" name="hybrid-core-post-meta-box-seo" value="<?php
echo wp_create_nonce(basename(__FILE__));
?>
" />
<div class="hybrid-post-settings">
<p>
<label for="hybrid-document-title"><?php
_e('Document Title:', $domain);
?>
</label>
<br />
<input type="text" name="hybrid-document-title" id="hybrid-document-title" value="<?php
echo esc_attr(get_post_meta($object->ID, 'Title', true));
?>
" size="30" tabindex="30" style="width: 99%;" />
</p>
<p>
<label for="hybrid-meta-description"><?php
_e('Meta Description:', $domain);
?>
</label>
<br />
<textarea name="hybrid-meta-description" id="hybrid-meta-description" cols="60" rows="2" tabindex="30" style="width: 99%;"><?php
echo esc_textarea(get_post_meta($object->ID, 'Description', true));
?>
</textarea>
</p>
<p>
<label for="hybrid-meta-keywords"><?php
_e('Meta Keywords:', $domain);
?>
</label>
<br />
<input type="text" name="hybrid-meta-keywords" id="hybrid-meta-keywords" value="<?php
echo esc_attr(get_post_meta($object->ID, 'Keywords', true));
?>
" size="30" tabindex="30" style="width: 99%;" />
</p>
</div><!-- .form-table --><?php
}
开发者ID:rdbartlett,项目名称:kellyspencer.co.nz,代码行数:55,代码来源:meta-box-post-seo.php
示例14: Hybrid_Widget_Authors
/**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 0.6
*/
function Hybrid_Widget_Authors() {
$this->prefix = hybrid_get_prefix();
$this->textdomain = hybrid_get_textdomain();
$widget_ops = array( 'classname' => 'authors', 'description' => __( 'An advanced widget that gives you total control over the output of your author lists.',$this->textdomain ) );
$control_ops = array( 'width' => 525, 'height' => 350, 'id_base' => "{$this->prefix}-authors" );
$this->WP_Widget( "{$this->prefix}-authors", __( 'Authors', $this->textdomain ), $widget_ops, $control_ops );
add_action( 'delete_user', array( &$this, 'delete_transient' ) );
add_action( 'user_register', array( &$this, 'delete_transient' ) );
add_action( 'profile_update', array( &$this, 'delete_transient' ) );
add_action( 'save_post', array( &$this, 'delete_transient' ) );
add_action( 'deleted_post', array( &$this, 'delete_transient' ) );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:18,代码来源:widget-authors.php
示例15: hybrid_load_textdomain
/**
* Filters the 'load_textdomain_mofile' filter hook so that we can change the directory and file name
* of the mofile for translations. This allows child themes to have a folder called /languages with translations
* of their parent theme so that the translations aren't lost on a parent theme upgrade.
*
* @since 0.9.0
* @param string $mofile File name of the .mo file.
* @param string $domain The textdomain currently being filtered.
*/
function hybrid_load_textdomain($mofile, $domain)
{
/* If the $domain is for the parent or child theme, search for a $domain-$locale.mo file. */
if ($domain == hybrid_get_textdomain() || $domain == hybrid_get_child_textdomain()) {
/* Check for a $domain-$locale.mo file in the parent and child theme root and /languages folder. */
$locale = get_locale();
$locate_mofile = locate_template(array("languages/{$domain}-{$locale}.mo", "{$domain}-{$locale}.mo"));
/* If a mofile was found based on the given format, set $mofile to that file name. */
if (!empty($locate_mofile)) {
$mofile = $locate_mofile;
}
}
/* Return the $mofile string. */
return $mofile;
}
开发者ID:nixter,项目名称:d.school,代码行数:24,代码来源:core.php
示例16: 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
示例17: hybrid_register_sidebars
/**
* Registers each widget area for the theme. This includes all of the asides
* and the utility widget areas throughout the theme.
*
* @since 0.7
* @uses register_sidebar() Registers a widget area.
*/
function hybrid_register_sidebars() {
$domain = hybrid_get_textdomain();
/* Register aside widget areas. */
register_sidebar( array( 'name' => __( 'Primary', $domain ), 'id' => 'primary', 'description' => __( 'The main (primary) widget area, most often used as a sidebar.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( 'Secondary', $domain ), 'id' => 'secondary', 'description' => __( 'The second most important widget area, most often used as a secondary sidebar', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( 'Subsidiary', $domain ), 'id' => 'subsidiary', 'description' => __( 'A widget area loaded in the footer of the site.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
/* Register utility widget areas. */
register_sidebar( array( 'name' => __( 'Utility: Before Content', $domain ), 'id' => 'utility-before-content', 'description' => __( 'Loaded before the page\'s main content area.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( 'Utility: After Content', $domain ), 'id' => 'utility-after-content', 'description' => __( 'Loaded after the page\'s main content area.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
register_sidebar( array( 'name' => __( 'Utility: After Singular', $domain ), 'id' => 'utility-after-singular', 'description' => __( 'Loaded on singular post (page, attachment, etc.) views before the comments area.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
/* Register template widget areas only if the templates are available. */
if ( locate_template( array( 'page-widgets.php' ) ) )
register_sidebar( array( 'name' => __( 'Widgets Template', $domain ), 'id' => 'utility-widgets-template', 'description' => __( 'Used as the content of the Widgets page template.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
if ( locate_template( array( '404.php' ) ) )
register_sidebar( array( 'name' => __( '404 Template', $domain ), 'id' => 'utility-404', 'description' => __( 'Replaces the default 404 error page content.', $domain ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
}
开发者ID:nerdfiles,项目名称:tbotw.org,代码行数:26,代码来源:widgets.php
示例18: hybrid_get_default_theme_settings
/**
* Sets up a default array of theme settings for use with the theme. Theme developers should filter the
* "{$prefix}_default_theme_settings" hook to define any default theme settings. WordPress does not
* provide a hook for default settings at this time.
*
* @since 1.0.0
*/
function hybrid_get_default_theme_settings()
{
/* Set up some default variables. */
$settings = array();
$domain = hybrid_get_textdomain();
$prefix = hybrid_get_prefix();
/* Get theme-supported meta boxes for the settings page. */
$supports = get_theme_support('hybrid-core-theme-settings');
/* If the current theme supports the footer meta box and shortcodes, add default footer settings. */
if (is_array($supports[0]) && in_array('footer', $supports[0]) && current_theme_supports('hybrid-core-shortcodes')) {
/* If there is a child theme active, add the [child-link] shortcode to the $footer_insert. */
if (is_child_theme()) {
$settings['footer_insert'] = '<p class="copyright">' . __('Copyright © [the-year] [site-link].', $domain) . '</p>' . "\n\n" . '<p class="credit">' . __('Powered by [wp-link], [theme-link], and [child-link].', $domain) . '</p>';
} else {
$settings['footer_insert'] = '<p class="copyright">' . __('Copyright © [the-year] [site-link].', $domain) . '</p>' . "\n\n" . '<p class="credit">' . __('Powered by [wp-link] and [theme-link].', $domain) . '</p>';
}
}
/* Return the $settings array and provide a hook for overwriting the default settings. */
return apply_filters("{$prefix}_default_theme_settings", $settings);
}
开发者ID:nixter,项目名称:d.school,代码行数:27,代码来源:settings.php
示例19: hybrid_register_menus
/**
* Registers the the framework's default menus based on the menus the theme has registered support for.
*
* @since 0.8.0
* @uses register_nav_menu() Registers a nav menu with WordPress.
* @link http://codex.wordpress.org/Function_Reference/register_nav_menu
*/
function hybrid_register_menus()
{
/* Get theme-supported menus. */
$menus = get_theme_support('hybrid-core-menus');
/* If there is no array of menus IDs, return. */
if (!is_array($menus[0])) {
return;
}
/* Register the 'primary' menu. */
if (in_array('primary', $menus[0])) {
register_nav_menu('primary', _x('Primary', 'nav menu location', hybrid_get_textdomain()));
}
/* Register the 'secondary' menu. */
if (in_array('secondary', $menus[0])) {
register_nav_menu('secondary', _x('Secondary', 'nav menu location', hybrid_get_textdomain()));
}
/* Register the 'subsidiary' menu. */
if (in_array('subsidiary', $menus[0])) {
register_nav_menu('subsidiary', _x('Subsidiary', 'nav menu location', hybrid_get_textdomain()));
}
}
开发者ID:rdbartlett,项目名称:kellyspencer.co.nz,代码行数:28,代码来源:menus.php
示例20: 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
注:本文中的hybrid_get_textdomain函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论