Can’t schedule post for another time
Can’t schedule post for another time
Can’t schedule post for another time
You can use user_has_cap filter to check and grant capabilities dynamically. add_filter(‘user_has_cap’, ‘contributor_can_edit_published_posts’, 10, 4); function contributor_can_edit_published_posts($allcaps, $caps, $args, $user) { global $post; // Do we have a post? if ( ! $post ) { return $allcaps; } // Is the user a contributor? if ( ! isset( $allcaps[‘contributor’] ) || true !== $allcaps[‘contributor’] ) … Read more
I always do it with Frank Bültge’s Adminimize in Global Options, you’ll find Your Own Options in the left column you put any name for your reference in the right column you put the ID or Classes you want to hide if I’m not mistaken, you’d want to hide this #visibility.misc-pub-section,.misc-pub-section.curtime.misc-pub-section-last Here’s a reference list … Read more
You could always use the has_excerpt() function to test for excerpt content and if it is not filled in you could display a message. Example: if( has_excerpt() ) { the_excerpt(); } else { echo ‘<p>Please enter the excerpt.</p>’; }
If you did this instead… function the_fat_lady_sings() { wp_die(“this plugin is a far harder than i imageined”); } add_action(‘publish_post’,’the_fat_lady_sings’) I think you will see that it does work. The problem you are having with the echo is because WordPress processes the submission and then redirects back to form. You’ll never see the echoed string. That … Read more
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.
Try using the $post parameter: add_action( ‘pending_to_publish’, ‘sa_ads_count’ ); function sa_ads_count( $post ) { // use the $post variable here, not the missing global. }
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
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
When hooking on to save_post you need to check that it’s not a revision & is not WP autosaving the data.. You’ll need this code before you send the email so it returns if it’s autosaving or is a post revision. if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) { return; } if ( wp_is_post_revision( $post_id ) … Read more