draft post and publish post manage

Sure it is – you can use the wp_insert_post_data filter: function no_going_back_to_draft($slashed_data , $post_data) { if($slashed_data[‘post_status’] == ‘draft’) { // we’re only interested in posts being saved as “drafts” $user = wp_get_current_user(); if ( in_array( ‘no-going-back-to-draft-role’, (array) $user->roles ) ) { // we’re only interested in users with that special, restricted role $post = get_post($post_data[‘ID’]); … Read more

Connection dropped due to file size

It sounds like you are attempting to push too much data at one time. GoDaddy may be terminating the connection because of a size limit per request or the upload is taking longer than they allow (because it is so large.) In either case it is a sign the amount of data is too large. … Read more

wp_update_post to set post IDs to drafts not working

Well in your for loop, I think you’re missing the $postcount variable… also there’s a typo at $idss[$i] …. should be $ids[i] based on what you’ve shown. for ($i = 0; $i < $postcount; $i++) { wp_update_post(array(‘ID’ => $ids[$i], ‘post_status’ => ‘draft’)); } That being said I’d just go with a foreach loop. The mistake … Read more

What am I doing wrong creating post draft via wp-cron? (wp_schedule_event & wp_insert_post)

The problem is that you’re only hooking the cron action on admin_init, which doesn’t run when wp-cron.php is called. So the function will never run. So this function shouldn’t be inside wpcp_activate(): add_action( ‘wpcp_cron_hook’, ‘wpcp_cron_do’ ); Also, register_activation_hook() shouldn’t be inside the admin_init hook either. So your code should look like this: function wpcp_make_post( $post_title, … Read more

My posts are getting to Auto draft when I try to Publish

Can you try the following in your wp-config.php define( ‘AUTOSAVE_INTERVAL’, 3600 ); // autosave 1x per hour define( ‘WP_POST_REVISIONS’, false ); // no revisions What this would do disable auto-save and post-revisions. Try with that, if it works could be your then it could be your internet or hosting conflicts.

Hook when post is set from published to draft?

Yes, these are probably the right calls to use for what you want. I just checked this by adding this to my functions.php: add_action(‘publish_to_draft’, ‘doStuff’); function doStuff() { update_option(‘foo’, ‘bar1’); } Then using the quick edit in the posts list to change a published post to draft, and this hook definitely ran at that point … Read more

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