Where is publish_post hook fired?

As @shanebp suggested you in a comment to OP, that is one of the hook fired by the function wp_transition_post_status, it’s a bit hard to find it doing a search in code because is a dynamic hook, in facts the line in code that fires it looks like: do_action( “{$new_status}_{$post->post_type}”, $post->ID, $post ); Where $new_status … Read more

Authors should not publish

The role you are describing is “Contributor”. So the option would be to use this role unless you still want to edit Author capabilities which would be done as follows: function disable_authors_publish_cap() { // Get author role object $author = get_role( ‘author’ ); // Remove the post publishing capability $author->remove_cap( ‘publish_posts’ ); } add_action( ‘init’, … Read more

Add delay to publish post

I think that by adding a delay you’re not really fixing the issue, you’re simply hiding it, until you grow and add more media and servers, so lsyncd will take longer, and you’ll have to increase your delay every time. Also what about updating existing posts? People might add media items and update, or add … Read more

Send email for pending post

I did a bit more research and this is what is working for me now. The admin will only get an update if a pending post is added or updated. add_action( ‘transition_post_status’, ‘pending_post_status’, 10, 3 ); function pending_post_status( $new_status, $old_status, $post ) { if ( $new_status === “pending” ) { $post_title = get_the_title( $post_id ); … Read more

Should you manually ping new WordPress posts?

This is one of those things I tend to call “ritualistic”. Search engines will never explicitly tell you either that pinging does anything or nothing at all. It’s there for them to use or do nothing at all about. From my experience semi–active WP site with basic decent SEO setup (such as sitemaps) would be … Read more