Commit edb38c6d authored by lucha's avatar lucha
Browse files

Wordpress 4.9.4

parent 8c9ddada
......@@ -32,6 +32,42 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<div class="changelog point-releases">
<h3><?php _e( 'Maintenance and Security Releases' ); ?></h3>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
1
),
'4.9.4',
number_format_i18n( 1 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.9.4' );
?>
</p>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
34
),
'4.9.3',
number_format_i18n( 34 )
);
?>
<?php
/* translators: %s: Codex URL */
printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'https://codex.wordpress.org/Version_4.9.3' );
?>
</p>
<p>
<?php
printf(
......
......@@ -177,9 +177,7 @@
cursor: pointer;
}
.media-widget-preview.media_image,
.media-widget-preview.media_audio,
.attachment-media-view {
.media-widget-preview .placeholder {
background: #f1f1f1;
}
......@@ -190,7 +188,7 @@
background: transparent;
}
.media-widget-gallery-preview .gallery-item .gallery-icon {
.media-widget-gallery-preview .gallery-item .gallery-icon {
margin: 4.5%;
}
......
This diff is collapsed.
......@@ -177,9 +177,7 @@
cursor: pointer;
}
.media-widget-preview.media_image,
.media-widget-preview.media_audio,
.attachment-media-view {
.media-widget-preview .placeholder {
background: #f1f1f1;
}
......@@ -190,7 +188,7 @@
background: transparent;
}
.media-widget-gallery-preview .gallery-item .gallery-icon {
.media-widget-gallery-preview .gallery-item .gallery-icon {
margin: 4.5%;
}
......
This diff is collapsed.
......@@ -77,7 +77,7 @@ if ( $wp_customize->changeset_post_id() ) {
if ( in_array( get_post_status( $changeset_post->ID ), array( 'publish', 'trash' ), true ) ) {
wp_die(
'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
'<p>' . __( 'This changeset has already been published and cannot be further modified.' ) . '</p>' .
'<p>' . __( 'This changeset cannot be further modified.' ) . '</p>' .
'<p><a href="' . esc_url( remove_query_arg( 'changeset_uuid' ) ) . '">' . __( 'Customize New Changes' ) . '</a></p>',
403
);
......
......@@ -628,7 +628,7 @@ function install_plugin_information() {
) );
?>
<div class="counter-container">
<span class="counter-label"><a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?filter=<?php echo $key; ?>"
<span class="counter-label"><a href="https://wordpress.org/support/plugin/<?php echo $api->slug; ?>/reviews/?filter=<?php echo $key; ?>"
target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span>
<span class="counter-back">
<span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
......
......@@ -2564,7 +2564,7 @@
// Temporary special function since supplying SFTP credentials does not work yet. See #42184.
function disableInstallButtons() {
return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
}
section.overlay.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() );
......@@ -3074,7 +3074,7 @@
api.Panel.prototype.attachEvents.apply( panel );
// Temporary since supplying SFTP credentials does not work yet. See #42184
if ( api.settings.theme._filesystemCredentialsNeeded ) {
if ( api.settings.theme._canInstall && api.settings.theme._filesystemCredentialsNeeded ) {
panel.notifications.add( new api.Notification( 'theme_install_unavailable', {
message: api.l10n.themeInstallUnavailable,
type: 'info',
......@@ -5132,7 +5132,7 @@
// Temporary special function since supplying SFTP credentials does not work yet. See #42184.
function disableInstallButtons() {
return disableSwitchButtons() || true === api.settings.theme._filesystemCredentialsNeeded;
return disableSwitchButtons() || false === api.settings.theme._canInstall || true === api.settings.theme._filesystemCredentialsNeeded;
}
function updateButtons() {
control.container.find( 'button.preview, button.preview-theme' ).toggleClass( 'disabled', disableSwitchButtons() );
......@@ -7931,7 +7931,7 @@
previewerAlive = state.instance( 'previewerAlive' ),
editShortcutVisibility = state.instance( 'editShortcutVisibility' ),
changesetLocked = state.instance( 'changesetLocked' ),
populateChangesetUuidParam;
populateChangesetUuidParam, defaultSelectedChangesetStatus;
state.bind( 'change', function() {
var canSave;
......@@ -7965,9 +7965,7 @@
} else {
saveBtn.val( api.l10n.schedule );
}
} else if ( ! api.settings.changeset.currentUserCanPublish ) {
selectedChangesetStatus( 'draft' );
} else {
} else if ( api.settings.changeset.currentUserCanPublish ) {
saveBtn.val( api.l10n.publish );
}
closeBtn.find( '.screen-reader-text' ).text( api.l10n.cancel );
......@@ -7989,12 +7987,14 @@
return status;
};
defaultSelectedChangesetStatus = api.settings.changeset.currentUserCanPublish ? 'publish' : 'draft';
// Set default states.
changesetStatus( api.settings.changeset.status );
changesetLocked( Boolean( api.settings.changeset.lockUser ) );
changesetDate( api.settings.changeset.publishDate );
selectedChangesetDate( api.settings.changeset.publishDate );
selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? 'publish' : api.settings.changeset.status );
selectedChangesetStatus( '' === api.settings.changeset.status || 'auto-draft' === api.settings.changeset.status ? defaultSelectedChangesetStatus : api.settings.changeset.status );
selectedChangesetStatus.link( changesetStatus ); // Ensure that direct updates to status on server via wp.customizer.previewer.save() will update selection.
saved( true );
if ( '' === changesetStatus() ) { // Handle case for loading starter content.
......@@ -8240,6 +8240,7 @@
// Check for lock when sending heartbeat requests.
$( document ).on( 'heartbeat-send.update_lock_notice', function( event, data ) {
data.check_changeset_lock = true;
data.changeset_uuid = api.settings.changeset.uuid;
} );
// Handle heartbeat ticks.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -280,30 +280,6 @@ window.wp = window.wp || {};
return result;
}
/**
* @summary Check if a shortcode has Live Preview enabled for it.
*
* Previewable shortcodes here refers to shortcodes that have Live Preview enabled.
*
* These shortcodes get rewritten when the editor is in Visual mode, which means that
* we don't want to change anything inside them, i.e. inserting a selection marker
* inside the shortcode will break it :(
*
* @link wp-includes/js/mce-view.js
*
* @param {string} shortcode The shortcode to check.
* @return {boolean} If a shortcode has Live Preview or not
*/
function isShortcodePreviewable( shortcode ) {
var defaultPreviewableShortcodes = [ 'caption' ];
return (
defaultPreviewableShortcodes.indexOf( shortcode ) !== -1 ||
wp.mce.views.get( shortcode ) !== undefined
);
}
/**
* @summary Get all shortcodes and their positions in the content
*
......@@ -340,23 +316,12 @@ window.wp = window.wp || {};
*/
var showAsPlainText = shortcodeMatch[1] === '[';
/**
* For more context check the docs for:
*
* @link isShortcodePreviewable
*
* In addition, if the shortcode will get rendered as plain text ( see above ),
* we can treat it as text and use the selection markers in it.
*/
var isPreviewable = ! showAsPlainText && isShortcodePreviewable( shortcodeMatch[2] );
shortcodeInfo = {
shortcodeName: shortcodeMatch[2],
showAsPlainText: showAsPlainText,
startIndex: shortcodeMatch.index,
endIndex: shortcodeMatch.index + shortcodeMatch[0].length,
length: shortcodeMatch[0].length,
isPreviewable: isPreviewable
length: shortcodeMatch[0].length
};
shortcodesDetails.push( shortcodeInfo );
......@@ -382,7 +347,6 @@ window.wp = window.wp || {};
startIndex: shortcodeMatch.index,
endIndex: shortcodeMatch.index + shortcodeMatch[ 0 ].length,
length: shortcodeMatch[ 0 ].length,
isPreviewable: true,
urlAtStartOfContent: shortcodeMatch[ 1 ] === '',
urlAtEndOfContent: shortcodeMatch[ 3 ] === ''
};
......@@ -465,7 +429,7 @@ window.wp = window.wp || {};
}
var isCursorStartInShortcode = getShortcodeWrapperInfo( content, cursorStart );
if ( isCursorStartInShortcode && isCursorStartInShortcode.isPreviewable ) {
if ( isCursorStartInShortcode && ! isCursorStartInShortcode.showAsPlainText ) {
/**
* If a URL is at the start or the end of the content,
* the selection doesn't work, because it inserts a marker in the text,
......@@ -482,7 +446,7 @@ window.wp = window.wp || {};
}
var isCursorEndInShortcode = getShortcodeWrapperInfo( content, cursorEnd );
if ( isCursorEndInShortcode && isCursorEndInShortcode.isPreviewable ) {
if ( isCursorEndInShortcode && ! isCursorEndInShortcode.showAsPlainText ) {
if ( isCursorEndInShortcode.urlAtEndOfContent ) {
cursorEnd = isCursorEndInShortcode.startIndex;
} else {
......
This diff is collapsed.
......@@ -2437,7 +2437,7 @@
return;
}
if ( 'undefined' === typeof message.action ) {
if ( ! message || 'undefined' === typeof message.action ) {
return;
}
......
This diff is collapsed.
......@@ -513,9 +513,10 @@ wpWidgets = {
save : function( widget, del, animate, order ) {
var self = this, data, a,
sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ),
form = widget.find( 'form' );
form = widget.find( 'form' ),
isAdd = widget.find( 'input.add_new' ).val();
if ( ! del && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
if ( ! del && ! isAdd && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
return;
}
......
This diff is collapsed.
......@@ -83,7 +83,7 @@ if ( $_POST ) {
);
// Handle translation installation.
if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) ) {
if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
$language = wp_download_language_pack( $_POST['WPLANG'] );
if ( $language ) {
$_POST['WPLANG'] = $language;
......@@ -374,14 +374,16 @@ if ( isset( $_GET['updated'] ) ) {
$lang = '';
}
wp_dropdown_languages( array(
'name' => 'WPLANG',
'id' => 'WPLANG',
'selected' => $lang,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ),
) );
wp_dropdown_languages(
array(
'name' => 'WPLANG',
'id' => 'WPLANG',
'selected' => $lang,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
)
);
?>
</td>
</tr>
......
......@@ -68,7 +68,7 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
$meta['WPLANG'] = ''; // en_US
} elseif ( in_array( $_POST['WPLANG'], get_available_languages() ) ) {
$meta['WPLANG'] = $_POST['WPLANG'];
} elseif ( current_user_can( 'install_languages' ) ) {
} elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
if ( $language ) {
$meta['WPLANG'] = $language;
......@@ -230,14 +230,16 @@ if ( ! empty( $messages ) ) {
$lang = '';
}
wp_dropdown_languages( array(
'name' => 'WPLANG',
'id' => 'site-language',
'selected' => $lang,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ),
) );
wp_dropdown_languages(
array(
'name' => 'WPLANG',
'id' => 'site-language',
'selected' => $lang,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
)
);
?>
</td>
</tr>
......
......@@ -158,7 +158,7 @@ if ( ! empty( $languages ) || ! empty( $translations ) ) {
'selected' => $locale,
'languages' => $languages,
'translations' => $translations,
'show_available_translations' => current_user_can( 'install_languages' ),
'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
) );
// Add note about deprecated WPLANG constant.
......
......@@ -180,9 +180,11 @@ if ( 'update' == $action ) {
if ( ! empty( $_POST['WPLANG'] ) && current_user_can( 'install_languages' ) ) {
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
$language = wp_download_language_pack( $_POST['WPLANG'] );
if ( $language ) {
$_POST['WPLANG'] = $language;
if ( wp_can_install_language_pack() ) {
$language = wp_download_language_pack( $_POST['WPLANG'] );
if ( $language ) {
$_POST['WPLANG'] = $language;
}
}
}
}
......
......@@ -432,15 +432,7 @@ function map_meta_cap( $cap, $user_id ) {
break;
case 'install_languages':
case 'update_languages':
if ( ! function_exists( 'request_filesystem_credentials' ) ) {
require_once( ABSPATH . 'wp-admin/includes/file.php' );
}
if ( ! function_exists( 'wp_can_install_language_pack' ) ) {
require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
}
if ( ! wp_can_install_language_pack() ) {
if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {
$caps[] = 'do_not_allow';
} elseif ( is_multisite() && ! is_super_admin( $user_id ) ) {
$caps[] = 'do_not_allow';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment