Bulk post approval and publishing doesn’t work

The problem I can immediately see is, you’ve set: ‘post_status’ => ‘published’ This should be: ‘post_status’ => ‘publish’ Also, since you are only updating the post status, it’s less error prone and more appropriate to use wp_publish_post function instead of wp_update_post function. With this change, your karma_approve_all_posts() function will look like this: function karma_approve_all_posts( $posts … Read more

Problems in updating a self-developed plugin

I could solve the problem myself. Here are the resources that help in finding the (my) fault: WordPress@Stackoverflow: Update Plugin Detailed description, that explained the same as above in my workflow. Expanded version of the above WordPress Documentation: Header information in readme.txt This was the final point. I had in my readme.txt in the header: … Read more

How can add custom commands in post-new.php in wordpress

You could run this code inside of an action on transition post status. Any time a post is published you could run this code to generate and upload the HTML to your FTP server. function post_published( $new_status, $old_status, $post ) { if ( $new_status == ‘publish’ ) { // Build your file and upload it … Read more

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