Permalink
Browse files

Use the post type name, not the post type singular name label, to get…

… post templates. Otherwise, this falls apart with translations.
  • Loading branch information...
1 parent 89b3362 commit 94cc99e6781c5153040feb9f36c9dade1fc3c459 @justintadlock committed Aug 23, 2012
Showing with 5 additions and 5 deletions.
  1. +3 −3 admin/admin.php
  2. +2 −2 hybrid.php
View
@@ -110,16 +110,16 @@ function hybrid_get_post_templates( $post_type = 'post' ) {
$headers = get_file_data(
$path,
array(
- "{$post_type_object->labels->singular_name} Template" => "{$post_type_object->labels->singular_name} Template",
+ "{$post_type_object->name} Template" => "{$post_type_object->name} Template",
)
);
/* Continue loop if the header is empty. */
- if ( empty( $headers["{$post_type_object->labels->singular_name} Template"] ) )
+ if ( empty( $headers["{$post_type_object->name} Template"] ) )
continue;
/* Add the PHP filename and template name to the array. */
- $post_templates[ $file ] = $headers["{$post_type_object->labels->singular_name} Template"];
+ $post_templates[ $file ] = $headers["{$post_type_object->name} Template"];
}
/* Return array of post templates. */
View
@@ -24,7 +24,7 @@
* to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @package HybridCore
- * @version 1.4.1
+ * @version 1.4.2
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2008 - 2012, Justin Tadlock
* @link http://themehybrid.com/hybrid-core
@@ -93,7 +93,7 @@ function __construct() {
function constants() {
/* Sets the framework version number. */
- define( 'HYBRID_VERSION', '1.4.1' );
+ define( 'HYBRID_VERSION', '1.4.2' );
/* Sets the path to the parent theme directory. */
define( 'THEME_DIR', get_template_directory() );

0 comments on commit 94cc99e

Please sign in to comment.