Emailing Authors only when a CUSTOM POST TYPE post is published- not when edited later [duplicate]

Yes, it sounds like you do want a post transition hook, probably draft_to_publish as per the following from the Codex: function your_callback( $post ) { // Code here } add_action( ‘draft_to_publish’, ‘your_callback’ ); Use authorNotification— your function name– instead of your_callback. It should be fairly simple in your case. However, the precise details of your … Read more

Duplicate post on publish

It’s a normal behaviour of WordPress if you have attachments in your post and revision enable for your site. When an attachment is added to a post, the attachment post_status is inherit of the parent post, and the logic is that the ping status is set to closed. When revisions are enable, a copy of … Read more

Action while post is being published

It sounds like you’re looking for the publish_post hook which (per the Codex): Runs when a post is published, or if it is edited and its status is “published”. Action function arguments: post ID. Alternately, there’s save_post which is triggered whenever a post or page is created or updated, which could be from an import, … Read more

I am creating a front end dashboard where I need to show all the posts by the current user. So, I need to show posts in publish

I’m afraid I don’t understand the question perfectly, so I apologize, but, $post_status=”publish”; Wouldn’t that do it? I am missing context though, are you building a query? Because to get all the posts by the current user, something like this would be needed: $args = array( “post_status” => “publish”, “author” => get_current_user_id(), “posts_per_page” => 10 … Read more

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