Metabox nonce PHP notice

// Save the Metabox Data function wpt_save_product_meta($post_id, $post) { if($post->post_type!=’post type with metabox’) { return $post->ID; } // verify this came from the our screen and with proper authorization, // because save_post can be triggered at other times if ( !wp_verify_nonce( $_POST[‘product_noncename’], plugin_basename(__FILE__) )) { return $post->ID; } // Is the user allowed to edit … Read more

Conditional Meta Boxes

This can be easily solved with jQuery, and it has the advantage of real-time feedback. I’ve already covered this situation in a couple of questions, so instead of going through your code and writing the proper functions, I suggest you go through my code and adapt it to your needs. meta content on required pages … Read more

1 column admin screen options – move submitdiv to bottom

Try something like this: // First make all metaboxes have ‘normal’ context (note the absence of ‘submitdiv’) // If you know the ids of the metaboxes, you could add them here and skip the next function altogether add_filter(‘get_user_option_meta-box-order_post’, ‘one_column_for_all’, 10, 1); function one_column_for_all($option) { $result[‘normal’] = ‘postexcerpt,formatdiv,trackbacksdiv,tagsdiv-post_tag,categorydiv,postimagediv,postcustom,commentstatusdiv,slugdiv,authordiv’; $result[‘side’] = ”; $result[‘advanced’] = ”; return $result; … Read more

How to attach Links into page/post or custom post type?

This is a simple and quick Metabox + jQuery + Plain Text solution. If you’d like to split the dropdown into categories, then check the documentation for get_bookmarks. This may also be useful: add_meta_box. This is the result: And the code: add_action( ‘add_meta_boxes’, ‘wpse_42440_add_custom_box’ ); add_action( ‘admin_head’, ‘wpse_42440_script_direct_print’ ); function wpse_42440_add_custom_box() { add_meta_box( ‘wpse_42440_sectionid’, __( … Read more

Set height of the categories meta box in post dashboard

If I am correct the style.css (your theme style.css) is not loaded in the admin area so creating a function solves this. Side note: The code you where looking for I found in wp-admin/css/edit.css at line 960 Below you find the function,hopefully this is what you where looking for. Make backup from functions.php (you know … Read more

Saving multiple Metabox contents

Aha! Stupid error. I didn’t give it a proper METAKEY! This seems to have fixed things: /* Save the meta box’s post metadata. */ function save_metabox_exhibition( $post_id, $post ) { $fields = 0; if($_POST) { $metaboxes[0][‘nonce’] = $_POST[‘exhibition_finish_date_nonce’]; $metaboxes[0][‘data’] = $_POST[‘gc_finish_date’]; $metaboxes[0][‘meta’] = ‘gc_finish_date’; $metaboxes[1][‘nonce’] = $_POST[‘exhibition_start_date_nonce’]; $metaboxes[1][‘data’] = $_POST[‘gc_start_date’]; $metaboxes[1][‘meta’] = ‘gc_start_date’; $metaboxes[2][‘nonce’] = … Read more

Change Default Custom Fields Metabox Name

You need to declare the $wp_meta_boxes array as global: global $wp_meta_boxes; If it still doesn’t work try: add_filter(‘add_meta_boxes’, ‘change_meta_box_titles’); function change_meta_box_titles() { global $wp_meta_boxes; echo ‘<pre>’; print_r($wp_meta_boxes); echo ‘</pre>’; } to see what’s going on (and to check where the title is). You should also prefix your function names to prevent a clash with WP … Read more

How to set default metaboxes on user creation?

Based on this Answer by t31os. Here, all meta boxes are being set to invisible, so simply remove from the array the ones that are meant to be visible. add_action(‘user_register’, ‘wpse_58645_set_user_metaboxes’); function wpse_58645_set_user_metaboxes( $user_id ) { update_user_meta( $user_id, ‘metaboxhidden_post’, array( ‘authordiv’, ‘categorydiv’, ‘commentstatusdiv’, ‘formatdiv’, ‘postcustom’, ‘postexcerpt’, ‘postimagediv’, ‘slugdiv’, ‘tagsdiv-post_tag’, ‘trackbacksdiv’, ) ); } For registered … Read more

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