Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
staylor committed Aug 28, 2015
2 parents 616f1a3 + 0db421e commit fcc413c
Show file tree
Hide file tree
Showing 26 changed files with 12,863 additions and 12,750 deletions.
4 changes: 2 additions & 2 deletions wp-admin/css/common-rtl.css
Expand Up @@ -1788,8 +1788,8 @@ html.wp-toolbar {

.postbox .handlediv {
float: left;
width: 27px;
height: 30px;
width: 33px;
height: 36px;
}

.js .postbox .handlediv {
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/css/common.css
Expand Up @@ -1788,8 +1788,8 @@ html.wp-toolbar {

.postbox .handlediv {
float: right;
width: 27px;
height: 30px;
width: 33px;
height: 36px;
}

.js .postbox .handlediv {
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/css/wp-admin-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-admin/css/wp-admin.min.css

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions wp-admin/includes/template.php
Expand Up @@ -1083,8 +1083,11 @@ function do_meta_boxes( $screen, $context, $object ) {
$i++;
$hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
if ( 'dashboard_browser_nag' != $box['id'] )
echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>';
if ( 'dashboard_browser_nag' != $box['id'] ) {
echo '<button class="handlediv button-link" title="' . esc_attr__( 'Click to toggle' ) . '" aria-expanded="true">';
echo '<span class="screen-reader-text">' . sprintf( __( 'Click to toggle %s panel' ), $box['title'] ) . '</span><br />';
echo '</button>';
}
echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n";
echo '<div class="inside">' . "\n";
call_user_func($box['callback'], $object, $box);
Expand Down
16 changes: 15 additions & 1 deletion wp-admin/js/customize-controls.js
Expand Up @@ -284,8 +284,15 @@
* @param {Object} args.duration
* @param {Object} args.completeCallback
*/
onChangeActive: function ( active, args ) {
onChangeActive: function( active, args ) {
var duration, construct = this;
if ( args.unchanged ) {
if ( args.completeCallback ) {
args.completeCallback();
}
return;
}

duration = ( 'resolved' === api.previewer.deferred.active.state() ? args.duration : 0 );
if ( ! $.contains( document, construct.container[0] ) ) {
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
Expand Down Expand Up @@ -1497,6 +1504,13 @@
* @param {Callback} args.completeCallback
*/
onChangeActive: function ( active, args ) {
if ( args.unchanged ) {
if ( args.completeCallback ) {
args.completeCallback();
}
return;
}

if ( ! $.contains( document, this.container ) ) {
// jQuery.fn.slideUp is not hiding an element if it is not in the DOM
this.container.toggle( active );
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/js/customize-controls.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions wp-admin/js/customize-nav-menus.js
Expand Up @@ -119,6 +119,10 @@
initialize: function() {
var self = this;

if ( ! api.panel.has( 'nav_menus' ) ) {
return;
}

this.$search = $( '#menu-items-search' );
this.sectionContent = this.$el.find( '.accordion-section-content' );

Expand Down
4 changes: 2 additions & 2 deletions wp-admin/js/customize-nav-menus.min.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions wp-admin/js/postbox.js
Expand Up @@ -11,13 +11,16 @@ var postboxes;

self.init(page, args);

$('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function() {
$('.postbox .hndle, .postbox .handlediv').bind('click.postboxes', function( e ) {
var p = $(this).parent('.postbox'), id = p.attr('id');

if ( 'dashboard_browser_nag' == id )
return;

p.toggleClass('closed');
e.preventDefault();

p.toggleClass( 'closed' );
$(this).attr( 'aria-expanded', ! p.hasClass( 'closed' ) );

if ( page != 'press-this' )
self.save_state(page);
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/postbox.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 38 additions & 25 deletions wp-includes/category-template.php
Expand Up @@ -460,32 +460,44 @@ function wp_dropdown_categories( $args = '' ) {
/**
* Display or retrieve the HTML list of categories.
*
* The list of arguments is below:
* 'show_option_all' (string) - Text to display for showing all categories.
* 'orderby' (string) default is 'ID' - What column to use for ordering the
* categories.
* 'order' (string) default is 'ASC' - What direction to order categories.
* 'show_count' (bool|int) default is 0 - Whether to show how many posts are
* in the category.
* 'hide_empty' (bool|int) default is 1 - Whether to hide categories that
* don't have any posts attached to them.
* 'use_desc_for_title' (bool|int) default is 1 - Whether to use the
* category description as the title attribute.
* 'feed' - See {@link get_categories()}.
* 'feed_type' - See {@link get_categories()}.
* 'feed_image' - See {@link get_categories()}.
* 'child_of' (int) default is 0 - See {@link get_categories()}.
* 'exclude' (string) - See {@link get_categories()}.
* 'exclude_tree' (string) - See {@link get_categories()}.
* 'echo' (bool|int) default is 1 - Whether to display or retrieve content.
* 'current_category' (int) - See {@link get_categories()}.
* 'hierarchical' (bool) - See {@link get_categories()}.
* 'title_li' (string) - See {@link get_categories()}.
* 'depth' (int) - The max depth.
*
* @since 2.1.0
* @since 4.4.0 Introduced the `hide_title_if_no_cats` argument.
*
* @param string|array $args Optional. Override default arguments.
* @param string|array $args {
* Array of optional arguments.
*
* @type string $show_option_all Text to display for showing all categories. Default empty string.
* @type string $show_option_none Text to display for the 'no categories' option.
* Default 'No categories'.
* @type string $orderby The column to use for ordering categories. Default 'ID'.
* @type string $order Which direction to order categories. Accepts 'ASC' or 'DESC'.
* Default 'ASC'.
* @type bool|int $show_count Whether to show how many posts are in the category. Default 0.
* @type bool|int $hide_empty Whether to hide categories that don't have any posts attached to them.
* Default 1.
* @type bool|int $use_desc_for_title Whether to use the category description as the title attribute.
* Default 1.
* @type string $feed Text to use for the feed link. Default 'Feed for all posts filed
* under [cat name]'.
* @type string $feed_type Feed type. Used to build feed link. See {@link get_term_feed_link()}.
* Default empty string (default feed).
* @type string $feed_image URL of an image to use for the feed link. Default empty string.
* @type int $child_of Term ID to retrieve child terms of. See {@link get_terms()}. Default 0.
* @type array|string $exclude Array or comma/space-separated string of term IDs to exclude.
* See {@link get_terms()}. Default empty string.
* @type array|string $exclude_tree Array or comma/space-separated string of term IDs to exclude, along
* with their descendants. See {@link get_terms()}. Default empty string.
* @type bool|int $echo True to echo markup, false to return it. Default 1.
* @type int $current_category Category that should get the 'current-cat' class. Default 0.
* @type bool $hierarchical Whether to include terms that have non-empty descendants.
* See {@link get_terms()}. Default true.
* @type string $title_li Text to use for the list title `<li>` element. Pass an empty string
* to disable. Default 'Categories'.
* @type bool $hide_title_if_no_cats Whether to hide the `$title_li` element if there are no terms in
* the list. Default false (title will always be shown).
* @type int $depth Category depth. Used for tab indentation. Default 0.
* @type string $taxonomy Taxonomy name. Default 'category'.
* }
* @return false|string HTML content only if 'echo' argument is 0.
*/
function wp_list_categories( $args = '' ) {
Expand All @@ -499,6 +511,7 @@ function wp_list_categories( $args = '' ) {
'feed_image' => '', 'exclude' => '',
'exclude_tree' => '', 'current_category' => 0,
'hierarchical' => true, 'title_li' => __( 'Categories' ),
'hide_title_if_no_cats' => false,
'echo' => 1, 'depth' => 0,
'taxonomy' => 'category'
);
Expand Down Expand Up @@ -526,7 +539,7 @@ function wp_list_categories( $args = '' ) {
$categories = get_categories( $r );

$output = '';
if ( $r['title_li'] && 'list' == $r['style'] ) {
if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_no_cats'] ) ) {
$output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li'] . '<ul>';
}
if ( empty( $categories ) ) {
Expand Down

0 comments on commit fcc413c

Please sign in to comment.