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 Oct 1, 2015
2 parents cfda928 + d6a1a96 commit a581ccb
Show file tree
Hide file tree
Showing 47 changed files with 639 additions and 347 deletions.
4 changes: 4 additions & 0 deletions wp-admin/css/common-rtl.css
Expand Up @@ -883,6 +883,10 @@ abbr.required,
padding: 6px 10px 8px;
}

.misc-pub-filename {
word-wrap: break-word;
}

#minor-publishing-actions {
padding: 10px 10px 0 10px;
text-align: left;
Expand Down
4 changes: 4 additions & 0 deletions wp-admin/css/common.css
Expand Up @@ -883,6 +883,10 @@ abbr.required,
padding: 6px 10px 8px;
}

.misc-pub-filename {
word-wrap: break-word;
}

#minor-publishing-actions {
padding: 10px 10px 0 10px;
text-align: right;
Expand Down
3 changes: 2 additions & 1 deletion wp-admin/css/edit-rtl.css
Expand Up @@ -113,11 +113,12 @@ input#link_url {
}

#editable-post-name {
background-color: #fffbcc;
font-weight: bold;
}

#editable-post-name input {
font-size: 13px;
font-weight: normal;
height: 22px;
margin: 0;
width: 16em;
Expand Down
3 changes: 2 additions & 1 deletion wp-admin/css/edit.css
Expand Up @@ -113,11 +113,12 @@ input#link_url {
}

#editable-post-name {
background-color: #fffbcc;
font-weight: bold;
}

#editable-post-name input {
font-size: 13px;
font-weight: normal;
height: 22px;
margin: 0;
width: 16em;
Expand Down
6 changes: 5 additions & 1 deletion wp-admin/css/list-tables-rtl.css
Expand Up @@ -285,7 +285,7 @@ th .comment-grey-bubble:before {
------------------------------------------------------------------------------*/

table.fixed {
table-layout: auto;
table-layout: fixed;
}

.fixed .column-rating,
Expand Down Expand Up @@ -1677,6 +1677,10 @@ div.action-links,
.plugin-card .desc p:first-of-type {
margin-top: 0;
}

.fixed .column-date {
width: 14%;
}
}

@media screen and ( max-width: 782px ) {
Expand Down
6 changes: 5 additions & 1 deletion wp-admin/css/list-tables.css
Expand Up @@ -285,7 +285,7 @@ th .comment-grey-bubble:before {
------------------------------------------------------------------------------*/

table.fixed {
table-layout: auto;
table-layout: fixed;
}

.fixed .column-rating,
Expand Down Expand Up @@ -1677,6 +1677,10 @@ div.action-links,
.plugin-card .desc p:first-of-type {
margin-top: 0;
}

.fixed .column-date {
width: 14%;
}
}

@media screen and ( max-width: 782px ) {
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/css/wp-admin-rtl.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions wp-admin/css/wp-admin.min.css

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions wp-admin/includes/ajax-actions.php
Expand Up @@ -1877,6 +1877,10 @@ function wp_ajax_save_widget() {

$sidebar = array_diff( $sidebar, array($widget_id) );
$_POST = array('sidebar' => $sidebar_id, 'widget-' . $id_base => array(), 'the-widget-id' => $widget_id, 'delete_widget' => '1');

/** This action is documented in wp-admin/widgets.php */
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );

} elseif ( $settings && preg_match( '/__i__|%i%/', key($settings) ) ) {
if ( !$multi_number )
wp_die( $error );
Expand Down
6 changes: 3 additions & 3 deletions wp-admin/includes/class-wp-list-table.php
Expand Up @@ -1141,21 +1141,21 @@ protected function display_tablenav( $which ) {
if ( 'top' === $which ) {
wp_nonce_field( 'bulk-' . $this->_args['plural'] );
}
if ( $this->has_items() ) : ?>
?>
<div class="tablenav <?php echo esc_attr( $which ); ?>">

<?php if ( $this->has_items() ): ?>
<div class="alignleft actions bulkactions">
<?php $this->bulk_actions( $which ); ?>
</div>
<?php
<?php endif;
$this->extra_tablenav( $which );
$this->pagination( $which );
?>

<br class="clear" />
</div>
<?php
endif;
}

/**
Expand Down
31 changes: 15 additions & 16 deletions wp-admin/includes/class-wp-posts-list-table.php
Expand Up @@ -80,18 +80,16 @@ public function __construct( $args = array() ) {
$post_type = $this->screen->post_type;
$post_type_object = get_post_type_object( $post_type );

if ( is_multi_author() ) {
$exclude_states = get_post_stati( array(
'show_in_admin_all_list' => false,
) );
$this->user_posts_count = $wpdb->get_var( $wpdb->prepare( "
SELECT COUNT( 1 )
FROM $wpdb->posts
WHERE post_type = %s
AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
AND post_author = %d
", $post_type, get_current_user_id() ) );
}
$exclude_states = get_post_stati( array(
'show_in_admin_all_list' => false,
) );
$this->user_posts_count = intval( $wpdb->get_var( $wpdb->prepare( "
SELECT COUNT( 1 )
FROM $wpdb->posts
WHERE post_type = %s
AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
AND post_author = %d
", $post_type, get_current_user_id() ) ) );

if ( $this->user_posts_count && ! current_user_can( $post_type_object->cap->edit_others_posts ) && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) ) {
$_GET['author'] = get_current_user_id();
Expand Down Expand Up @@ -270,6 +268,11 @@ protected function get_views() {
$all_args = array( 'post_type' => $post_type );
$mine = '';

// Subtract post types that are not included in the admin all list.
foreach ( get_post_stati( array( 'show_in_admin_all_list' => false ) ) as $state ) {
$total_posts -= $num_posts->$state;
}

if ( $this->user_posts_count && $this->user_posts_count !== $total_posts ) {
if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user_id ) ) {
$class = 'current';
Expand All @@ -296,10 +299,6 @@ protected function get_views() {
$class = '';
}

// Subtract post types that are not included in the admin all list.
foreach ( get_post_stati( array('show_in_admin_all_list' => false) ) as $state )
$total_posts -= $num_posts->$state;

if ( empty( $class ) && ( ( $this->is_base_request() && ! $this->user_posts_count ) || isset( $_REQUEST['all_posts'] ) ) ) {
$class = 'current';
}
Expand Down
8 changes: 4 additions & 4 deletions wp-admin/includes/class-wp-upgrader.php
Expand Up @@ -452,7 +452,7 @@ public function install_package( $args = array() ) {
$source = trailingslashit( $args['source'] ) . trailingslashit( $source_files[0] );
} elseif ( count( $source_files ) == 0 ) {
return new WP_Error( 'incompatible_archive_empty', $this->strings['incompatible_archive'], $this->strings['no_files'] ); // There are no files?
} else { //It's only a single file, the upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename.
} else { // It's only a single file, the upgrader will use the folder name of this file as the destination folder. Folder name is based on zip filename.
$source = trailingslashit( $args['source'] );
}

Expand Down Expand Up @@ -876,7 +876,7 @@ public function install( $package, $args = array() ) {
*
* @param string $plugin The basename path to the main plugin file.
* @param array $args {
* Optional. Other arguments for upgrading a plugin package. Defualt empty array.
* Optional. Other arguments for upgrading a plugin package. Default empty array.
*
* @type bool $clear_update_cache Whether to clear the plugin updates cache if successful.
* Default true.
Expand Down Expand Up @@ -1232,7 +1232,7 @@ class Theme_Upgrader extends WP_Upgrader {
*
* @since 2.8.0
* @access public
* @var array|WP_Erorr $result
* @var array|WP_Error $result
* @see WP_Upgrader::$result
*/
public $result;
Expand Down Expand Up @@ -2421,7 +2421,7 @@ public static function should_update_to_version( $offered_ver ) {
}

/**
* Compare the disk file checksums agains the expected checksums.
* Compare the disk file checksums against the expected checksums.
*
* @since 3.7.0
* @access public
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/includes/class-wp-users-list-table.php
Expand Up @@ -217,7 +217,7 @@ protected function extra_tablenav( $which ) {
$id = 'bottom' === $which ? 'new_role2' : 'new_role';
?>
<div class="alignleft actions">
<?php if ( current_user_can( 'promote_users' ) ) : ?>
<?php if ( current_user_can( 'promote_users' ) && $this->has_items() ) : ?>
<label class="screen-reader-text" for="<?php echo $id ?>"><?php _e( 'Change role to&hellip;' ) ?></label>
<select name="<?php echo $id ?>" id="<?php echo $id ?>">
<option value=""><?php _e( 'Change role to&hellip;' ) ?></option>
Expand Down
7 changes: 5 additions & 2 deletions wp-admin/includes/misc.php
Expand Up @@ -246,8 +246,11 @@ function update_home_siteurl( $old_value, $value ) {
if ( defined( "WP_INSTALLING" ) )
return;

// If home changed, write rewrite rules to new location.
flush_rewrite_rules();
if ( is_multisite() && ms_is_switched() ) {
delete_option( 'rewrite_rules' );
} else {
flush_rewrite_rules();
}
}

/**
Expand Down
60 changes: 29 additions & 31 deletions wp-admin/includes/post.php
Expand Up @@ -1287,19 +1287,35 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {

list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);

if ( current_user_can( 'read_post', $post->ID ) ) {
$ptype = get_post_type_object( $post->post_type );
$view_post = $ptype->labels->view_item;
}
$view_link = false;
$preview_target = '';

if ( 'publish' == get_post_status( $post ) ) {
$title = __('Click to edit this part of the permalink');
} else {
$title = __('Temporary permalink. Click to edit this part.');
if ( current_user_can( 'read_post', $post->ID ) ) {
if ( 'draft' === $post->post_status ) {
$draft_link = set_url_scheme( get_permalink( $post->ID ) );
$view_link = get_preview_post_link( $post, array(), $draft_link );
$preview_target = " target='wp-preview-{$post->ID}'";
} else {
if ( 'publish' === $post->post_status || 'attachment' === $post->post_type ) {
$view_link = get_permalink( $post );
} else {
// Allow non-published (private, future) to be viewed at a pretty permalink.
$view_link = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, urldecode( $permalink ) );
}
}
}

// Permalinks without a post/page name placeholder don't have anything to edit
if ( false === strpos( $permalink, '%postname%' ) && false === strpos( $permalink, '%pagename%' ) ) {
$return = '<strong>' . __('Permalink:') . "</strong>\n" . '<span id="sample-permalink" tabindex="-1">' . $permalink . "</span>\n";
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";

if ( false !== $view_link ) {
$return .= '<a id="sample-permalink" href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $view_link . "</a>\n";
} else {
$return .= '<span id="sample-permalink">' . $permalink . "</span>\n";
}

// Encourage a pretty permalink setting
if ( '' == get_option( 'permalink_structure' ) && current_user_can( 'manage_options' ) && !( 'page' == get_option('show_on_front') && $id == get_option('page_on_front') ) ) {
$return .= '<span id="change-permalinks"><a href="options-permalink.php" class="button button-small" target="_blank">' . __('Change Permalinks') . "</a></span>\n";
}
Expand All @@ -1318,34 +1334,16 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
}
}

$post_name_html = '<span id="editable-post-name" title="' . $title . '">' . $post_name_abridged . '</span>';
$post_name_html = '<span id="editable-post-name">' . $post_name_abridged . '</span>';
$display_link = str_replace( array( '%pagename%', '%postname%' ), $post_name_html, urldecode( $permalink ) );

$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
$return .= '<span id="sample-permalink" tabindex="-1">' . $display_link . "</span>\n";
$return = '<strong>' . __( 'Permalink:' ) . "</strong>\n";
$return .= '<span id="sample-permalink"><a href="' . esc_url( $view_link ) . '"' . $preview_target . '>' . $display_link . "</a></span>\n";
$return .= '&lrm;'; // Fix bi-directional text display defect in RTL languages.
$return .= '<span id="edit-slug-buttons"><a href="#post_name" class="edit-slug button button-small hide-if-no-js" onclick="editPermalink(' . $id . '); return false;">' . __( 'Edit' ) . "</a></span>\n";
$return .= '<span id="edit-slug-buttons"><button type="button" class="edit-slug button button-small hide-if-no-js">' . __( 'Edit' ) . "</button></span>\n";
$return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n";
}

if ( isset( $view_post ) ) {
if ( 'draft' == $post->post_status || 'pending' == $post->post_status ) {
$draft_link = set_url_scheme( get_permalink( $post->ID ) );
$preview_link = get_preview_post_link( $post, array(), $draft_link );
$return .= "<span id='view-post-btn'><a href='" . esc_url( $preview_link ) . "' class='button button-small' target='wp-preview-{$post->ID}'>$view_post</a></span>\n";
} else {
if ( 'publish' === $post->post_status ) {
// View Post button should always go to the saved permalink.
$pretty_permalink = get_permalink( $post );
} else {
// Allow non-published (private, future) to be viewed at a pretty permalink.
$pretty_permalink = str_replace( array( '%pagename%', '%postname%' ), $post->post_name, urldecode( $permalink ) );
}

$return .= "<span id='view-post-btn'><a href='" . $pretty_permalink . "' class='button button-small'>$view_post</a></span>\n";
}
}

/**
* Filter the sample permalink HTML markup.
*
Expand Down
4 changes: 2 additions & 2 deletions wp-admin/includes/taxonomy.php
Expand Up @@ -93,9 +93,9 @@ function wp_create_categories( $categories, $post_id = '' ) {
* @param array $catarr {
* Array of arguments for inserting a new category.
*
* @type int $cat_ID Categoriy ID. A non-zero value updates an existing category.
* @type int $cat_ID Category ID. A non-zero value updates an existing category.
* Default 0.
* @type string $taxonomy Taxonomy slug. Defualt 'category'.
* @type string $taxonomy Taxonomy slug. Default 'category'.
* @type string $cat_name Category name. Default empty.
* @type string $category_description Category description. Default empty.
* @type string $category_nicename Category nice (display) name. Default empty.
Expand Down

0 comments on commit a581ccb

Please sign in to comment.