How to reorder meta box position?

Users can drag and drop meta boxes and WordPress will save the order. So, in a sense, the order in which they were originally rendered does not matter. You know which one comes first because when you call add_meta_box it simply pushes your meta box’s args onto a global array called $wp_meta_boxes. Whichever call to … Read more

How do I get attachment_id?

Ok, all those hipercomplex functions can be reduced to one simple command: attachment_url_to_postid You only need to parse the image url to retrieve the attachment id: <?php $attachment_id = attachment_url_to_postid( $image_url ); echo $attachment_id; ?> That’s all you need.

How to Add Reminders/Notes to New Post Meta Boxes

You should never edit the core files of WordPress. Instead you should only ever edit Plugin files and or Theme files (Plugins or Themes folder) One of the easiest was to achieve this would be via jQuery; jQuery(‘<div/>’, { id: ‘your-note’, text: ‘Add up to 5 tags…etc’ }).appendTo(‘#tagsdiv-post_tag .inner’); Save the above into a alerts.js … Read more

How to force one column layout on custom post type edit page?

There is a filter called get_user_option_meta-box-order_{$page} where $page is the name of the post type. Just make sure that submitdiv is the last value in the array: add_filter( ‘get_user_option_meta-box-order_post’, ‘wpse25793_one_column_for_all’ ); function wpse25793_one_column_for_all( $order ) { return array( ‘normal’ => join( “,”, array( ‘postexcerpt’, ‘formatdiv’, ‘trackbacksdiv’, ‘tagsdiv-post_tag’, ‘categorydiv’, ‘postimagediv’, ‘postcustom’, ‘commentstatusdiv’, ‘slugdiv’, ‘authordiv’, ‘submitdiv’, ) … Read more

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