This file contains hidden or 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
<?php | |
//Create Page | |
function create_page() { | |
if ( !$post = get_page_by_path( 'product-configurator', OBJECT, 'post_type' ) ) { | |
$user_id = get_current_user_id(); | |
$page = array( | |
'post_title' => 'Product Configurator', | |
'post_status' => 'publish', | |
'post_author' => $user_id, |
This file contains hidden or 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
<?php | |
function custom_page_template( $page_template ){ | |
if ( is_page( 'product-configurator' ) ) { | |
$page_template = dirname( __FILE__ ) . '/product_configurator.php'; | |
} | |
return $page_template; | |
} | |
add_filter( 'page_template', 'custom_page_template' ); |
This file contains hidden or 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
<?php | |
function add_custom_meta_boxes_to_page() { | |
global $post; | |
if ( 'product-configurator' == $post->post_name ) { | |
remove_post_type_support('page', 'editor'); | |
add_meta_box( 'description_of_configurator', __('Configurator Information'), 'description_of_configurator', 'page', 'normal', 'high' ); | |
add_meta_box( 'hero_content', __('Hero Content'), 'hero_content', 'page', 'side', 'low' ); | |
} | |
} | |
add_action( 'add_meta_boxes_page', 'add_custom_meta_boxes_to_page' ); |
This file contains hidden or 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
<?php | |
function add_custom_meta_boxes_to_page() { | |
add_meta_box( 'custom_wysiwyg', __('Custom WYSIWYG'), 'custom_wysiwyg', 'page', 'normal', 'high' ); | |
} | |
add_action( 'add_meta_boxes_page', 'add_custom_meta_boxes_to_page' ); | |
add_action( 'save_post', 'save_custom_wysiwyg' ); | |
//Build | |
function custom_wysiwyg() { | |
global $post; |
NewerOlder