display_fields = false; } public function adminJS() { global $pagenow, $amazon_tools; if($pagenow == 'post-new.php' || $pagenow == 'post.php') { wp_enqueue_script('amazon_admin_js'); wp_enqueue_style('amazon_meta_css', $amazon_tools->url . '/menus/style_meta.css'); add_action('admin_footer', array($this, 'adminFooter')); } } public function adminFooter() { $nonce = wp_create_nonce('amazon_tools_nonce'); ?> 0) { global $pagenow; $args = array('templates' => $templates); if($pagenow == 'post.php') { $post_id = isset($_GET['post']) ? $_GET['post'] : $_POST['post_ID']; $this->post_id = $post_id; $template_id = get_post_meta($post_id, 'amazon_post_template', true); if($template_id) { $fields = amazon_get_template_fields($template_id); if(count($fields) > 0) $this->display_fields = true; } else $fields = array(); $args['template_id'] = $template_id; $args['template_fields'] = $fields; } $types = get_option('amazon_post_types'); if(is_array($types)) { foreach($types as $type) { add_meta_box('amazon_tools_templates', 'Amazon Tools Post Templates', array($this, 'templatesBox'), $type, 'side', 'core', $args ); add_meta_box('amazon_tools_template_fields', 'Template Fields', array($this, 'fieldBox'), $type, 'normal', 'high', $args ); } } //add_meta_box('amazon_tools_test', 'Test Box', array($this, 'testBox'), 'post', 'advanced', 'default', $args); } } public function quickSearchBox($post = null, $metabox = null) { $search_count = get_option('amazon_quick_search_count'); ?> Number of results
 
ID, 'amazon_post_template', true); ?>
ID, $template_id, array());} ?>
ID, 'amazon_post_template', true); ?> $value) { if(strpos($key, $prefix) === 0) update_post_meta($post_id, $key, $value); } update_post_meta($post_id, 'amazon_post_template', $_POST['amazon_post_template_select']); } } $amazon_meta_box = new AmazonMetaBox(); ?>