save imported posts as drafts

You can hack this plugin code by changing ‘create_draft‘ option ‘no’ to ‘yes’ into plugin.php ‘get_default_import_options‘ method(Approx line no. 1013). I’m not tested this hack, try it your own risk.

Automatically Updating Publish Date Bug

You could also hook into the save_{$post_type} action, which fires only when a certain post type is updated. This hook passes to post’s ID to the callback function: add_action( ‘save_post’, ‘my_callback_function’ ); function my_callback_function( $post_id ){ if ( ! wp_is_post_revision( $post_id ) ){ // Unhook this function so it doesn’t loop infinitely remove_action(‘save_post’, ‘my_callback_function’); // … Read more

WordPress Comments are automatically publishing

An administrator is normal the highest level of user in WordPress. If you want to approve every comments, even administrator comments, maybe you can use the moderation filter. If you go to Settings > Discussion Settings > Comment Moderation. You could setup an “cache all” filter. If you put all letters of the alphabet and … Read more

Problem With Pages Displaying

9 times out of 10, this is an issue with the .htaccess. Try flushing the permalinks: Log into your WordPress Dashboard Navigate to Settings => Permalinks Click the Save button (don’t change anything, just click save)

Set post terms on post publish

The argument from pending_to_publish action, $post_id in your case, is not ID but array (callback to publish). I think it would be better to use the publish_post action, that way $post_id will actualy be the post id. Also this is a very general action so if you have multiple post types it would be wise … Read more

count the total number of comments the user has received for his published posts

You can use the get_comments() function like so: $total = get_comments( array( ‘post_author’ => get_current_user_id(), ‘post_status’ => ‘publish’, ‘type’ => ‘comment’, ‘count’ => true, ) ); echo ‘total comments of your all posts : ‘ . $total; Just customize the arguments based on your requirements/preferences, and in the above example, I’m retrieving the total number … Read more

How to rename “Publish” metabox title in post screen

The best way would be to remove the meta box and then add it back in with your new title: function change_publish_meta_box() { remove_meta_box( ‘submitdiv’, ‘post’, ‘side’ ); add_meta_box( ‘submitdiv’, ‘YOUR TITLE HERE’, ‘post_submit_meta_box’, null, ‘side’, ‘high’ ); } add_action( ‘add_meta_boxes_post’, ‘change_publish_meta_box’ ); (Change YOUR TITLE HERE to whatever you want)