Fix: Share a Draft Plugin, Getting Only 5 Posts - WordPress

Share a Draft, Getting Only 5 Posts [FIXED] – WordPress


In this tutorial, we are going to teach you, how you can display all posts in your Share a Draft plugin in WordPress. This plugin is used to share your unpublished posts using a link. In WordPress, by default only published posts are shared. You can download the plugin manually from here.

Video Tutorial:

You just need to follow the steps below:

  1. From your WordPress admin panel, go to “Plugins > Plugin Editor”.
  2. Select plugin to edit “Share a Draft”.
  3. Select plugin file “shareadraft.php”.
  4. Search for 2 variables; “$my_unpublished” and “$others_unpublished”.
  5. Add the “nopaging” value in the “get_posts” function of both of these arrays.
$my_unpublished = get_posts( array(
	'post_status' => $unpublished_statuses,
	'author' => $current_user->ID,
	// some environments, like hook on those filters
	// for an extra caching layer
	'suppress_filters' => false,
	"nopaging" => true
) );
$others_unpublished = get_posts( array(
	'post_status' => $unpublished_statuses,
	'author' => -$current_user->ID,
	'suppress_filters' => false,
	'perm' => 'editable',
	"nopaging" => true
) );
  1. Click the “Update File” button and refresh your plugin page.

Then you will be able to view all of your drafted posts.

Learn how to fix your WP Carousel Slider plugin height issue following this tutorial.

How useful was this post

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post

Leave a Reply

Please disable your adblocker or whitelist this site!