Skip to content

Commit

Permalink
Bump to 1.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
JJJ committed May 9, 2017
1 parent 8cc0b97 commit 07e653b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 20 deletions.
12 changes: 9 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: johnjamesjacoby, stuttter
Tags: jquery, filter, select, filters
Requires at least: 4.3
Tested up to: 4.7
Stable tag: 1.0.0
Tested up to: 4.8
Stable tag: 1.1.0
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9Q4F4EL5YJ62J

== Description ==
Expand Down Expand Up @@ -44,7 +44,7 @@ WP Pretty Filters makes post filters better match what's already in Media & Atta
= What dropdowns does this target? =

`
#posts-filter .tablenav.top .actions:not(.bulkactions)
.tablenav.top .actions:not(.bulkactions)
`

= Where can I get support? =
Expand All @@ -57,6 +57,12 @@ http://github.com/stuttter/wp-pretty-filters/

== Changelog ==

= 1.1.0 - 2017/05/09 =
* Support users, BuddyPress, and more
* Hide secondary user role assignment
* Hide pretty filters if empty
* Load in wp_head to avoid DOM jitter

= 1.0.0 - 2016/09/13 =
* Chosen Support
* Stable release
Expand Down
8 changes: 4 additions & 4 deletions wp-pretty-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wp-pretty-filters
* Version: 1.0.0
* Version: 1.1.0
* Description: Makes post filters match Media & Attachments
*/

Expand All @@ -27,8 +27,8 @@ function _wp_pretty_filters() {
$ver = wp_pretty_filters_get_asset_version();

// Styles
wp_enqueue_style( 'wp-pretty-filters', $url . 'assets/css/pretty-filters.css', array(), $ver );
wp_enqueue_script( 'wp-pretty-filters', $url . 'assets/js/pretty-filters.js', array( 'jquery' ), $ver, true );
wp_enqueue_style( 'wp-pretty-filters', $url . 'assets/css/pretty-filters.css', array(), $ver );
wp_enqueue_script( 'wp-pretty-filters', $url . 'assets/js/pretty-filters.js', array( 'jquery' ), $ver );
}
add_action( 'admin_enqueue_scripts', '_wp_pretty_filters', 11 );

Expand All @@ -51,5 +51,5 @@ function wp_pretty_filters_get_plugin_url() {
* @return int
*/
function wp_pretty_filters_get_asset_version() {
return 201609130002;
return 201705090001;
}
7 changes: 5 additions & 2 deletions wp-pretty-filters/assets/css/pretty-filters.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
.wp-pretty-filters {

float: none;
clear: both;

display: inline-block;
position: relative;
-webkit-box-sizing: border-box;
Expand All @@ -19,5 +17,10 @@
}

.wp-pretty-filters .chosen-container {
margin-right: 4px;
}

.wp-pretty-filters .chosen-container + input,
.wp-pretty-filters .chosen-container + button {
margin-right: 8px;
}
35 changes: 24 additions & 11 deletions wp-pretty-filters/assets/js/pretty-filters.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,35 @@
jQuery( document ).ready( function( $ ) {
'use strict';

// Look for posts
var toptablenav = $( '#posts-filter .tablenav.top' );
// Look for top tablenav
var toptablenav = $( '.tablenav.top' );

// Maybe try comments
// Bail if no toptablenav
if ( ! toptablenav.length ) {
toptablenav = $( '#comments-form .tablenav.top' );
return;
}

// Only proceed if toptablenav was found
if ( toptablenav.length ) {
var filters = toptablenav.find( '.actions:not(.bulkactions)' );
// Look for actions that aren't bulk
var filters = toptablenav.find( '.actions:not(.bulkactions)' );

// Add a class for custom styling
filters.addClass( 'wp-pretty-filters' );
// Bail if no filters
if ( ! filters.length ) {
return;
}

// Add a class for custom styling
filters.addClass( 'wp-pretty-filters' );

// Relocate
toptablenav.before( filters );
// Relocate
toptablenav.before( filters );

// Hide if pretty filters is empty
if ( ! $.trim( filters.html() ) ) {
filters.hide();
}

// Maybe hide the users bottom tablenav
$( 'body.users-php .tablenav.bottom' )
.find( '.actions:not(.bulkactions)' )
.hide();
} );

0 comments on commit 07e653b

Please sign in to comment.