Created
February 1, 2012 21:34
-
-
Save farinspace/1719607 to your computer and use it in GitHub Desktop.
Using WP Alchemy output_filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$custom_metabox = new WPAlchemy_MetaBox(array | |
( | |
'id' => '_custom_meta', | |
'title' => 'My Custom Meta', | |
'template' => get_stylesheet_directory() . '/custom/meta.php', | |
'output_filter' => 'my_output_filter', | |
)); | |
function my_output_filter ( $post_id ) | |
{ | |
$page_template_file = get_post_meta( $post_id, '_wp_page_template', true ); | |
$post_template_file = get_post_meta( $post_id, '_wp_post_template', true ); | |
if ( 'post-template.php' == $post_template_file || 'page-template.php' == $page_template_file ) | |
{ | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment