WordPress is creating a lot of draft posts

My WordPress install (with the following plugins) randomly creates Draft posts whenever I load the posts page. Is there a way to find out which plugin is doing this (aside from deactivating)? Has anyone had this problem? Admin Tree View Advanced Custom Fields ACF: Flexible Content Field ACF: Repeater Field Breadcrumb NavXT Disqus Google Analytics Dashboard for WP Google Analytics for WordPress Gravity Forms Gravity Forms Campaign Monitor Add-On iframe IPU-Chart Simple Sitemap sxss Admin Notes TablePress W3 Total Cache …
Category: Web

I can't preview post's change once they are published

The preview function works fine when posts are just draft. The url looks like this : http://exemple.domain.com/blog/?p=12&preview=true Then when I pubish my posts, let's say I want to change something and preview it, the url looks like this : http://exemple.domain.com/blog/my-article-title/?preview=true&preview_id=12&preview_nonce=514e88946a&post_format=standard The problem is it does reflect any changes ... I use WordPress 3.9.2 running Twenty Fourteen theme without any plugins EDIT I've turn the permalink to default and it resolve the problem. But I need it to work using the …
Category: Web

Is there any way to draft a revision of a published page or post? What workarounds have you used?

Say I've already published a page or post. I now want to make changes, but I want a colleague to check them over before they go live. Is there any way of doing this? Edit: I do realise this isn't currently possible as such and it's creative workarounds I'm interested in. On the site I'm currently working on, I also have a separate password protected 'staging' site for drafting major content changes/additions, and once approved I copy and paste to …
Category: Web

WordPress API - Get Drafts

I want to check if a post already exists. This includes to check if the post exists as draft as well. But I struggle a little bit with the wordpress API v2. http://v2.wp-api.org/reference/posts/ Under List Posts -> status they say Limit result set to posts assigned a specific status. Default: publish I tried to assign the value as parameter, but I get an error response: {"code":"rest_invalid_param","message":"Invalid parameter: status","data":{"status":400,"params":{"status":"Status is forbidden"}}} I als asign the title of the post to check: …
Category: Web

How do I make a draft post accessible to everyone?

I have several unpublished posts in my Wordpress website and I am trying to make it accessible for normal users (who are not logged in) using the normal post slugs (site.com/post-here). I understand it may not be the best practice but for my special purpose, this needs to be done. I have tried adding the following code snippet into my functions.php file: function enable_view_drafts() { $role = get_role( 'subscriber' ); $role->add_cap( 'read_private_posts' ); $role->add_cap( 'edit_posts' ); } add_action( 'after_setup_theme', 'enable_view_drafts'); …
Category: Web

Revert a Draft page to its original version

I recently went into my Main Page to make some changes, and my inexperience with the new block mode caused me to mess it up. However, I had saved the messed-up version as a Draft. Now, I want to get rid of the draft and revert it back to where it was before I made those changes. But I can't find any way to get rid of the changes I had made, so now my page is stuck as a …
Category: Web

Save a custom field in a custom table when saving a draft

I created a custom metabox with a custom field inside. I attach code. add_action( 'admin_menu', 'mtb_add_metabox' ); function mtb_add_metabox() { add_meta_box( 'mtb_metabox', 'Custom name', 'mtb_metabox_callback', 'page', 'normal', 'high' ); } function mtb_metabox_callback( $post ) { global $wpdb; $ct_name = ''; $query = $wpdb->get_results( $wpdb->prepare( " SELECT * FROM {$wpdb->prefix}list_name WHERE post_id = %d ", $post->ID ) ); if($query){ foreach($query as $value){ $ct_name = $value->name; } } echo '<table class="form-table"> <tbody> <tr> <th><label for="ct_name">Name</label></th> <td><input type="text" id="ct_name" name="ct_name" value="' . esc_attr($ct_name) …
Category: Web

Updating a custom post status after an expiry date rather than trashing it

I have set up a custom post type of featured products. Within that post type I have a custom date field for an expiry date. Currently when the date expires, the post gets moved to the Trash. I'm looking to change this though and hoped somebody maybe able to help. My current function is: function _delete_expired_fp() { $args = array( 'post_type' => 'featured_product', 'posts_per_page' => -1 ); $fproducts = new WP_Query($args); if ($fproducts->have_posts()): while($fproducts->have_posts()): $fproducts->the_post(); $expiration_date = get_post_meta( get_the_ID(), 'featured_product_expiration', …
Category: Web

Hiding Draft Post In Admin

Does anyone know of a way to hide draft post so that when "All" post is selected, draft post is not included? I tried adding this code to my functions.php file but it lead to an error, I'm assuming it's because this code was written for a previous version of WordPress. Is the code below the correct code I should be using? // Add a query argument to the Posts admin menu. // This is used to ensure that we …
Category: Web

Making draft page as the main page

A very newbie question. I wanted to update my home page. I copied it as a draft and made the modifications. Now.. how do I make it the main home page? It sounds very simple but have been totally unable to do so. My home page has only my website as the permalink.. I'm unable to change it. My updated homepage has permalink home-5. I'm stuck between the two pages. I'd also like to backup my original homepage for record …
Category: Web

Hook when post is set from published to draft?

Is there an action i can hook into when a post is set from published back to draft? I have tried both transition_post_status and publish_to_draft but they don't seem to work when I set the post back to draft. I am doing something like: add_action('publish_to_draft', 'doStuff') function doStuff() { // do stuff here } Maybe there is something I am missing, but I wanted to check that these are the correct hooks to use.
Category: Web

Content Visibility for Wordpress is not working (Drafts, public etc.)

I have an old WordPress installation. Unfortunately, public posts and drafts are displayed on the front. I think it's because of the wordpress loop. The following code is used: <section class="container container-fluid"> <div id="layout" style="padding: 0 -15px;"> <?php if (has_tag('Karriere')) ini_set("display_errors", 1); $args = array('offset' => 0, 'numberposts' => 12, 'limit' => 12, 'post_type' => "post", 'orderby' => 'post_date', 'order' => 'DESC', 'category' => '26,60', 'tag' => 'Karriere'); //$args = array('numberposts' => 2); $recent_posts = wp_get_recent_posts($args, ARRAY_A); $_SESSION['home_offset'] = count($recent_posts); …
Category: Web

What differences are there between a Privately Published post and a Draft post?

WordPress has three different post statuses: Published Pending Review Draft It also has three different visibility options: Public Password protected Private When you set a post to Published and Private, WordPress will display its status as Privately Published. Are there any differences between a post status of Draft vs. Privately Published? They seem to behave very similarly.
Category: Web

Auto Draft Specific Categories Posts after a certain number of Days

I want to put posts from two categories to automatically draft after the number of days like 90 Days from the date of Publish and I created a function with the help of some codes in other forums, but its not working. Post type = property Taxonomy = property-ad-type Targeted Property Ad Type Categories with IDs = (free-text-only-ad - ID:108), (photo-ad - ID: 107) Targeted Number of Days = (90Days from the date of Publish) I added this function wp_schedule_event(time(), …
Category: Web

How to get the Tags on Publish post hook?

Requirement: On the each publish/update post, we need all tags from the post and do some functionality on that. Case 1: Create post, add tags and Publish immediately === WORKS PERFECT === Case 2: Update Old post and hit Update button. === WORKS PERFECT === Case 3: Create post, add tags and save it to draft and close.. again open the same post and just hit the publish without changing anything === FAIL === Nothing in the post result.. no …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.