mirror of
https://github.com/10h30/trestle.git
synced 2026-07-14 20:26:39 +09:00
IMPORTANT: Fix bug with tresle_post_info_meta() function causing posts to spontaneously change post_type when running looping through a query. Please update to this patch if you have a previous version.
This commit is contained in:
@@ -343,15 +343,7 @@ function trestle_post_info_meta() {
|
||||
global $post;
|
||||
|
||||
// Get post type
|
||||
$orig_post_type = '';
|
||||
|
||||
$post_type = get_post_type( $post->ID );
|
||||
|
||||
// Override "page" post type to allow for Post Info & Meta (reset back to page below)
|
||||
if ( 'page' == $post_type ) {
|
||||
$orig_post_type = 'page';
|
||||
set_post_type( $post->ID, 'post' );
|
||||
}
|
||||
|
||||
// Remove all Post Info & Meta
|
||||
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
|
||||
@@ -384,10 +376,6 @@ function trestle_post_info_meta() {
|
||||
if ( genesis_get_option( $archive_meta_option ) )
|
||||
add_action( 'genesis_entry_footer', 'genesis_post_meta' );
|
||||
}
|
||||
|
||||
// Reset post type back to page if need be
|
||||
if ( ! empty( $orig_post_type ) && 'page' == $orig_post_type )
|
||||
add_action( 'genesis_entry_footer', 'trestle_set_page_post_type' );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,18 +401,6 @@ function trestle_featured_image_fallback( $args ) {
|
||||
* General Actions & Filters
|
||||
===========================================*/
|
||||
|
||||
/**
|
||||
* Resets post type back to page once post info / meta functionality is done.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @global object $post The current $post object.
|
||||
*/
|
||||
function trestle_set_page_post_type() {
|
||||
global $post;
|
||||
set_post_type( $post->ID, 'page' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays custom Trestle "read more" text in place of WordPress default.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user