Plugin Planet

Premium WordPress Plugins

As of version 3.4, USP Pro can be customized to include a “Non-USP” button to filter non-submitted posts on the Posts screen in the WordPress Admin Area. This quick tutorial shows how to enable it.

Add a “Non-USP” post-filter button

By default, USP Pro provides a button that enables filtering of all submitted posts on the Posts screen in the WP Admin Area. So when you click on the “USP” button on the Posts screen, it will display only submitted posts. As of USP Pro version 3.4, it also is possible to display a “Non-USP” button that filters all non-submitted posts.

To enable the “Non-USP” filter button, add this code via your theme functions or via custom plugin:

// USP Pro : add button to display only non-submitted posts
function usp_pro_filter_posts_link($link, $current) {
	
	$non  = '<a id="usp-admin-filter-other" class="button" ';
	$non .= 'href="'. admin_url('edit.php?post_type='. $current .'&user_submitted=0') .'" ';
	$non .= 'title="'. esc_attr__('Show non-submitted posts', 'usp') .'">';
	$non .= esc_html__('Non-USP', 'usp') .'</a>';
	
	return $non . $link;
	
}
add_filter('usp_filter_posts_link', 'usp_pro_filter_posts_link', 10, 2);

No changes are necessary; USP Pro provides all the other code needed to style the button and do the post filtering. Once added to your site, this code will display a “Non-USP” button on the Posts screen (or whatever post type is selected for the USP “Post Type” setting).

Screenshots

Here are some screenshots that show the post-filtering buttons in effect:

USP Pro - Filter Post Buttons

So if you click the “USP” button, only posts that were submitted via USP are displayed:

USP Pro - Filter Submitted Posts

Or if you click the “Non-USP” button, only posts that were not submitted are displayed:

USP Pro - Filter Non-Submitted Posts

Note: This feature also is available via the free version of USP. So if you have the Non-USP button displayed for the free version, the pro version should work out of the box, with no additional changes required.