<?php | |
/** | |
* Remove Inpost Layout Options | |
* | |
* Use if you have hardcoded the layout on certain template pages | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/remove-inpost-layout-options | |
*/ | |
function be_remove_inpost_layout_options() { | |
// Get the Post ID | |
if( isset( $_GET['post'] ) ) $post_id = $_GET['post']; | |
elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID']; | |
if( !isset( $post_id ) ) return; | |
// Get the Page Template | |
$template_file = get_post_meta( $post_id, '_wp_page_template', true ); | |
$exclude_layout = array( 'template-products.php' ); | |
if ( in_array( $template_file, $exclude_layout ) ) | |
remove_meta_box( 'genesis_inpost_layout_box', 'page', 'normal' ); | |
} | |
add_action( 'admin_enqueue_scripts', 'be_remove_inpost_layout_options' ); |
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