Skip to content
Browse files

Complete overhaul of how translations and internationalization is han…

…dled in the framework. All textdomains should be hardcoded strings. Therefore, the previous method of using a function across both the framework and themes built from it won't work. See: http://markjaquith.wordpress.com/2011/10/06/translating-wordpress-plugins-and-themes-dont-get-clever/

The framework and its extensions now use unique textdomains.  However, the framework filters 'gettext' to load theme translations to handle text from the framework and extensions.  This method will only work is the theme appropriately uses the template directory as its textdomain.  It's a bit of a compromise, but hooks do exist for themes to correct any changes they want to make.

Added the i18n.php file to separate language functions.  Added a few functions to facilitate this major change.

git-svn-id: http://svn.locallylost.com/themes/hybrid-core/trunk@900 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information...
1 parent 5883da0 commit abfcf472b8b0c3e259c00338d6b04a65862f7f67 greenshady committed Oct 6, 2011
View
12 admin/meta-box-post-seo.php
@@ -25,7 +25,7 @@ function hybrid_meta_box_post_add_seo( $post_type, $post ) {
/* Only add meta box if current user can edit, add, or delete meta for the post. */
if ( current_user_can( 'edit_post_meta', $post->ID ) || current_user_can( 'add_post_meta', $post->ID ) || current_user_can( 'delete_post_meta', $post->ID ) )
- add_meta_box( 'hybrid-core-post-seo', __( 'SEO', hybrid_get_textdomain() ), 'hybrid_meta_box_post_display_seo', $post_type, 'normal', 'high' );
+ add_meta_box( 'hybrid-core-post-seo', __( 'SEO', 'hybrid-core' ), 'hybrid_meta_box_post_display_seo', $post_type, 'normal', 'high' );
}
/**
@@ -36,24 +36,22 @@ function hybrid_meta_box_post_add_seo( $post_type, $post ) {
*/
function hybrid_meta_box_post_display_seo( $object, $box ) {
- $domain = hybrid_get_textdomain(); ?>
-
- <?php wp_nonce_field( basename( __FILE__ ), 'hybrid-core-post-seo' ); ?>
+ wp_nonce_field( basename( __FILE__ ), 'hybrid-core-post-seo' ); ?>
<p>
- <label for="hybrid-document-title"><?php _e( 'Document Title:', $domain ); ?></label>
+ <label for="hybrid-document-title"><?php _e( 'Document Title:', 'hybrid-core' ); ?></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>
+ <label for="hybrid-meta-description"><?php _e( 'Meta Description:', 'hybrid-core' ); ?></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>
+ <label for="hybrid-meta-keywords"><?php _e( 'Meta Keywords:', 'hybrid-core' ); ?></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>
View
4 admin/meta-box-post-template.php
@@ -26,7 +26,7 @@ function hybrid_meta_box_post_add_template( $post_type, $post ) {
/* Only add meta box if current user can edit, add, or delete meta for the post. */
if ( ( 'page' !== $post_type ) && ( current_user_can( 'edit_post_meta', $post->ID ) || current_user_can( 'add_post_meta', $post->ID ) || current_user_can( 'delete_post_meta', $post->ID ) ) )
- add_meta_box( 'hybrid-core-post-template', __( 'Template', hybrid_get_textdomain() ), 'hybrid_meta_box_post_display_template', $post_type, 'side', 'default' );
+ add_meta_box( 'hybrid-core-post-template', __( 'Template', 'hybrid-core' ), 'hybrid_meta_box_post_display_template', $post_type, 'side', 'default' );
}
/**
@@ -54,7 +54,7 @@ function hybrid_meta_box_post_display_template( $object, $box ) {
<?php } ?>
</select>
<?php } else { ?>
- <?php _e( 'No templates exist for this post type.', hybrid_get_textdomain() ); ?>
+ <?php _e( 'No templates exist for this post type.', 'hybrid-core' ); ?>
<?php } ?>
</p>
<?php
View
14 admin/meta-box-theme-about.php
@@ -21,16 +21,15 @@ function hybrid_meta_box_theme_add_about() {
/* Get theme information. */
$prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
$theme_data = hybrid_get_theme_data();
/* Adds the About box for the parent theme. */
- add_meta_box( 'hybrid-core-about-theme', sprintf( __( 'About %1$s', $domain ), $theme_data['Title'] ), 'hybrid_meta_box_theme_display_about', hybrid_get_settings_page_name(), 'side', 'high' );
+ add_meta_box( 'hybrid-core-about-theme', sprintf( __( 'About %1$s', 'hybrid-core' ), $theme_data['Title'] ), 'hybrid_meta_box_theme_display_about', hybrid_get_settings_page_name(), 'side', 'high' );
/* If the user is using a child theme, add an About box for it. */
if ( is_child_theme() ) {
$child_data = hybrid_get_theme_data( 'stylesheet' );
- add_meta_box( 'hybrid-core-about-child', sprintf( __( 'About %1$s', $domain ), $child_data['Title'] ), 'hybrid_meta_box_theme_display_about', hybrid_get_settings_page_name(), 'side', 'high' );
+ add_meta_box( 'hybrid-core-about-child', sprintf( __( 'About %1$s', 'hybrid-core' ), $child_data['Title'] ), 'hybrid_meta_box_theme_display_about', hybrid_get_settings_page_name(), 'side', 'high' );
}
}
@@ -48,39 +47,38 @@ function hybrid_meta_box_theme_display_about( $object, $box ) {
/* Get theme information. */
$prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
/* Grab theme information for the parent/child theme. */
$theme_data = ( ( 'hybrid-core-about-child' == $box['id'] ) ? hybrid_get_theme_data( 'stylesheet' ) : hybrid_get_theme_data() ); ?>
<table class="form-table">
<tr>
<th>
- <?php _e( 'Theme:', $domain ); ?>
+ <?php _e( 'Theme:', 'hybrid-core' ); ?>
</th>
<td>
<a href="<?php echo $theme_data['URI']; ?>" title="<?php echo $theme_data['Title']; ?>"><?php echo $theme_data['Title']; ?></a>
</td>
</tr>
<tr>
<th>
- <?php _e( 'Version:', $domain ); ?>
+ <?php _e( 'Version:', 'hybrid-core' ); ?>
</th>
<td>
<?php echo $theme_data['Version']; ?>
</td>
</tr>
<tr>
<th>
- <?php _e( 'Author:', $domain ); ?>
+ <?php _e( 'Author:', 'hybrid-core' ); ?>
</th>
<td>
<?php echo $theme_data['Author']; ?>
</td>
</tr>
<tr>
<th>
- <?php _e( 'Description:', $domain ); ?>
+ <?php _e( 'Description:', 'hybrid-core' ); ?>
</th>
<td>
<?php echo $theme_data['Description']; ?>
View
4 admin/meta-box-theme-footer.php
@@ -22,7 +22,7 @@
*/
function hybrid_meta_box_theme_add_footer() {
- add_meta_box( 'hybrid-core-footer', __( 'Footer settings', hybrid_get_textdomain() ), 'hybrid_meta_box_theme_display_footer', hybrid_get_settings_page_name(), 'normal', 'high' );
+ add_meta_box( 'hybrid-core-footer', __( 'Footer settings', 'hybrid-core' ), 'hybrid_meta_box_theme_display_footer', hybrid_get_settings_page_name(), 'normal', 'high' );
}
/**
@@ -44,7 +44,7 @@ function hybrid_meta_box_theme_display_footer() {
); ?>
<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_get_textdomain() ); ?></span>
+ <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 }
View
14 admin/theme-settings.php
@@ -30,7 +30,6 @@ function hybrid_settings_page_init() {
/* Get theme information. */
$theme = hybrid_get_theme_data();
$prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
/* Register theme settings. */
register_setting(
@@ -41,8 +40,8 @@ function hybrid_settings_page_init() {
/* Create the theme settings page. */
$hybrid->settings_page = add_theme_page(
- sprintf( esc_html__( '%1$s Theme Settings', $domain ), $theme['Name'] ), // Settings page name.
- esc_html__( 'Theme Settings', $domain ), // Menu item name.
+ sprintf( esc_html__( '%1$s Theme Settings', 'hybrid-core' ), $theme['Name'] ), // Settings page name.
+ esc_html__( 'Theme Settings', 'hybrid-core' ), // Menu item name.
hybrid_settings_page_capability(), // Required capability.
'theme-settings', // Screen name.
'hybrid_settings_page' // Callback function.
@@ -158,13 +157,12 @@ function hybrid_settings_page() {
/* Get the theme information. */
$prefix = hybrid_get_prefix();
- $domain = hybrid_get_textdomain();
$theme_data = hybrid_get_theme_data(); ?>
<div class="wrap">
<?php screen_icon(); ?>
- <h2><?php printf( __( '%1$s Theme Settings', $domain ), $theme_data['Name'] ); ?></h2>
+ <h2><?php printf( __( '%1$s Theme Settings', 'hybrid-core' ), $theme_data['Name'] ); ?></h2>
<?php settings_errors(); ?>
<div class="hybrid-core-settings-wrap">
@@ -181,7 +179,7 @@ function hybrid_settings_page() {
<div class="post-box-container column-3 advanced"><?php do_meta_boxes( hybrid_get_settings_page_name(), 'advanced', null ); ?></div>
</div>
- <?php submit_button( esc_attr__( 'Update Settings', $domain ) ); ?>
+ <?php submit_button( esc_attr__( 'Update Settings', 'hybrid-core' ) ); ?>
</form>
@@ -235,11 +233,11 @@ function hybrid_settings_page_contextual_help() {
/* Add the Documentation URI. */
if ( !empty( $theme['Documentation URI'] ) )
- $help .= '<li><a href="' . esc_url( $theme['Documentation URI'] ) . '">' . __( 'Documentation', hybrid_get_textdomain() ) . '</a></li>';
+ $help .= '<li><a href="' . esc_url( $theme['Documentation URI'] ) . '">' . __( 'Documentation', 'hybrid-core' ) . '</a></li>';
/* Add the Support URI. */
if ( !empty( $theme['Support URI'] ) )
- $help .= '<li><a href="' . esc_url( $theme['Support URI'] ) . '">' . __( 'Support', hybrid_get_textdomain() ) . '</a></li>';
+ $help .= '<li><a href="' . esc_url( $theme['Support URI'] ) . '">' . __( 'Support', 'hybrid-core' ) . '</a></li>';
/* Close the unordered list for the help text. */
$help .= '</ul>';
View
33 classes/widget-archives.php
@@ -18,24 +18,15 @@
class Hybrid_Widget_Archives extends WP_Widget {
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* 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 )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your archives.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -47,7 +38,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-archives', // $this->id_base
- __( 'Archives', $this->textdomain ), // $this->name
+ __( 'Archives', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -86,19 +77,19 @@ function widget( $args, $instance ) {
/* Create a title for the drop-down based on the archive type. */
if ( 'yearly' == $args['type'] )
- $option_title = esc_html__( 'Select Year', $this->textdomain );
+ $option_title = esc_html__( 'Select Year', 'hybrid-core' );
elseif ( 'monthly' == $args['type'] )
- $option_title = esc_html__( 'Select Month', $this->textdomain );
+ $option_title = esc_html__( 'Select Month', 'hybrid-core' );
elseif ( 'weekly' == $args['type'] )
- $option_title = esc_html__( 'Select Week', $this->textdomain );
+ $option_title = esc_html__( 'Select Week', 'hybrid-core' );
elseif ( 'daily' == $args['type'] )
- $option_title = esc_html__( 'Select Day', $this->textdomain );
+ $option_title = esc_html__( 'Select Day', 'hybrid-core' );
elseif ( 'postbypost' == $args['type'] || 'alpha' == $args['type'] )
- $option_title = esc_html__( 'Select Post', $this->textdomain );
+ $option_title = esc_html__( 'Select Post', 'hybrid-core' );
/* Output the <select> element and each <option>. */
echo '<p><select name="archive-dropdown" onchange=\'document.location.href=this.options[this.selectedIndex].value;\'>';
@@ -147,7 +138,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Archives', $this->textdomain ),
+ 'title' => esc_attr__( 'Archives', 'hybrid-core' ),
'limit' => 10,
'type' => 'monthly',
'format' => 'html',
@@ -160,15 +151,15 @@ function form( $instance ) {
$instance = wp_parse_args( (array) $instance, $defaults );
/* Create an array of archive types. */
- $type = array( 'alpha' => esc_attr__( 'Alphabetical', $this->textdomain ), 'daily' => esc_attr__( 'Daily', $this->textdomain ), 'monthly' => esc_attr__( 'Monthly', $this->textdomain ),'postbypost' => esc_attr__( 'Post By Post', $this->textdomain ), 'weekly' => esc_attr__( 'Weekly', $this->textdomain ), 'yearly' => esc_attr__( 'Yearly', $this->textdomain ) );
+ $type = array( 'alpha' => esc_attr__( 'Alphabetical', 'hybrid-core' ), 'daily' => esc_attr__( 'Daily', 'hybrid-core' ), 'monthly' => esc_attr__( 'Monthly', 'hybrid-core' ),'postbypost' => esc_attr__( 'Post By Post', 'hybrid-core' ), 'weekly' => esc_attr__( 'Weekly', 'hybrid-core' ), 'yearly' => esc_attr__( 'Yearly', 'hybrid-core' ) );
/* Create an array of archive formats. */
- $format = array( 'custom' => esc_attr__( 'Custom', $this->textdomain ), 'html' => esc_attr__( 'HTML', $this->textdomain ), 'option' => esc_attr__( 'Option', $this->textdomain ) );
+ $format = array( 'custom' => esc_attr__( 'Custom', 'hybrid-core' ), 'html' => esc_attr__( 'HTML', 'hybrid-core' ), 'option' => esc_attr__( 'Option', 'hybrid-core' ) );
?>
<div class="hybrid-widget-controls columns-2">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
@@ -204,7 +195,7 @@ function form( $instance ) {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_post_count' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_post_count'], true ); ?> id="<?php echo $this->get_field_id( 'show_post_count' ); ?>" name="<?php echo $this->get_field_name( 'show_post_count' ); ?>" /> <?php _e( 'Show post count?', $this->textdomain ); ?> <code>show_post_count</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_post_count'], true ); ?> id="<?php echo $this->get_field_id( 'show_post_count' ); ?>" name="<?php echo $this->get_field_name( 'show_post_count' ); ?>" /> <?php _e( 'Show post count?', 'hybrid-core' ); ?> <code>show_post_count</code></label>
</p>
</div>
<div style="clear:both;">&nbsp;</div>
View
33 classes/widget-authors.php
@@ -24,12 +24,6 @@ class Hybrid_Widget_Authors extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -38,13 +32,10 @@ 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' => 'authors',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your author lists.', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your author lists.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -56,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-authors', // $this->id_base
- __( 'Authors', $this->textdomain ), // $this->name
+ __( 'Authors', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -138,7 +129,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Authors', $this->textdomain ),
+ 'title' => esc_attr__( 'Authors', 'hybrid-core' ),
'order' => 'ASC',
'orderby' => 'display_name',
'number' => '',
@@ -155,14 +146,14 @@ function form( $instance ) {
/* Merge the user-selected arguments with the defaults. */
$instance = wp_parse_args( (array) $instance, $defaults );
- $order = array( 'ASC' => esc_attr__( 'Ascending', $this->textdomain ), 'DESC' => esc_attr__( 'Descending', $this->textdomain ) );
- $orderby = array( 'display_name' => esc_attr__( 'Display Name', $this->textdomain ), 'email' => esc_attr__( 'Email', $this->textdomain ), 'ID' => esc_attr__( 'ID', $this->textdomain ), 'nicename' => esc_attr__( 'Nice Name', $this->textdomain ), 'post_count' => esc_attr__( 'Post Count', $this->textdomain ), 'registered' => esc_attr__( 'Registered', $this->textdomain ), 'url' => esc_attr__( 'URL', $this->textdomain ), 'user_login' => esc_attr__( 'Login', $this->textdomain ) );
+ $order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ) );
+ $orderby = array( 'display_name' => esc_attr__( 'Display Name', 'hybrid-core' ), 'email' => esc_attr__( 'Email', 'hybrid-core' ), 'ID' => esc_attr__( 'ID', 'hybrid-core' ), 'nicename' => esc_attr__( 'Nice Name', 'hybrid-core' ), 'post_count' => esc_attr__( 'Post Count', 'hybrid-core' ), 'registered' => esc_attr__( 'Registered', 'hybrid-core' ), 'url' => esc_attr__( 'URL', 'hybrid-core' ), 'user_login' => esc_attr__( 'Login', 'hybrid-core' ) );
?>
<div class="hybrid-widget-controls columns-2">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
@@ -188,7 +179,7 @@ function form( $instance ) {
<p>
<label for="<?php echo $this->get_field_id( 'style' ); ?>"><code>style</code></label>
<select class="widefat" id="<?php echo $this->get_field_id( 'style' ); ?>" name="<?php echo $this->get_field_name( 'style' ); ?>">
- <?php foreach ( array( 'list' => esc_attr__( 'List', $this->textdomain), 'none' => esc_attr__( 'None', $this->textdomain ) ) as $option_value => $option_label ) { ?>
+ <?php foreach ( array( 'list' => esc_attr__( 'List', 'hybrid-core'), 'none' => esc_attr__( 'None', 'hybrid-core' ) ) as $option_value => $option_label ) { ?>
<option value="<?php echo esc_attr( $option_value ); ?>" <?php selected( $instance['style'], $option_value ); ?>><?php echo esc_html( $option_label ); ?></option>
<?php } ?>
</select>
@@ -206,23 +197,23 @@ function form( $instance ) {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'html' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['html'], true ); ?> id="<?php echo $this->get_field_id( 'html' ); ?>" name="<?php echo $this->get_field_name( 'html' ); ?>" /> <?php _e( '<acronym title="Hypertext Markup Language">HTML</acronym>?', $this->textdomain ); ?> <code>html</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['html'], true ); ?> id="<?php echo $this->get_field_id( 'html' ); ?>" name="<?php echo $this->get_field_name( 'html' ); ?>" /> <?php _e( '<acronym title="Hypertext Markup Language">HTML</acronym>?', 'hybrid-core' ); ?> <code>html</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'optioncount' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['optioncount'], true ); ?> id="<?php echo $this->get_field_id( 'optioncount' ); ?>" name="<?php echo $this->get_field_name( 'optioncount' ); ?>" /> <?php _e( 'Show post count?', $this->textdomain ); ?> <code>optioncount</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['optioncount'], true ); ?> id="<?php echo $this->get_field_id( 'optioncount' ); ?>" name="<?php echo $this->get_field_name( 'optioncount' ); ?>" /> <?php _e( 'Show post count?', 'hybrid-core' ); ?> <code>optioncount</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'exclude_admin' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['exclude_admin'], true ); ?> id="<?php echo $this->get_field_id( 'exclude_admin' ); ?>" name="<?php echo $this->get_field_name( 'exclude_admin' ); ?>" /> <?php _e( 'Exclude admin?', $this->textdomain ); ?> <code>exclude_admin</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['exclude_admin'], true ); ?> id="<?php echo $this->get_field_id( 'exclude_admin' ); ?>" name="<?php echo $this->get_field_name( 'exclude_admin' ); ?>" /> <?php _e( 'Exclude admin?', 'hybrid-core' ); ?> <code>exclude_admin</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_fullname' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_fullname'], true ); ?> id="<?php echo $this->get_field_id( 'show_fullname' ); ?>" name="<?php echo $this->get_field_name( 'show_fullname' ); ?>" /> <?php _e( 'Show full name?', $this->textdomain ); ?> <code>show_fullname</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_fullname'], true ); ?> id="<?php echo $this->get_field_id( 'show_fullname' ); ?>" name="<?php echo $this->get_field_name( 'show_fullname' ); ?>" /> <?php _e( 'Show full name?', 'hybrid-core' ); ?> <code>show_fullname</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', $this->textdomain ); ?> <code>hide_empty</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', 'hybrid-core' ); ?> <code>hide_empty</code></label>
</p>
</div>
<div style="clear:both;">&nbsp;</div>
View
41 classes/widget-bookmarks.php
@@ -24,12 +24,6 @@ class Hybrid_Widget_Bookmarks extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -38,13 +32,10 @@ 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' => 'bookmarks',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your bookmarks (links).', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your bookmarks (links).', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -56,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-bookmarks', // $this->id_base
- __( 'Bookmarks', $this->textdomain ), // $this->name
+ __( 'Bookmarks', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -155,7 +146,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title_li' => esc_attr__( 'Bookmarks', $this->textdomain ),
+ 'title_li' => esc_attr__( 'Bookmarks', 'hybrid-core' ),
'categorize' => true,
'category_order' => 'ASC',
'category_orderby' => 'name',
@@ -185,16 +176,16 @@ function form( $instance ) {
$terms = get_terms( 'link_category' );
$bookmarks = get_bookmarks( array( 'hide_invisible' => false ) );
- $category_order = array( 'ASC' => esc_attr__( 'Ascending', $this->textdomain ), 'DESC' => esc_attr__( 'Descending', $this->textdomain ) );
- $category_orderby = array( 'count' => esc_attr__( 'Count', $this->textdomain ), 'ID' => esc_attr__( 'ID', $this->textdomain ), 'name' => esc_attr__( 'Name', $this->textdomain ), 'slug' => esc_attr__( 'Slug', $this->textdomain ) );
- $order = array( 'ASC' => esc_attr__( 'Ascending', $this->textdomain ), 'DESC' => esc_attr__( 'Descending', $this->textdomain ) );
- $orderby = array( 'id' => esc_attr__( 'ID', $this->textdomain ), 'description' => esc_attr__( 'Description', $this->textdomain ), 'length' => esc_attr__( 'Length', $this->textdomain ), 'name' => esc_attr__( 'Name', $this->textdomain ), 'notes' => esc_attr__( 'Notes', $this->textdomain ), 'owner' => esc_attr__( 'Owner', $this->textdomain ), 'rand' => esc_attr__( 'Random', $this->textdomain ), 'rating' => esc_attr__( 'Rating', $this->textdomain ), 'rel' => esc_attr__( 'Rel', $this->textdomain ), 'rss' => esc_attr__( 'RSS', $this->textdomain ), 'target' => esc_attr__( 'Target', $this->textdomain ), 'updated' => esc_attr__( 'Updated', $this->textdomain ), 'url' => esc_attr__( 'URL', $this->textdomain ) );
+ $category_order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ) );
+ $category_orderby = array( 'count' => esc_attr__( 'Count', 'hybrid-core' ), 'ID' => esc_attr__( 'ID', 'hybrid-core' ), 'name' => esc_attr__( 'Name', 'hybrid-core' ), 'slug' => esc_attr__( 'Slug', 'hybrid-core' ) );
+ $order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ) );
+ $orderby = array( 'id' => esc_attr__( 'ID', 'hybrid-core' ), 'description' => esc_attr__( 'Description', 'hybrid-core' ), 'length' => esc_attr__( 'Length', 'hybrid-core' ), 'name' => esc_attr__( 'Name', 'hybrid-core' ), 'notes' => esc_attr__( 'Notes', 'hybrid-core' ), 'owner' => esc_attr__( 'Owner', 'hybrid-core' ), 'rand' => esc_attr__( 'Random', 'hybrid-core' ), 'rating' => esc_attr__( 'Rating', 'hybrid-core' ), 'rel' => esc_attr__( 'Rel', 'hybrid-core' ), 'rss' => esc_attr__( 'RSS', 'hybrid-core' ), 'target' => esc_attr__( 'Target', 'hybrid-core' ), 'updated' => esc_attr__( 'Updated', 'hybrid-core' ), 'url' => esc_attr__( 'URL', 'hybrid-core' ) );
?>
<div class="hybrid-widget-controls columns-3">
<p>
- <label for="<?php echo $this->get_field_id( 'title_li' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title_li' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title_li' ); ?>" name="<?php echo $this->get_field_name( 'title_li' ); ?>" value="<?php echo esc_attr( $instance['title_li'] ); ?>" />
</p>
<p>
@@ -296,35 +287,35 @@ function form( $instance ) {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'categorize' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['categorize'], true ); ?> id="<?php echo $this->get_field_id( 'categorize' ); ?>" name="<?php echo $this->get_field_name( 'categorize' ); ?>" /> <?php _e( 'Categorize?', $this->textdomain ); ?> <code>categorize</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['categorize'], true ); ?> id="<?php echo $this->get_field_id( 'categorize' ); ?>" name="<?php echo $this->get_field_name( 'categorize' ); ?>" /> <?php _e( 'Categorize?', 'hybrid-core' ); ?> <code>categorize</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_description' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_description'], true ); ?> id="<?php echo $this->get_field_id( 'show_description' ); ?>" name="<?php echo $this->get_field_name( 'show_description' ); ?>" /> <?php _e( 'Show description?', $this->textdomain ); ?> <code>show_description</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_description'], true ); ?> id="<?php echo $this->get_field_id( 'show_description' ); ?>" name="<?php echo $this->get_field_name( 'show_description' ); ?>" /> <?php _e( 'Show description?', 'hybrid-core' ); ?> <code>show_description</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'hide_invisible' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hide_invisible'], true ); ?> id="<?php echo $this->get_field_id( 'hide_invisible' ); ?>" name="<?php echo $this->get_field_name( 'hide_invisible' ); ?>" /> <?php _e( 'Hide invisible?', $this->textdomain ); ?> <code>hide_invisible</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['hide_invisible'], true ); ?> id="<?php echo $this->get_field_id( 'hide_invisible' ); ?>" name="<?php echo $this->get_field_name( 'hide_invisible' ); ?>" /> <?php _e( 'Hide invisible?', 'hybrid-core' ); ?> <code>hide_invisible</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_rating' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_rating'], true ); ?> id="<?php echo $this->get_field_id( 'show_rating' ); ?>" name="<?php echo $this->get_field_name( 'show_rating' ); ?>" /> <?php _e( 'Show rating?', $this->textdomain ); ?> <code>show_rating</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_rating'], true ); ?> id="<?php echo $this->get_field_id( 'show_rating' ); ?>" name="<?php echo $this->get_field_name( 'show_rating' ); ?>" /> <?php _e( 'Show rating?', 'hybrid-core' ); ?> <code>show_rating</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_updated' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_updated'], true ); ?> id="<?php echo $this->get_field_id( 'show_updated' ); ?>" name="<?php echo $this->get_field_name( 'show_updated' ); ?>" /> <?php _e( 'Show updated?', $this->textdomain ); ?> <code>show_updated</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_updated'], true ); ?> id="<?php echo $this->get_field_id( 'show_updated' ); ?>" name="<?php echo $this->get_field_name( 'show_updated' ); ?>" /> <?php _e( 'Show updated?', 'hybrid-core' ); ?> <code>show_updated</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_images' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_images'], true ); ?> id="<?php echo $this->get_field_id( 'show_images' ); ?>" name="<?php echo $this->get_field_name( 'show_images' ); ?>" /> <?php _e( 'Show images?', $this->textdomain ); ?> <code>show_images</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_images'], true ); ?> id="<?php echo $this->get_field_id( 'show_images' ); ?>" name="<?php echo $this->get_field_name( 'show_images' ); ?>" /> <?php _e( 'Show images?', 'hybrid-core' ); ?> <code>show_images</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_name' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_name'], true ); ?> id="<?php echo $this->get_field_id( 'show_name' ); ?>" name="<?php echo $this->get_field_name( 'show_name' ); ?>" /> <?php _e( 'Show name?', $this->textdomain ); ?> <code>show_name</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_name'], true ); ?> id="<?php echo $this->get_field_id( 'show_name' ); ?>" name="<?php echo $this->get_field_name( 'show_name' ); ?>" /> <?php _e( 'Show name?', 'hybrid-core' ); ?> <code>show_name</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_private' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_private'], true ); ?> id="<?php echo $this->get_field_id( 'show_private' ); ?>" name="<?php echo $this->get_field_name( 'show_private' ); ?>" /> <?php _e( 'Show private?', $this->textdomain ); ?> <code>show_private</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_private'], true ); ?> id="<?php echo $this->get_field_id( 'show_private' ); ?>" name="<?php echo $this->get_field_name( 'show_private' ); ?>" /> <?php _e( 'Show private?', 'hybrid-core' ); ?> <code>show_private</code></label>
</p>
</div>
View
19 classes/widget-calendar.php
@@ -24,12 +24,6 @@ class Hybrid_Widget_Calendar extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -38,13 +32,10 @@ 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 )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your calendar.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -56,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-calendar', // $this->id_base
- __( 'Calendar', $this->textdomain ), // $this->name
+ __( 'Calendar', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -111,7 +102,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Calendar', $this->textdomain ),
+ 'title' => esc_attr__( 'Calendar', 'hybrid-core' ),
'initial' => false
);
@@ -120,12 +111,12 @@ function form( $instance ) {
<div class="hybrid-widget-controls columns-1">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
<input class="checkbox" type="checkbox" <?php checked( $instance['initial'], true ); ?> id="<?php echo $this->get_field_id( 'initial' ); ?>" name="<?php echo $this->get_field_name( 'initial' ); ?>" />
- <label for="<?php echo $this->get_field_id( 'initial' ); ?>"><?php _e( 'One-letter abbreviation?', $this->textdomain ); ?> <code>initial</code></label>
+ <label for="<?php echo $this->get_field_id( 'initial' ); ?>"><?php _e( 'One-letter abbreviation?', 'hybrid-core' ); ?> <code>initial</code></label>
</p>
</div>
<?php
View
35 classes/widget-categories.php
@@ -24,12 +24,6 @@ class Hybrid_Widget_Categories extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -38,13 +32,10 @@ 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' => 'categories',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your category links.', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your category links.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -56,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-categories', // $this->id_base
- __( 'Categories', $this->textdomain ), // $this->name
+ __( 'Categories', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -160,7 +151,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Categories', $this->textdomain ),
+ 'title' => esc_attr__( 'Categories', 'hybrid-core' ),
'taxonomy' => 'category',
'style' => 'list',
'include' => array(),
@@ -189,16 +180,16 @@ function form( $instance ) {
/* <select> element options. */
$taxonomies = get_taxonomies( array( 'show_tagcloud' => true ), 'objects' );
$terms = get_terms( $instance['taxonomy'] );
- $style = array( 'list' => esc_attr__( 'List', $this->textdomain ), 'none' => esc_attr__( 'None', $this->textdomain ) );
- $order = array( 'ASC' => esc_attr__( 'Ascending', $this->textdomain ), 'DESC' => esc_attr__( 'Descending', $this->textdomain ) );
- $orderby = array( 'count' => esc_attr__( 'Count', $this->textdomain ), 'ID' => esc_attr__( 'ID', $this->textdomain ), 'name' => esc_attr__( 'Name', $this->textdomain ), 'slug' => esc_attr__( 'Slug', $this->textdomain ), 'term_group' => esc_attr__( 'Term Group', $this->textdomain ) );
- $feed_type = array( '' => '', 'atom' => esc_attr__( 'Atom', $this->textdomain ), 'rdf' => esc_attr__( 'RDF', $this->textdomain ), 'rss' => esc_attr__( 'RSS', $this->textdomain ), 'rss2' => esc_attr__( 'RSS 2.0', $this->textdomain ) );
+ $style = array( 'list' => esc_attr__( 'List', 'hybrid-core' ), 'none' => esc_attr__( 'None', 'hybrid-core' ) );
+ $order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ) );
+ $orderby = array( 'count' => esc_attr__( 'Count', 'hybrid-core' ), 'ID' => esc_attr__( 'ID', 'hybrid-core' ), 'name' => esc_attr__( 'Name', 'hybrid-core' ), 'slug' => esc_attr__( 'Slug', 'hybrid-core' ), 'term_group' => esc_attr__( 'Term Group', 'hybrid-core' ) );
+ $feed_type = array( '' => '', 'atom' => esc_attr__( 'Atom', 'hybrid-core' ), 'rdf' => esc_attr__( 'RDF', 'hybrid-core' ), 'rss' => esc_attr__( 'RSS', 'hybrid-core' ), 'rss2' => esc_attr__( 'RSS 2.0', 'hybrid-core' ) );
?>
<div class="hybrid-widget-controls columns-3">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
@@ -297,23 +288,23 @@ function form( $instance ) {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'hierarchical' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hierarchical'], true ); ?> id="<?php echo $this->get_field_id( 'hierarchical' ); ?>" name="<?php echo $this->get_field_name( 'hierarchical' ); ?>" /> <?php _e( 'Hierarchical?', $this->textdomain ); ?> <code>hierarchical</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['hierarchical'], true ); ?> id="<?php echo $this->get_field_id( 'hierarchical' ); ?>" name="<?php echo $this->get_field_name( 'hierarchical' ); ?>" /> <?php _e( 'Hierarchical?', 'hybrid-core' ); ?> <code>hierarchical</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'use_desc_for_title' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['use_desc_for_title'], true ); ?> id="<?php echo $this->get_field_id( 'use_desc_for_title' ); ?>" name="<?php echo $this->get_field_name( 'use_desc_for_title' ); ?>" /> <?php _e( 'Use description?', $this->textdomain ); ?> <code>use_desc_for_title</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['use_desc_for_title'], true ); ?> id="<?php echo $this->get_field_id( 'use_desc_for_title' ); ?>" name="<?php echo $this->get_field_name( 'use_desc_for_title' ); ?>" /> <?php _e( 'Use description?', 'hybrid-core' ); ?> <code>use_desc_for_title</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_last_update' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_last_update'], true ); ?> id="<?php echo $this->get_field_id( 'show_last_update' ); ?>" name="<?php echo $this->get_field_name( 'show_last_update' ); ?>" /> <?php _e( 'Show last update?', $this->textdomain ); ?> <code>show_last_update</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_last_update'], true ); ?> id="<?php echo $this->get_field_id( 'show_last_update' ); ?>" name="<?php echo $this->get_field_name( 'show_last_update' ); ?>" /> <?php _e( 'Show last update?', 'hybrid-core' ); ?> <code>show_last_update</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'show_count' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['show_count'], true ); ?> id="<?php echo $this->get_field_id( 'show_count' ); ?>" name="<?php echo $this->get_field_name( 'show_count' ); ?>" /> <?php _e( 'Show count?', $this->textdomain ); ?> <code>show_count</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['show_count'], true ); ?> id="<?php echo $this->get_field_id( 'show_count' ); ?>" name="<?php echo $this->get_field_name( 'show_count' ); ?>" /> <?php _e( 'Show count?', 'hybrid-core' ); ?> <code>show_count</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', $this->textdomain ); ?> <code>hide_empty</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', 'hybrid-core' ); ?> <code>hide_empty</code></label>
</p>
</div>
<div style="clear:both;">&nbsp;</div>
View
17 classes/widget-nav-menu.php
@@ -23,12 +23,6 @@ class Hybrid_Widget_Nav_Menu extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.8.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -37,13 +31,10 @@ 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' => 'nav-menu',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your menus.', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your menus.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -55,7 +46,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-nav-menu', // $this->id_base
- __( 'Navigation Menu', $this->textdomain ), // $this->name
+ __( 'Navigation Menu', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -129,7 +120,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Navigation', $this->textdomain ),
+ 'title' => esc_attr__( 'Navigation', 'hybrid-core' ),
'menu' => '',
'container' => 'div',
'container_id' => '',
@@ -153,7 +144,7 @@ function form( $instance ) {
<div class="hybrid-widget-controls columns-2">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
View
19 classes/widget-pages.php
@@ -32,13 +32,10 @@ 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' => 'pages',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your page links.', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your page links.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -50,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-pages', // $this->id_base
- __( 'Pages', $this->textdomain), // $this->name
+ __( 'Pages', 'hybrid-core'), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -138,7 +135,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Pages', $this->textdomain),
+ 'title' => esc_attr__( 'Pages', 'hybrid-core'),
'depth' => 0,
'number' => '',
'offset' => '',
@@ -166,16 +163,16 @@ function form( $instance ) {
foreach ( $posts as $post )
$authors[$post->post_author] = get_the_author_meta( 'display_name', $post->post_author );
- $sort_order = array( 'ASC' => esc_attr__( 'Ascending', $this->textdomain ), 'DESC' => esc_attr__( 'Descending', $this->textdomain ) );
- $sort_column = array( 'post_author' => esc_attr__( 'Author', $this->textdomain ), 'post_date' => esc_attr__( 'Date', $this->textdomain ), 'ID' => esc_attr__( 'ID', $this->textdomain ), 'menu_order' => esc_attr__( 'Menu Order', $this->textdomain ), 'post_modified' => esc_attr__( 'Modified', $this->textdomain ), 'post_name' => esc_attr__( 'Slug', $this->textdomain ), 'post_title' => esc_attr__( 'Title', $this->textdomain ) );
- $show_date = array( '' => '', 'created' => esc_attr__( 'Created', $this->textdomain ), 'modified' => esc_attr__( 'Modified', $this->textdomain ) );
+ $sort_order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ) );
+ $sort_column = array( 'post_author' => esc_attr__( 'Author', 'hybrid-core' ), 'post_date' => esc_attr__( 'Date', 'hybrid-core' ), 'ID' => esc_attr__( 'ID', 'hybrid-core' ), 'menu_order' => esc_attr__( 'Menu Order', 'hybrid-core' ), 'post_modified' => esc_attr__( 'Modified', 'hybrid-core' ), 'post_name' => esc_attr__( 'Slug', 'hybrid-core' ), 'post_title' => esc_attr__( 'Title', 'hybrid-core' ) );
+ $show_date = array( '' => '', 'created' => esc_attr__( 'Created', 'hybrid-core' ), 'modified' => esc_attr__( 'Modified', 'hybrid-core' ) );
$meta_key = array_merge( array( '' ), (array) get_meta_keys() );
?>
<div class="hybrid-widget-controls columns-3">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
@@ -278,7 +275,7 @@ function form( $instance ) {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'hierarchical' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hierarchical'], true ); ?> id="<?php echo $this->get_field_id( 'hierarchical' ); ?>" name="<?php echo $this->get_field_name( 'hierarchical' ); ?>" /> <?php _e( 'Hierarchical?', $this->textdomain); ?> <code>hierarchical</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['hierarchical'], true ); ?> id="<?php echo $this->get_field_id( 'hierarchical' ); ?>" name="<?php echo $this->get_field_name( 'hierarchical' ); ?>" /> <?php _e( 'Hierarchical?', 'hybrid-core'); ?> <code>hierarchical</code></label>
</p>
</div>
<div style="clear:both;">&nbsp;</div>
View
25 classes/widget-search.php
@@ -24,12 +24,6 @@ class Hybrid_Widget_Search extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -38,13 +32,10 @@ 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' => 'search',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your search form.', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your search form.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -56,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-search', // $this->id_base
- __( 'Search', $this->textdomain ), // $this->name
+ __( 'Search', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -139,7 +130,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Search', $this->textdomain ),
+ 'title' => esc_attr__( 'Search', 'hybrid-core' ),
'theme_search' => false,
'search_label' => '',
'search_text' => '',
@@ -151,27 +142,27 @@ function form( $instance ) {
<div class="hybrid-widget-controls columns-2">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
- <label for="<?php echo $this->get_field_id( 'search_label' ); ?>"><?php _e( 'Search Label:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'search_label' ); ?>"><?php _e( 'Search Label:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'search_label' ); ?>" name="<?php echo $this->get_field_name( 'search_label' ); ?>" value="<?php echo esc_attr( $instance['search_label'] ); ?>" />
</p>
<p>
- <label for="<?php echo $this->get_field_id( 'search_text' ); ?>"><?php _e( 'Search Text:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'search_text' ); ?>"><?php _e( 'Search Text:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'search_text' ); ?>" name="<?php echo $this->get_field_name( 'search_text' ); ?>" value="<?php echo esc_attr( $instance['search_text'] ); ?>" />
</p>
</div>
<div class="hybrid-widget-controls columns-2 column-last">
<p>
- <label for="<?php echo $this->get_field_id( 'search_submit' ); ?>"><?php _e( 'Search Submit:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'search_submit' ); ?>"><?php _e( 'Search Submit:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'search_submit' ); ?>" name="<?php echo $this->get_field_name( 'search_submit' ); ?>" value="<?php echo esc_attr( $instance['search_submit'] ); ?>" />
</p>
<p>
<label for="<?php echo $this->get_field_id( 'theme_search' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['theme_search'], true ); ?> id="<?php echo $this->get_field_id( 'theme_search' ); ?>" name="<?php echo $this->get_field_name( 'theme_search' ); ?>" /> <?php _e( 'Use theme\'s <code>searchform.php</code>?', $this->textdomain ); ?></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['theme_search'], true ); ?> id="<?php echo $this->get_field_id( 'theme_search' ); ?>" name="<?php echo $this->get_field_name( 'theme_search' ); ?>" /> <?php _e( 'Use theme\'s <code>searchform.php</code>?', 'hybrid-core' ); ?></label>
</p>
</div>
<div style="clear:both;">&nbsp;</div>
View
29 classes/widget-tags.php
@@ -24,12 +24,6 @@ class Hybrid_Widget_Tags extends WP_Widget {
var $prefix;
/**
- * Textdomain for the widget.
- * @since 0.7.0
- */
- var $textdomain;
-
- /**
* Set up the widget's unique name, ID, class, description, and other options.
* @since 1.2.0
*/
@@ -38,13 +32,10 @@ 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' => 'tags',
- 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your tags.', $this->textdomain )
+ 'description' => esc_html__( 'An advanced widget that gives you total control over the output of your tags.', 'hybrid-core' )
);
/* Set up the widget control options. */
@@ -56,7 +47,7 @@ function __construct() {
/* Create the widget. */
$this->WP_Widget(
'hybrid-tags', // $this->id_base
- __( 'Tags', $this->textdomain ), // $this->name
+ __( 'Tags', 'hybrid-core' ), // $this->name
$widget_options, // $this->widget_options
$control_options // $this->control_options
);
@@ -158,7 +149,7 @@ function form( $instance ) {
/* Set up the default form values. */
$defaults = array(
- 'title' => esc_attr__( 'Tags', $this->textdomain ),
+ 'title' => esc_attr__( 'Tags', 'hybrid-core' ),
'order' => 'ASC',
'orderby' => 'name',
'format' => 'flat',
@@ -185,17 +176,17 @@ function form( $instance ) {
/* <select> element options. */
$taxonomies = get_taxonomies( array( 'show_tagcloud' => true ), 'objects' );
$terms = get_terms( $instance['taxonomy'] );
- $link = array( 'view' => esc_attr__( 'View', $this->textdomain ), 'edit' => esc_attr__( 'Edit', $this->textdomain ) );
- $format = array( 'flat' => esc_attr__( 'Flat', $this->textdomain ), 'list' => esc_attr__( 'List', $this->textdomain ) );
- $order = array( 'ASC' => esc_attr__( 'Ascending', $this->textdomain ), 'DESC' => esc_attr__( 'Descending', $this->textdomain ), 'RAND' => esc_attr__( 'Random', $this->textdomain ) );
- $orderby = array( 'count' => esc_attr__( 'Count', $this->textdomain ), 'name' => esc_attr__( 'Name', $this->textdomain ) );
+ $link = array( 'view' => esc_attr__( 'View', 'hybrid-core' ), 'edit' => esc_attr__( 'Edit', 'hybrid-core' ) );
+ $format = array( 'flat' => esc_attr__( 'Flat', 'hybrid-core' ), 'list' => esc_attr__( 'List', 'hybrid-core' ) );
+ $order = array( 'ASC' => esc_attr__( 'Ascending', 'hybrid-core' ), 'DESC' => esc_attr__( 'Descending', 'hybrid-core' ), 'RAND' => esc_attr__( 'Random', 'hybrid-core' ) );
+ $orderby = array( 'count' => esc_attr__( 'Count', 'hybrid-core' ), 'name' => esc_attr__( 'Name', 'hybrid-core' ) );
$unit = array( 'pt' => 'pt', 'px' => 'px', 'em' => 'em', '%' => '%' );
?>
<div class="hybrid-widget-controls columns-3">
<p>
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', $this->textdomain ); ?></label>
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'hybrid-core' ); ?></label>
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>" />
</p>
<p>
@@ -302,11 +293,11 @@ function form( $instance ) {
</p>
<p>
<label for="<?php echo $this->get_field_id( 'pad_counts' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['pad_counts'], true ); ?> id="<?php echo $this->get_field_id( 'pad_counts' ); ?>" name="<?php echo $this->get_field_name( 'pad_counts' ); ?>" /> <?php _e( 'Pad counts?', $this->textdomain ); ?> <code>pad_counts</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['pad_counts'], true ); ?> id="<?php echo $this->get_field_id( 'pad_counts' ); ?>" name="<?php echo $this->get_field_name( 'pad_counts' ); ?>" /> <?php _e( 'Pad counts?', 'hybrid-core' ); ?> <code>pad_counts</code></label>
</p>
<p>
<label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>">
- <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', $this->textdomain ); ?> <code>hide_empty</code></label>
+ <input class="checkbox" type="checkbox" <?php checked( $instance['hide_empty'], true ); ?> id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" /> <?php _e( 'Hide empty?', 'hybrid-core' ); ?> <code>hide_empty</code></label>
</p>
</div>
<div style="clear:both;">&nbsp;</div>
View
47 extensions/breadcrumb-trail.php
@@ -14,7 +14,7 @@
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @package BreadcrumbTrail
- * @version 0.4.1
+ * @version 0.5.0
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2008 - 2011, Justin Tadlock
* @link http://justintadlock.com/archives/2009/04/05/breadcrumb-trail-wordpress-plugin
@@ -32,19 +32,16 @@
*/
function breadcrumb_trail( $args = array() ) {
- /* Get the textdomain. */
- $textdomain = breadcrumb_trail_textdomain();
-
/* Create an empty variable for the breadcrumb. */
$breadcrumb = '';
/* Set up the default arguments for the breadcrumb. */
$defaults = array(
'separator' => '/',
- 'before' => __( 'Browse:', $textdomain ),
+ 'before' => __( 'Browse:', 'breadcrumb-trail' ),
'after' => false,
'front_page' => true,
- 'show_home' => __( 'Home', $textdomain ),
+ 'show_home' => __( 'Home', 'breadcrumb-trail' ),
'echo' => true
);
@@ -112,9 +109,6 @@ function breadcrumb_trail( $args = array() ) {
function breadcrumb_trail_get_items( $args = array() ) {
global $wp_rewrite;
- /* Get the textdomain. */
- $textdomain = breadcrumb_trail_textdomain();
-
/* Set up an empty trail array and empty path. */
$trail = array();
$path = '';
@@ -292,13 +286,13 @@ function breadcrumb_trail_get_items( $args = array() ) {
elseif ( is_time() ) {
if ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
- $trail['trail_end'] = get_the_time( __( 'g:i a', $textdomain ) );
+ $trail['trail_end'] = get_the_time( __( 'g:i a', 'breadcrumb-trail' ) );
elseif ( get_query_var( 'minute' ) )
- $trail['trail_end'] = sprintf( __( 'Minute %1$s', $textdomain ), get_the_time( __( 'i', $textdomain ) ) );
+ $trail['trail_end'] = sprintf( __( 'Minute %1$s', 'breadcrumb-trail' ), get_the_time( __( 'i', 'breadcrumb-trail' ) ) );
elseif ( get_query_var( 'hour' ) )
- $trail['trail_end'] = get_the_time( __( 'g a', $textdomain ) );
+ $trail['trail_end'] = get_the_time( __( 'g a', 'breadcrumb-trail' ) );
}
/* If viewing a date-based archive. */
@@ -309,34 +303,34 @@ function breadcrumb_trail_get_items( $args = array() ) {
$trail = array_merge( $trail, breadcrumb_trail_get_parents( '', $wp_rewrite->front ) );
if ( is_day() ) {
- $trail[] = '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '" title="' . get_the_time( esc_attr__( 'Y', $textdomain ) ) . '">' . get_the_time( __( 'Y', $textdomain ) ) . '</a>';
- $trail[] = '<a href="' . get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) . '" title="' . get_the_time( esc_attr__( 'F', $textdomain ) ) . '">' . get_the_time( __( 'F', $textdomain ) ) . '</a>';
- $trail['trail_end'] = get_the_time( __( 'd', $textdomain ) );
+ $trail[] = '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '" title="' . get_the_time( esc_attr__( 'Y', 'breadcrumb-trail' ) ) . '">' . get_the_time( __( 'Y', 'breadcrumb-trail' ) ) . '</a>';
+ $trail[] = '<a href="' . get_month_link( get_the_time( 'Y' ), get_the_time( 'm' ) ) . '" title="' . get_the_time( esc_attr__( 'F', 'breadcrumb-trail' ) ) . '">' . get_the_time( __( 'F', 'breadcrumb-trail' ) ) . '</a>';
+ $trail['trail_end'] = get_the_time( __( 'd', 'breadcrumb-trail' ) );
}
elseif ( get_query_var( 'w' ) ) {
- $trail[] = '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '" title="' . get_the_time( esc_attr__( 'Y', $textdomain ) ) . '">' . get_the_time( __( 'Y', $textdomain ) ) . '</a>';
- $trail['trail_end'] = sprintf( __( 'Week %1$s', $textdomain ), get_the_time( esc_attr__( 'W', $textdomain ) ) );
+ $trail[] = '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '" title="' . get_the_time( esc_attr__( 'Y', 'breadcrumb-trail' ) ) . '">' . get_the_time( __( 'Y', 'breadcrumb-trail' ) ) . '</a>';
+ $trail['trail_end'] = sprintf( __( 'Week %1$s', 'breadcrumb-trail' ), get_the_time( esc_attr__( 'W', 'breadcrumb-trail' ) ) );
}
elseif ( is_month() ) {
- $trail[] = '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '" title="' . get_the_time( esc_attr__( 'Y', $textdomain ) ) . '">' . get_the_time( __( 'Y', $textdomain ) ) . '</a>';
- $trail['trail_end'] = get_the_time( __( 'F', $textdomain ) );
+ $trail[] = '<a href="' . get_year_link( get_the_time( 'Y' ) ) . '" title="' . get_the_time( esc_attr__( 'Y', 'breadcrumb-trail' ) ) . '">' . get_the_time( __( 'Y', 'breadcrumb-trail' ) ) . '</a>';
+ $trail['trail_end'] = get_the_time( __( 'F', 'breadcrumb-trail' ) );
}
elseif ( is_year() ) {
- $trail['trail_end'] = get_the_time( __( 'Y', $textdomain ) );
+ $trail['trail_end'] = get_the_time( __( 'Y', 'breadcrumb-trail' ) );
}
}
}
/* If viewing search results. */
elseif ( is_search() )
- $trail['trail_end'] = sprintf( __( 'Search results for &quot;%1$s&quot;', $textdomain ), esc_attr( get_search_query() ) );
+ $trail['trail_end'] = sprintf( __( 'Search results for &quot;%1$s&quot;', 'breadcrumb-trail' ), esc_attr( get_search_query() ) );
/* If viewing a 404 error page. */
elseif ( is_404() )
- $trail['trail_end'] = __( '404 Not Found', $textdomain );
+ $trail['trail_end'] = __( '404 Not Found', 'breadcrumb-trail' );
/* Allow devs to step in and filter the $trail array. */
return apply_filters( 'breadcrumb_trail_items', $trail, $args );
@@ -370,9 +364,6 @@ function breadcrumb_trail_map_rewrite_tags( $post_id = '', $path = '', $args = a
if ( empty( $post ) || is_wp_error( $post ) || 'post' !== $post->post_type )
return $trail;
- /* Get the textdomain. */
- $textdomain = breadcrumb_trail_textdomain();
-
/* Trim '/' from both sides of the $path. */
$path = trim( $path, '/' );
@@ -390,15 +381,15 @@ function breadcrumb_trail_map_rewrite_tags( $post_id = '', $path = '', $args = a
/* If using the %year% tag, add a link to the yearly archive. */
if ( '%year%' == $tag )
- $trail[] = '<a href="' . get_year_link( get_the_time( 'Y', $post_id ) ) . '" title="' . get_the_time( esc_attr__( 'Y', $textdomain ), $post_id ) . '">' . get_the_time( __( 'Y', $textdomain ), $post_id ) . '</a>';
+ $trail[] = '<a href="' . get_year_link( get_the_time( 'Y', $post_id ) ) . '" title="' . get_the_time( esc_attr__( 'Y', 'breadcrumb-trail' ), $post_id ) . '">' . get_the_time( __( 'Y', 'breadcrumb-trail' ), $post_id ) . '</a>';
/* If using the %monthnum% tag, add a link to the monthly archive. */
elseif ( '%monthnum%' == $tag )
- $trail[] = '<a href="' . get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) . '" title="' . get_the_time( esc_attr__( 'F Y', $textdomain ), $post_id ) . '">' . get_the_time( __( 'F', $textdomain ), $post_id ) . '</a>';
+ $trail[] = '<a href="' . get_month_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ) ) . '" title="' . get_the_time( esc_attr__( 'F Y', 'breadcrumb-trail' ), $post_id ) . '">' . get_the_time( __( 'F', 'breadcrumb-trail' ), $post_id ) . '</a>';
/* If using the %day% tag, add a link to the daily archive. */
elseif ( '%day%' == $tag )
- $trail[] = '<a href="' . get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) . '" title="' . get_the_time( esc_attr__( 'F j, Y', $textdomain ), $post_id ) . '">' . get_the_time( __( 'd', $textdomain ), $post_id ) . '</a>';
+ $trail[] = '<a href="' . get_day_link( get_the_time( 'Y', $post_id ), get_the_time( 'm', $post_id ), get_the_time( 'd', $post_id ) ) . '" title="' . get_the_time( esc_attr__( 'F j, Y', 'breadcrumb-trail' ), $post_id ) . '">' . get_the_time( __( 'd', 'breadcrumb-trail' ), $post_id ) . '</a>';
/* If using the %author% tag, add a link to the post author archive. */
elseif ( '%author%' == $tag )
View
10 extensions/custom-field-series.php
@@ -40,9 +40,6 @@
function custom_field_series( $args = array() ) {
global $post;
- /* Set up a default textdomain. */
- $textdomain = apply_filters( 'custom_field_series_textdomain', 'custom-field-series' );
-
/* Set $series to an empty string. */
$series = '';
@@ -83,7 +80,7 @@ function custom_field_series( $args = array() ) {
/* Create the opening wrapper div, title, and list element. */
$series = '<div class="series series-' . esc_attr( $class ) . '">';
- $series .= '<h4 class="series-title">' . apply_filters( 'custom_field_series_title', __( 'Articles in this series', $textdomain ) ) . '</h4>';
+ $series .= '<h4 class="series-title">' . apply_filters( 'custom_field_series_title', __( 'Articles in this series', 'custom-field-series' ) ) . '</h4>';
$series .= '<ul>';
/* Loop through the posts. */
@@ -132,9 +129,6 @@ function custom_field_series_post_type_support() {
*/
function custom_field_series_create_meta_box() {
- /* Set up a default textdomain. */
- $textdomain = apply_filters( 'custom_field_series_textdomain', 'custom-field-series' );
-
/* Gets available public post types. */
$post_types = get_post_types();
@@ -143,7 +137,7 @@ function custom_field_series_create_meta_box() {
/* If the post type supports 'custom-field-series', add a meta box for it. */
if ( post_type_supports( $type, 'custom-field-series' ) )
- add_meta_box( 'custom-field-series', __( 'Series', $textdomain ), 'custom_field_series_meta_box', $type, 'side', 'default' );
+ add_meta_box( 'custom-field-series', __( 'Series', 'custom-field-series' ), 'custom_field_series_meta_box', $type, 'side', 'default' );
}
/* Saves the post meta box data. */
View
2 extensions/post-stylesheets.php
@@ -172,7 +172,7 @@ function post_stylesheets_create_meta_box( $post_type, $post ) {
/* Add the meta box if the post type supports 'post-stylesheets'. */
if ( ( post_type_supports( $post_type, 'post-stylesheets' ) ) && ( current_user_can( 'edit_post_meta', $post->ID ) || current_user_can( 'add_post_meta', $post->ID ) || current_user_can( 'delete_post_meta', $post->ID ) ) )
- add_meta_box( "post-stylesheets", __( 'Stylesheet', post_stylesheets_textdomain() ), 'post_stylesheets_meta_box', $post_type, 'side', 'default' );
+ add_meta_box( "post-stylesheets", __( 'Stylesheet', 'post-stylesheets' ), 'post_stylesheets_meta_box', $post_type, 'side', 'default' );
}
/**
View
22 extensions/theme-layouts.php
@@ -234,13 +234,13 @@ function theme_layouts_strings() {
/* Set up the default layout strings. */
$strings = array(
- 'default' => __( 'Default', theme_layouts_textdomain() ),
- '1c' => __( 'One Column', theme_layouts_textdomain() ),
- '2c-l' => __( 'Two Columns, Left', theme_layouts_textdomain() ),
- '2c-r' => __( 'Two Columns, Right', theme_layouts_textdomain() ),
- '3c-l' => __( 'Three Columns, Left', theme_layouts_textdomain() ),
- '3c-r' => __( 'Three Columns, Right', theme_layouts_textdomain() ),
- '3c-c' => __( 'Three Columns, Center', theme_layouts_textdomain() )
+ 'default' => __( 'Default', 'theme-layouts' ),
+ '1c' => __( 'One Column', 'theme-layouts' ),
+ '2c-l' => __( 'Two Columns, Left', 'theme-layouts' ),
+ '2c-r' => __( 'Two Columns, Right', 'theme-layouts' ),
+ '3c-l' => __( 'Three Columns, Left', 'theme-layouts' ),
+ '3c-r' => __( 'Three Columns, Right', 'theme-layouts' ),
+ '3c-c' => __( 'Three Columns, Center', 'theme-layouts' )
);
/* Allow devs to filter the strings for custom layouts. */
@@ -297,7 +297,7 @@ function theme_layouts_admin_setup() {
function theme_layouts_load_meta_boxes() {
/* Add the layout meta box on the 'add_meta_boxes' hook. */
- add_action( 'add_meta_boxes', 'post_stylesheets_create_meta_box', 10, 2 );
+ add_action( 'add_meta_boxes', 'theme_layouts_add_meta_boxes', 10, 2 );
/* Saves the post format on the post editing page. */
add_action( 'save_post', 'theme_layouts_save_post', 10, 2 );
@@ -316,7 +316,7 @@ function theme_layouts_add_meta_boxes( $post_type, $post ) {
/* Add the meta box if the post type supports 'post-stylesheets'. */
if ( ( post_type_supports( $post_type, 'theme-layouts' ) ) && ( current_user_can( 'edit_post_meta', $post->ID ) || current_user_can( 'add_post_meta', $post->ID ) || current_user_can( 'delete_post_meta', $post->ID ) ) )
- add_meta_box( 'theme-layouts-post-meta-box', __( 'Layout', theme_layouts_textdomain() ), 'theme_layouts_post_meta_box', $post_typetype, 'side', 'default' );
+ add_meta_box( 'theme-layouts-post-meta-box', __( 'Layout', 'theme-layouts' ), 'theme_layouts_post_meta_box', $post_type, 'side', 'default' );
}
/**
@@ -341,7 +341,7 @@ function theme_layouts_post_meta_box( $post, $box ) {
<?php wp_nonce_field( basename( __FILE__ ), 'theme-layouts-nonce' ); ?>
- <p><?php _e( 'Layout is a theme-specific structure for the single view of the post.', theme_layouts_textdomain() ); ?></p>
+ <p><?php _e( 'Layout is a theme-specific structure for the single view of the post.', 'theme-layouts' ); ?></p>
<div class="post-layout-wrap">
<ul>
@@ -413,7 +413,7 @@ function theme_layouts_attachment_fields_to_edit( $fields, $post ) {
/* Add the attachment layout field to the $fields array. */
$fields['theme-layouts-post-layout'] = array(
- 'label' => __( 'Layout', theme_layouts_textdomain() ),
+ 'label' => __( 'Layout', 'theme-layouts' ),
'input' => 'html',
'html' => $select
);
View
25 functions/comments.php
@@ -153,37 +153,34 @@ function hybrid_avatar() {
function hybrid_comment_form_args( $args ) {
global $user_identity;
- /* Get the theme textdomain. */
- $domain = hybrid_get_textdomain();
-
/* Get the current commenter. */
$commenter = wp_get_current_commenter();
/* Create the required <span> and <input> element class. */
- $req = ( ( get_option( 'require_name_email' ) ) ? ' <span class="required">' . __( '*', $domain ) . '</span> ' : '' );
+ $req = ( ( get_option( 'require_name_email' ) ) ? ' <span class="required">' . __( '*', 'hybrid-core' ) . '</span> ' : '' );
$input_class = ( ( get_option( 'require_name_email' ) ) ? ' req' : '' );
/* Sets up the default comment form fields. */
$fields = array(
- 'author' => '<p class="form-author' . esc_attr( $input_class ) . '"><label for="author">' . __( 'Name', $domain ) . $req . '</label> <input type="text" class="text-input" name="author" id="author" value="' . esc_attr( $commenter['comment_author'] ) . '" size="40" /></p>',
- 'email' => '<p class="form-email' . esc_attr( $input_class ) . '"><label for="email">' . __( 'Email', $domain ) . $req . '</label> <input type="text" class="text-input" name="email" id="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="40" /></p>',
- 'url' => '<p class="form-url"><label for="url">' . __( 'Website', $domain ) . '</label><input type="text" class="text-input" name="url" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="40" /></p>'
+ 'author' => '<p class="form-author' . esc_attr( $input_class ) . '"><label for="author">' . __( 'Name', 'hybrid-core' ) . $req . '</label> <input type="text" class="text-input" name="author" id="author" value="' . esc_attr( $commenter['comment_author'] ) . '" size="40" /></p>',
+ 'email' => '<p class="form-email' . esc_attr( $input_class ) . '"><label for="email">' . __( 'Email', 'hybrid-core' ) . $req . '</label> <input type="text" class="text-input" name="email" id="email" value="' . esc_attr( $commenter['comment_author_email'] ) . '" size="40" /></p>',
+ 'url' => '<p class="form-url"><label for="url">' . __( 'Website', 'hybrid-core' ) . '</label><input type="text" class="text-input" name="url" id="url" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="40" /></p>'
);
/* Sets the default arguments for displaying the comment form. */
$args = array(
'fields' => apply_filters( 'comment_form_default_fields', $fields ),
- 'comment_field' => '<p class="form-textarea req"><label for="comment">' . __( 'Comment', $domain ) . '</label><textarea name="comment" id="comment" cols="60" rows="10"></textarea></p>',
- 'must_log_in' => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s" title="Log in">logged in</a> to post a comment.', $domain ), wp_login_url( get_permalink() ) ) . '</p><!-- .alert -->',
- 'logged_in_as' => '<p class="log-in-out">' . sprintf( __( 'Logged in as <a href="%1$s" title="%2$s">%2$s</a>.', $domain ), admin_url( 'profile.php' ), esc_attr( $user_identity ) ) . ' <a href="' . wp_logout_url( get_permalink() ) . '" title="' . esc_attr__( 'Log out of this account', $domain ) . '">' . __( 'Log out &raquo;', $domain ) . '</a></p><!-- .log-in-out -->',
+ 'comment_field' => '<p class="form-textarea req"><label for="comment">' . __( 'Comment', 'hybrid-core' ) . '</label><textarea name="comment" id="comment" cols="60" rows="10"></textarea></p>',
+ 'must_log_in' => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s" title="Log in">logged in</a> to post a comment.', 'hybrid-core' ), wp_login_url( get_permalink() ) ) . '</p><!-- .alert -->',
+ 'logged_in_as' => '<p class="log-in-out">' . sprintf( __( 'Logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'hybrid-core' ), admin_url( 'profile.php' ), esc_attr( $user_identity ) ) . ' <a href="' . wp_logout_url( get_permalink() ) . '" title="' . esc_attr__( 'Log out of this account', 'hybrid-core' ) . '">' . __( 'Log out &raquo;', 'hybrid-core' ) . '</a></p><!-- .log-in-out -->',
'comment_notes_before' => '',
'comment_notes_after' => '',
'id_form' => 'commentform',
'id_submit' => 'submit',
- 'title_reply' => __( 'Leave a Reply', $domain ),
- 'title_reply_to' => __( 'Leave a Reply to %s', $domain ),
- 'cancel_reply_link' => __( 'Click here to cancel reply.', $domain ),
- 'label_submit' => __( 'Post Comment', $domain ),
+ 'title_reply' => __( 'Leave a Reply', 'hybrid-core' ),
+ 'title_reply_to' => __( 'Leave a Reply to %s', 'hybrid-core' ),
+ 'cancel_reply_link' => __( 'Click here to cancel reply.', 'hybrid-core' ),
+ 'label_submit' => __( 'Post Comment', 'hybrid-core' ),
);
/* Return the arguments for displaying the comment form. */
View
23 functions/context.php
@@ -348,7 +348,6 @@ function hybrid_document_title() {
global $wp_query;
/* Set up some default variables. */
- $domain = hybrid_get_textdomain();
$doctitle = '';
$separator = ':';
@@ -393,44 +392,44 @@ function hybrid_document_title() {
/* If viewing a date-/time-based archive. */
elseif ( is_date () ) {
if ( get_query_var( 'minute' ) && get_query_var( 'hour' ) )
- $doctitle = sprintf( __( 'Archive for %1$s', $domain ), get_the_time( __( 'g:i a',