Dynamically Creating Meta Boxes

I would seriously consider looking into the WPAlchemy metaboxes class. It does exactly what you are after and so much more. http://www.farinspace.com/wpalchemy-metabox/#have_fields_and_multi This class is so great that I am frankly shocked that there is not a lot more discussion about it. *If there is a better metabox class, I’d love to hear about it, … Read more

Disable collapse of admin meta boxes

Add this to your functions file and it will kill the metabox toggles: function kill_postbox(){ global $wp_scripts; $footer_scripts = $wp_scripts->in_footer; foreach($footer_scripts as $key => $script){ if(‘postbox’ === $script) unset($wp_scripts->in_footer[$key]); } } add_action(‘admin_footer’, ‘kill_postbox’, 1);

add_meta_box: Datepicker like the one for postdate?

Never really thought about it, but it should indeed be a good option. The date picker is called from wp-admin/includes/meta-boxes.php (line 183) as: <div id=”timestampdiv” class=”hide-if-js”><?php touch_time(($action == ‘edit’),1,4); ?></div> and touch_time() is defined in wp-admin/includes/template.php (line 550) as: /** * {@internal Missing Short Description}} * * @since 0.71 * * @param unknown_type $edit * … Read more

Create A Metabox For A Custom Field

This will create a metabox for you to enter a video code. //Creating a MetaBox for Posts to enter Video Code. add_action(‘add_meta_boxes’,’video_meta_box’); function video_meta_box(){ add_meta_box(‘video_box_id’, ‘Enter Video ‘ , ‘video_box_cb’,’post’,’normal’,’default’); } function video_box_cb($post){ $value = get_post_meta($post->ID,’video_box’,true); echo ‘<textarea rows=”4″ cols=”50″ id=”video_box”, name=”video_box”>’; echo $value; echo ‘</textarea>’; } add_action(‘save_post’,’save_video_box’); function save_video_box($post_id){ $box_data = $_POST[‘video_box’]; update_post_meta($post_id,’video_box’,$box_data); } … Read more

Save metabox checkboxes values to custom content type

I have rethought the problem: Finally, I resolve it with save_post hook: function enhanced_portfolio_categories_save_post(){ $terminos = array(); foreach ($_POST[‘my_categories’] as $key) { $custom_tax = get_term_by(‘term_id’, $key, ‘portfolio_categories’); array_push($terminos, $custom_tax->term_id); } wp_set_object_terms( $_POST[‘post_ID’], $terminos, ‘portfolio_categories’); }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)