Make the Status, Visibility, or Date fields opened by default in the Publish box

This jQuery code seems to work, when added via the admin_footer hook. #submitdiv = the whole Publish metabox .misc-pub-section = each UI section (except the Publish and Save sections) .hide-if-js = the fields that are hidden by default $(‘#submitdiv .misc-pub-section’) .has(“#post-status-display, #timestamp”) .find(‘.hide-if-js’) .toggle(); That will unhide the Status dropdown and the Date picker.

How to give capability (publish contributors posts) to author role?

I think that the best approach is to add the edit_other_posts capability to “author” role in plugin/theme activation and remove that capability on plugin/theme deactivation. With this method you only run the task once and you don’t need further coding. Using plugin activation/deactivation: register_activation_hook( __FILE__, ‘cyb_activation_function’ ); function cyb_activation_function() { $author = get_role( ‘author’ ); … Read more

new_to_publish fires multiple times

OK! found how to – there is 2 little information about how to attach a function to a status change but this hook does the job and does it well. function miniupdate_webnews( $new_status, $old_status, $post ) { if ( $old_status == ‘draft’ && $new_status == ‘publish’ ) { // YOUR FUNCTION HERE… } } add_action( … Read more

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)

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