Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //CREO IL PORCO DIO LADRO DI META BOX
- add_action('add_meta_boxes', 'about_template_meta_box');
- function about_template_meta_box(){
- add_meta_box(
- 'page_link_options',
- __('!!MANDATORY!! -> SET A LINK NAME FOR THIS PAGE - ONLY LETTERS AND NUMBERS - NO SPACES - NO CAPS - NO SPECIAL CHARS'),
- 'page_link_options',
- 'page'
- );
- }
- function page_link_options(){
- //la form del cristo in croce
- }
- add_action('admin_head-post-new.php', 'foo_page_template_script');
- function foo_page_template_script(){
- global $post;
- # FILTERO SOLTANTO ALLE PAGINE
- if('page' !== $post->post_type)
- return;
- #NOME DEL FILE DEL PORCO JESUS
- $file = 'about.php';
- $output = "
- <!-- Hide the Meta Box -->
- <style type='text/css'>
- #page_link_options{display:none;}
- </style>
- <script type='text/javascript'>
- jQuery(document).ready(function($){
- var _file = '$file';
- var _meta_box = $('#page_link_options');
- var _page_template = $('#page-template');
- //Show meta box on page load
- if(_file == _page_template.val())
- _meta_box.show();
- //Sniff changes to the page template dropdown
- _page_template.change(function(){
- if(_file == _page_template.val())
- _meta_box.show();
- });
- });
- </script>
- ";
- echo $output;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement