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:
- From your WordPress admin panel, go to “Plugins > Plugin Editor”.
- Select plugin to edit “Share a Draft”.
- Select plugin file “shareadraft.php”.
- Search for 2 variables; “$my_unpublished” and “$others_unpublished”.
- 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 WordPress.com 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
) );
- Click the “Update File” button and refresh your plugin page.
Then you will be able to view all of your drafted posts.