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

Delete post with all files attached to it

WP does not do this by default since there is no guarantee that attachment isn’t still being used by some other post. Basic logic would be to hook into delete_post, query for child attachments and run wp_delete_attachment() on each. I did quick search in plugin repository and came up with tiny plugin that does just … Read more

Are post ID’s reliable?

The pedantic answer is NO. While IDs are unique they can change without any change in UX as long as the change retains the consistency of the DB. And while creating a new post will generate a new unique ID, you can also create a post via code to reuse some “old” ID. In practice … Read more

How to change all the guid in posts table?

It should be something like: UPDATE wp_posts SET guid = REPLACE(guid, ‘oldurl.com’, ‘newurl.com’) WHERE guid LIKE ‘http://oldurl.com/%’; oldurl.com – Previous URL shown in wordpress settings > general options newurl.com – New URL

Customizing HTML Editor Quicktags button to open a dialog for choosing insert options

According to the Codex, you can’t do this directly through the API. However, you can do it by using your own quicktags.js file as shown below. function sample_load_admin_scripts() { if ( is_admin() ) { wp_deregister_script(‘quicktags’); wp_register_script(‘quicktags’, (“/path/to/your/quicktags.js”), false, ”, true); } } if (is_admin()) { add_action(‘init’, sample_load_admin_scripts); } Then just add Javascript to do your … Read more

Separate Database Tables For Different Post Types

So the only reason you want to re-architect WordPress to use multiple tables for different post types is because your posts table is getting bigger too fast? I assume the underlying issue for you is that performance is suffering? Instead, I suggest adding appropriate indexes to the post table for the queries you are finding … Read more

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