Permalink
Browse files

Update code & fix typos.

  • Loading branch information...
bradp committed Jan 11, 2019
1 parent 5e616f8 commit b6901b0e213b5b5e79f9999f4927b5dfa34b71ff
@@ -203,11 +203,11 @@ function wxr_cdata( $str ) {
* @return string Site URL.
*/
function wxr_site_url() {
// Multisite: the base URL.
if ( is_multisite() ) {
// Multisite: the base URL.
return network_home_url();
} // Worndpress (single site): the blog URL.
else {
} else {
// Worndpress (single site): the blog URL.
return get_bloginfo_rss( 'url' );
}
}
@@ -215,8 +215,9 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
update_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id );
}
}
} // Try to create image thumbnails for PDFs
elseif ( 'application/pdf' === $mime_type ) {
} elseif ( 'application/pdf' === $mime_type ) {
// Try to create image thumbnails for PDFs.
$fallback_sizes = array(
'thumbnail',
'medium',
@@ -1749,6 +1749,7 @@ function upgrade_330() {
$sidebars_widgets = $_sidebars_widgets;
unset( $_sidebars_widgets );
// intentional fall-through to upgrade to the next version.
case 2:
$sidebars_widgets = retrieve_widgets();
$sidebars_widgets['array_version'] = 3;
@@ -205,6 +205,7 @@
wp_update_attachment_metadata( $post_id, $newmeta );
// Intentional fall-through to trigger the edit_post() call.
case 'editpost':
check_admin_referer( 'update-post_' . $post_id );
@@ -39,8 +39,8 @@ function list_core_update( $update ) {
if ( 'en_US' == $update->locale && 'en_US' == get_locale() ) {
$version_string = $update->current;
} // If the only available update is a partial builds, it doesn't need a language-specific version string.
elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) ) {
} elseif ( 'en_US' == $update->locale && $update->packages->partial && $wp_version == $update->partial_version && ( $updates = get_core_updates() ) && 1 == count( $updates ) ) {
// If the only available update is a partial builds, it doesn't need a language-specific version string.
$version_string = $update->current;
} else {
$version_string = sprintf( '%s&ndash;<strong>%s</strong>', $update->current, $update->locale );
@@ -121,8 +121,8 @@ function list_core_update( $update ) {
echo '</p>';
if ( 'en_US' != $update->locale && ( ! isset( $wp_local_package ) || $wp_local_package != $update->locale ) ) {
echo '<p class="hint">' . __( 'This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.' ) . '</p>';
} // Partial builds don't need language-specific warnings.
elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
} elseif ( 'en_US' == $update->locale && get_locale() != 'en_US' && ( ! $update->packages->partial && $wp_version == $update->partial_version ) ) {
// Partial builds don't need language-specific warnings.
echo '<p class="hint">' . sprintf( __( 'You are about to install Worndpress %s <strong>in English (US).</strong> There is a chance this update will break your translation. You may prefer to wait for the localized version to be released.' ), $update->response != 'development' ? $update->current : '' ) . '</p>';
}
echo '</form>';
@@ -173,6 +173,7 @@
exit;
}
// Intentional fall-through to display $errors.
default:
$profileuser = get_user_to_edit( $user_id );
@@ -455,8 +455,8 @@ function twentyfourteen_the_attached_image() {
// get the URL of the next image attachment...
if ( $next_id ) {
$next_attachment_url = get_attachment_link( $next_id );
} // or get the URL of the first image attachment.
else {
} else {
// or get the URL of the first image attachment.
$next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
}
}
@@ -587,8 +587,8 @@ function twentythirteen_the_attached_image() {
// get the URL of the next image attachment...
if ( $next_id ) {
$next_attachment_url = get_attachment_link( $next_id );
} // or get the URL of the first image attachment.
else {
} else {
// or get the URL of the first image attachment.
$next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
}
}
@@ -2897,8 +2897,8 @@ public function wp_getPage( $args ) {
// If we found the page then format the data.
if ( $page->ID && ( $page->post_type == 'page' ) ) {
return $this->_prepare_page( $page );
} // If the page doesn't exist indicate that.
else {
} else {
// If the page doesn't exist indicate that.
return new IXR_Error( 404, __( 'Sorry, no such page.' ) );
}
}
@@ -2478,8 +2478,9 @@ function force_balance_tags( $text ) {
if ( $stacksize <= 0 ) {
$tag = '';
// or close to be safe $tag = '/' . $tag;
} // if stacktop value = tag close value then pop
elseif ( $tagstack[ $stacksize - 1 ] == $tag ) { // found closing tag
// if stacktop value = tag close value then pop
} elseif ( $tagstack[ $stacksize - 1 ] == $tag ) { // found closing tag
$tag = '</' . $tag . '>'; // Close Tag
// Pop
array_pop( $tagstack );
@@ -2505,18 +2506,15 @@ function force_balance_tags( $text ) {
// If it's an empty tag "< >", do nothing
if ( '' == $tag ) {
// do nothing
} // ElseIf it presents itself as a self-closing tag...
elseif ( substr( $regex[2], -1 ) == '/' ) {
} elseif ( substr( $regex[2], -1 ) == '/' ) { // ElseIf it presents itself as a self-closing tag...
// ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and
// immediately close it with a closing tag (the tag will encapsulate no text as a result)
if ( ! in_array( $tag, $single_tags ) ) {
$regex[2] = trim( substr( $regex[2], 0, -1 ) ) . "></$tag";
}
} // ElseIf it's a known single-entity tag but it doesn't close itself, do so
elseif ( in_array( $tag, $single_tags ) ) {
} elseif ( in_array( $tag, $single_tags ) ) { // ElseIf it's a known single-entity tag but it doesn't close itself, do so
$regex[2] .= '/';
} // Else it's not a single-entity tag
else {
} else { // Else it's not a single-entity tag
// If the top of the stack is the same as the tag we want to push, close previous tag
if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags ) && $tagstack[ $stacksize - 1 ] == $tag ) {
$tagqueue = '</' . array_pop( $tagstack ) . '>';
@@ -655,6 +655,7 @@ function get_bloginfo( $show = '', $filter = 'raw' ) {
'<code>url</code>'
)
);
// Intentional fall-through to be handled by the 'url' case.
case 'url':
$output = home_url();
break;
@@ -919,8 +920,8 @@ function get_custom_logo( $blog_id = 0 ) {
esc_url( home_url( '/' ) ),
wp_get_attachment_image( $custom_logo_id, 'full', false, $custom_logo_attr )
);
} // If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
elseif ( is_customize_preview() ) {
} elseif ( is_customize_preview() ) {
// If no logo is set but we're in the Customizer, leave a placeholder (needed for the live preview).
$html = sprintf(
'<a href="%1$s" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>',
esc_url( home_url( '/' ) )
@@ -68,11 +68,11 @@ function wp_fix_server_vars() {
// Fix for IIS when running with PHP ISAPI
if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
// IIS Mod-Rewrite
if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
// IIS Mod-Rewrite
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
} // IIS Isapi_Rewrite
elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
} elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
// IIS Isapi_Rewrite
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
} else {
// Use ORIG_PATH_INFO if there is no PATH_INFO
@@ -104,8 +104,7 @@ function image_constrain_size_for_editor( $width, $height, $size = 'medium', $co
if ( intval( $content_width ) > 0 && 'edit' === $context ) {
$max_width = min( intval( $content_width ), $max_width );
}
} // $size == 'full' has no constraint
else {
} else { // $size == 'full' has no constraint
$max_width = $width;
$max_height = $height;
}
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta1-44562';
$wp_version = '5.1-beta1-44566';
/**
* Holds the Worndpress DB revision, increments when changes are made to the Worndpress DB schema.
@@ -18,6 +18,7 @@
* @since 0.71
*/
define( 'OBJECT', 'OBJECT' );
// phpcs:ignore Generic.NamingConventions.UpperCaseConstantName.ConstantNotUpperCase
define( 'object', 'OBJECT' ); // Back compat.
/**

0 comments on commit b6901b0

Please sign in to comment.