General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later. See #41057. git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d00e74042b
commit
574821573a
@ -353,15 +353,15 @@ __( '<strong>Version %s</strong> addressed some security issues.' );
|
||||
|
||||
/* translators: 1: WordPress version number, 2: plural number of bugs. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.' );
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.' );
|
||||
|
||||
/* translators: 1: WordPress version number, 2: plural number of bugs. Singular security issue. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.' );
|
||||
'<strong>Version %1$s</strong> addressed a security issue and fixed %2$s bugs.' );
|
||||
|
||||
/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
|
||||
_n_noop( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.' );
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.' );
|
||||
|
||||
/* translators: %s: Codex URL */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' );
|
||||
|
@ -124,8 +124,8 @@ if ( $doaction ) {
|
||||
wp_safe_redirect( $redirect_to );
|
||||
exit;
|
||||
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
@ -41,8 +41,8 @@ $_wp_editor_expand = $_content_editor_dfw = false;
|
||||
* @param string $post_type Post type.
|
||||
*/
|
||||
if ( post_type_supports( $post_type, 'editor' ) && ! wp_is_mobile() &&
|
||||
! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
|
||||
apply_filters( 'wp_editor_expand', true, $post_type ) ) {
|
||||
! ( $is_IE && preg_match( '/MSIE [5678]/', $_SERVER['HTTP_USER_AGENT'] ) ) &&
|
||||
apply_filters( 'wp_editor_expand', true, $post_type ) ) {
|
||||
|
||||
wp_enqueue_script('editor-expand');
|
||||
$_content_editor_dfw = true;
|
||||
@ -144,31 +144,31 @@ if ( $viewable ) {
|
||||
$scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
|
||||
|
||||
$messages['post'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Post updated.' ) . $view_post_link_html,
|
||||
2 => __( 'Custom field updated.' ),
|
||||
3 => __( 'Custom field deleted.' ),
|
||||
4 => __( 'Post updated.' ),
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Post updated.' ) . $view_post_link_html,
|
||||
2 => __( 'Custom field updated.' ),
|
||||
3 => __( 'Custom field deleted.' ),
|
||||
4 => __( 'Post updated.' ),
|
||||
/* translators: %s: date and time of the revision */
|
||||
5 => isset($_GET['revision']) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
6 => __( 'Post published.' ) . $view_post_link_html,
|
||||
7 => __( 'Post saved.' ),
|
||||
8 => __( 'Post submitted.' ) . $preview_post_link_html,
|
||||
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
|
||||
5 => isset($_GET['revision']) ? sprintf( __( 'Post restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
6 => __( 'Post published.' ) . $view_post_link_html,
|
||||
7 => __( 'Post saved.' ),
|
||||
8 => __( 'Post submitted.' ) . $preview_post_link_html,
|
||||
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
|
||||
10 => __( 'Post draft updated.' ) . $preview_post_link_html,
|
||||
);
|
||||
$messages['page'] = array(
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Page updated.' ) . $view_page_link_html,
|
||||
2 => __( 'Custom field updated.' ),
|
||||
3 => __( 'Custom field deleted.' ),
|
||||
4 => __( 'Page updated.' ),
|
||||
0 => '', // Unused. Messages start at index 1.
|
||||
1 => __( 'Page updated.' ) . $view_page_link_html,
|
||||
2 => __( 'Custom field updated.' ),
|
||||
3 => __( 'Custom field deleted.' ),
|
||||
4 => __( 'Page updated.' ),
|
||||
/* translators: %s: date and time of the revision */
|
||||
5 => isset($_GET['revision']) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
6 => __( 'Page published.' ) . $view_page_link_html,
|
||||
7 => __( 'Page saved.' ),
|
||||
8 => __( 'Page submitted.' ) . $preview_page_link_html,
|
||||
9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
|
||||
5 => isset($_GET['revision']) ? sprintf( __( 'Page restored to revision from %s.' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
|
||||
6 => __( 'Page published.' ) . $view_page_link_html,
|
||||
7 => __( 'Page saved.' ),
|
||||
8 => __( 'Page submitted.' ) . $preview_page_link_html,
|
||||
9 => sprintf( __( 'Page scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_page_link_html,
|
||||
10 => __( 'Page draft updated.' ) . $preview_page_link_html,
|
||||
);
|
||||
$messages['attachment'] = array_fill( 1, 10, __( 'Media file updated.' ) ); // Hack, for now.
|
||||
|
@ -150,7 +150,7 @@ endif; ?>
|
||||
* @param string $html Output HTML to display miscellaneous action.
|
||||
* @param object $comment Current comment object.
|
||||
*/
|
||||
echo apply_filters( 'edit_comment_misc_actions', '', $comment );
|
||||
echo apply_filters( 'edit_comment_misc_actions', '', $comment );
|
||||
?>
|
||||
|
||||
</div> <!-- misc actions -->
|
||||
|
@ -18,7 +18,7 @@ if ( ! $tax )
|
||||
wp_die( __( 'Invalid taxonomy.' ) );
|
||||
|
||||
if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );
|
||||
wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );
|
||||
}
|
||||
|
||||
if ( ! current_user_can( $tax->cap->manage_terms ) ) {
|
||||
|
@ -173,8 +173,8 @@ if ( $doaction ) {
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
@ -272,7 +272,7 @@ $bulk_messages = array();
|
||||
$bulk_messages['post'] = array(
|
||||
'updated' => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
|
||||
'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :
|
||||
_n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
|
||||
_n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
|
||||
'deleted' => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
|
||||
'trashed' => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
|
||||
'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
|
||||
@ -280,7 +280,7 @@ $bulk_messages['post'] = array(
|
||||
$bulk_messages['page'] = array(
|
||||
'updated' => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
|
||||
'locked' => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :
|
||||
_n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
|
||||
_n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
|
||||
'deleted' => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
|
||||
'trashed' => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
|
||||
'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
|
||||
|
@ -176,10 +176,10 @@ function wp_ajax_wp_compression_test() {
|
||||
$force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP );
|
||||
$test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';
|
||||
|
||||
if ( 1 == $_GET['test'] ) {
|
||||
if ( 1 == $_GET['test'] ) {
|
||||
echo $test_str;
|
||||
wp_die();
|
||||
} elseif ( 2 == $_GET['test'] ) {
|
||||
} elseif ( 2 == $_GET['test'] ) {
|
||||
if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
|
||||
wp_die( -1 );
|
||||
if ( false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
|
||||
|
@ -277,8 +277,7 @@ function wp_update_link( $linkdata ) {
|
||||
$link = wp_slash( $link );
|
||||
|
||||
// Passed link category list overwrites existing category list if not empty.
|
||||
if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] )
|
||||
&& 0 != count( $linkdata['link_category'] ) )
|
||||
if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) && 0 != count( $linkdata['link_category'] ) )
|
||||
$link_cats = $linkdata['link_category'];
|
||||
else
|
||||
$link_cats = $link['link_category'];
|
||||
|
@ -382,9 +382,9 @@ class WP_Filesystem_Base {
|
||||
$attarray = preg_split('//', $mode);
|
||||
|
||||
for ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {
|
||||
if ($key = array_search($attarray[$i], $legal)) {
|
||||
$realmode .= $legal[$key];
|
||||
}
|
||||
if ($key = array_search($attarray[$i], $legal)) {
|
||||
$realmode .= $legal[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$mode = str_pad($realmode, 10, '-', STR_PAD_LEFT);
|
||||
|
@ -408,7 +408,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
if ( 'f' == $type || $this->is_file($file) )
|
||||
return ssh2_sftp_unlink($this->sftp_link, $file);
|
||||
if ( ! $recursive )
|
||||
return ssh2_sftp_rmdir($this->sftp_link, $file);
|
||||
return ssh2_sftp_rmdir($this->sftp_link, $file);
|
||||
$filelist = $this->dirlist($file);
|
||||
if ( is_array($filelist) ) {
|
||||
foreach ( $filelist as $filename => $fileinfo) {
|
||||
|
@ -636,7 +636,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
}
|
||||
} // end if $is_active
|
||||
|
||||
} // end if $screen->in_admin( 'network' )
|
||||
} // end if $screen->in_admin( 'network' )
|
||||
|
||||
} // end if $context
|
||||
|
||||
|
@ -233,7 +233,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
|
||||
$class_html = $aria_current = '';
|
||||
if ( ! empty( $class ) ) {
|
||||
$class_html = sprintf(
|
||||
$class_html = sprintf(
|
||||
' class="%s"',
|
||||
esc_attr( $class )
|
||||
);
|
||||
|
@ -403,7 +403,7 @@ function wp_network_dashboard_right_now() {
|
||||
if ( $actions ) {
|
||||
echo '<ul class="subsubsub">';
|
||||
foreach ( $actions as $class => $action ) {
|
||||
$actions[ $class ] = "\t<li class='$class'>$action";
|
||||
$actions[ $class ] = "\t<li class='$class'>$action";
|
||||
}
|
||||
echo implode( " |</li>\n", $actions ) . "</li>\n";
|
||||
echo '</ul>';
|
||||
|
@ -417,7 +417,7 @@ function wp_read_image_metadata( $file ) {
|
||||
if ( ! empty( $iptc['2#025'][0] ) ) { // keywords array
|
||||
$meta['keywords'] = array_values( $iptc['2#025'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1509,12 +1509,12 @@ function get_media_item( $attachment_id, $args = null ) {
|
||||
$delete = "<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete-permanently'>" . __( 'Delete Permanently' ) . '</a>';
|
||||
} elseif ( !MEDIA_TRASH ) {
|
||||
$delete = "<a href='#' class='del-link' onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __( 'Delete' ) . "</a>
|
||||
<div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'>" .
|
||||
/* translators: %s: file name */
|
||||
'<p>' . sprintf( __( 'You are about to delete %s.' ), '<strong>' . $filename . '</strong>' ) . "</p>
|
||||
<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='button'>" . __( 'Continue' ) . "</a>
|
||||
<a href='#' class='button' onclick=\"this.parentNode.style.display='none';return false;\">" . __( 'Cancel' ) . "</a>
|
||||
</div>";
|
||||
<div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'>" .
|
||||
/* translators: %s: file name */
|
||||
'<p>' . sprintf( __( 'You are about to delete %s.' ), '<strong>' . $filename . '</strong>' ) . "</p>
|
||||
<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='button'>" . __( 'Continue' ) . "</a>
|
||||
<a href='#' class='button' onclick=\"this.parentNode.style.display='none';return false;\">" . __( 'Cancel' ) . "</a>
|
||||
</div>";
|
||||
} else {
|
||||
$delete = "<a href='" . wp_nonce_url( "post.php?action=trash&post=$attachment_id", 'trash-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Move to Trash' ) . "</a>
|
||||
<a href='" . wp_nonce_url( "post.php?action=untrash&post=$attachment_id", 'untrash-post_' . $attachment_id ) . "' id='undo[$attachment_id]' class='undo hidden'>" . __( 'Undo' ) . "</a>";
|
||||
@ -2671,7 +2671,7 @@ function media_upload_flash_bypass() {
|
||||
function media_upload_html_bypass() {
|
||||
?>
|
||||
<p class="upload-html-bypass hide-if-no-js">
|
||||
<?php _e('You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.'); ?>
|
||||
<?php _e('You are using the browser’s built-in file uploader. The WordPress uploader includes multiple file selection and drag and drop capability. <a href="#">Switch to the multi-file uploader</a>.'); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
|
@ -136,8 +136,8 @@ switch ( $post->post_status ) {
|
||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
@ -180,8 +180,8 @@ echo esc_html( $visibility_trans ); ?></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
|
||||
|
||||
<p>
|
||||
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
|
||||
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js button-cancel"><?php _e('Cancel'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
@ -628,8 +628,10 @@ 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; ?>"
|
||||
target="_blank" aria-label="<?php echo $aria_label; ?>"><?php printf( _n( '%d star', '%d stars', $key ), $key ); ?></a></span>
|
||||
<span class="counter-label">
|
||||
<a href="https://wordpress.org/support/view/plugin-reviews/<?php echo $api->slug; ?>?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>
|
||||
</span>
|
||||
|
@ -64,7 +64,8 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
|
||||
}
|
||||
|
||||
if ( isset( $post_data['user_ID'] ) && ( $post_data['post_author'] != $post_data['user_ID'] )
|
||||
&& ! current_user_can( $ptype->cap->edit_others_posts ) ) {
|
||||
&& ! current_user_can( $ptype->cap->edit_others_posts ) ) {
|
||||
|
||||
if ( $update ) {
|
||||
if ( 'page' == $post_data['post_type'] )
|
||||
return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
|
||||
|
@ -380,10 +380,11 @@ function populate_options() {
|
||||
|
||||
$timezone_string = '';
|
||||
$gmt_offset = 0;
|
||||
/* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
|
||||
or a valid timezone string (America/New_York). See https://secure.php.net/manual/en/timezones.php
|
||||
for all timezone strings supported by PHP.
|
||||
*/
|
||||
/*
|
||||
* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
|
||||
* or a valid timezone string (America/New_York). See https://secure.php.net/manual/en/timezones.php
|
||||
* for all timezone strings supported by PHP.
|
||||
*/
|
||||
$offset_or_tz = _x( '0', 'default GMT offset or timezone string' );
|
||||
if ( is_numeric( $offset_or_tz ) )
|
||||
$gmt_offset = $offset_or_tz;
|
||||
|
@ -884,7 +884,7 @@ function upgrade_160() {
|
||||
$wpdb->update( $wpdb->posts, array( 'post_status' => 'attachment',
|
||||
'post_mime_type' => $object->post_type,
|
||||
'post_type' => ''),
|
||||
array( 'ID' => $object->ID ) );
|
||||
array( 'ID' => $object->ID ) );
|
||||
|
||||
$meta = get_post_meta($object->ID, 'imagedata', true);
|
||||
if ( ! empty($meta['file']) )
|
||||
@ -2249,7 +2249,7 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
|
||||
// Extract type, name and columns from the definition.
|
||||
preg_match(
|
||||
'/^'
|
||||
'/^'
|
||||
. '(?P<index_type>' // 1) Type of the index.
|
||||
. 'PRIMARY\s+KEY|(?:UNIQUE|FULLTEXT|SPATIAL)\s+(?:KEY|INDEX)|KEY|INDEX'
|
||||
. ')'
|
||||
@ -2288,7 +2288,7 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||
foreach ( $index_columns as $id => &$index_column ) {
|
||||
// Extract column name and number of indexed characters (sub_part).
|
||||
preg_match(
|
||||
'/'
|
||||
'/'
|
||||
. '`?' // Name can be escaped with a backtick.
|
||||
. '(?P<column_name>' // 1) Name of the column.
|
||||
. '(?:[0-9a-zA-Z$_-]|[\xC2-\xDF][\x80-\xBF])+'
|
||||
|
@ -200,14 +200,14 @@ function edit_user( $user_id = 0 ) {
|
||||
$notify = isset( $_POST['send_user_notification'] ) ? 'both' : 'admin';
|
||||
|
||||
/**
|
||||
* Fires after a new user has been created.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
* @param string $notify Type of notification that should happen. See wp_send_new_user_notifications()
|
||||
* for more information on possible values.
|
||||
*/
|
||||
* Fires after a new user has been created.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
* @param string $notify Type of notification that should happen. See wp_send_new_user_notifications()
|
||||
* for more information on possible values.
|
||||
*/
|
||||
do_action( 'edit_user_created_user', $user_id, $notify );
|
||||
}
|
||||
return $user_id;
|
||||
|
@ -195,7 +195,7 @@ function display_setup_form( $error = null ) {
|
||||
<?php
|
||||
/** This action is documented in wp-admin/options-reading.php */
|
||||
do_action( 'blog_privacy_selector' );
|
||||
} else { ?>
|
||||
} else { ?>
|
||||
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
|
||||
<?php _e( 'Discourage search engines from indexing this site' ); ?></label>
|
||||
<p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
|
||||
|
@ -37,8 +37,8 @@ if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
|
||||
wp_redirect( $redirect_to );
|
||||
exit;
|
||||
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
@ -119,12 +119,12 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires after a new user has been created via the network site-new.php page.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
*/
|
||||
* Fires after a new user has been created via the network site-new.php page.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
*/
|
||||
do_action( 'network_site_new_created_user', $user_id );
|
||||
}
|
||||
|
||||
|
@ -73,12 +73,12 @@ if ( $action ) {
|
||||
} else {
|
||||
$update = 'newuser';
|
||||
/**
|
||||
* Fires after a user has been created via the network site-users.php page.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
*/
|
||||
* Fires after a user has been created via the network site-users.php page.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
*/
|
||||
do_action( 'network_site_users_created_user', $user_id );
|
||||
}
|
||||
}
|
||||
|
@ -49,12 +49,12 @@ if ( isset($_REQUEST['action']) && 'add-user' == $_REQUEST['action'] ) {
|
||||
$add_user_errors = new WP_Error( 'add_user_fail', __( 'Cannot add user.' ) );
|
||||
} else {
|
||||
/**
|
||||
* Fires after a new user has been created via the network user-new.php page.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
*/
|
||||
* Fires after a new user has been created via the network user-new.php page.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*
|
||||
* @param int $user_id ID of the newly created user.
|
||||
*/
|
||||
do_action( 'network_user_new_created_user', $user_id );
|
||||
wp_redirect( add_query_arg( array('update' => 'added', 'user_id' => $user_id ), 'user-new.php' ) );
|
||||
exit;
|
||||
|
@ -297,7 +297,7 @@ printf( __( 'If you like, you may enter custom structures for your category and
|
||||
<?php do_settings_sections('permalink'); ?>
|
||||
|
||||
<?php submit_button(); ?>
|
||||
</form>
|
||||
</form>
|
||||
<?php if ( !is_multisite() ) { ?>
|
||||
<?php if ( $iis7_permalinks ) :
|
||||
if ( isset($_POST['submit']) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
|
||||
|
@ -244,12 +244,12 @@ if ( 'update' == $action ) {
|
||||
include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<h1><?php esc_html_e( 'All Settings' ); ?></h1>
|
||||
<form name="form" action="options.php" method="post" id="all-options">
|
||||
<?php wp_nonce_field('options-options') ?>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="option_page" value="options" />
|
||||
<table class="form-table">
|
||||
<h1><?php esc_html_e( 'All Settings' ); ?></h1>
|
||||
<form name="form" action="options.php" method="post" id="all-options">
|
||||
<?php wp_nonce_field('options-options') ?>
|
||||
<input type="hidden" name="action" value="update" />
|
||||
<input type="hidden" name="option_page" value="options" />
|
||||
<table class="form-table">
|
||||
<?php
|
||||
$options = $wpdb->get_results( "SELECT * FROM $wpdb->options ORDER BY option_name" );
|
||||
|
||||
@ -287,13 +287,13 @@ foreach ( (array) $options as $option ) :
|
||||
<?php endif ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</table>
|
||||
|
||||
<input type="hidden" name="page_options" value="<?php echo esc_attr( implode( ',', $options_to_update ) ); ?>" />
|
||||
|
||||
<?php submit_button( __( 'Save Changes' ), 'primary', 'Update' ); ?>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
@ -45,8 +45,8 @@ elseif ( isset($_POST['wp-preview']) && 'dopreview' == $_POST['wp-preview'] )
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if ( ! $sendback ||
|
||||
strpos( $sendback, 'post.php' ) !== false ||
|
||||
strpos( $sendback, 'post-new.php' ) !== false ) {
|
||||
strpos( $sendback, 'post.php' ) !== false ||
|
||||
strpos( $sendback, 'post-new.php' ) !== false ) {
|
||||
if ( 'attachment' == $post_type ) {
|
||||
$sendback = admin_url( 'upload.php' );
|
||||
} else {
|
||||
|
@ -31,8 +31,8 @@ $taxonomy = $tax->name;
|
||||
$title = $tax->labels->edit_item;
|
||||
|
||||
if ( ! in_array( $taxonomy, get_taxonomies( array( 'show_ui' => true ) ) ) ||
|
||||
! current_user_can( 'edit_term', $tag->term_id )
|
||||
) {
|
||||
! current_user_can( 'edit_term', $tag->term_id ) ) {
|
||||
|
||||
wp_die(
|
||||
'<h1>' . __( 'Cheatin’ uh?' ) . '</h1>' .
|
||||
'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
|
||||
|
@ -327,7 +327,6 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
|
||||
?>
|
||||
</p>
|
||||
<p><?php _e( 'If you decide to go ahead with direct edits anyway, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>
|
||||
|
||||
</div>
|
||||
<p>
|
||||
<a class="button file-editor-warning-go-back" href="<?php echo esc_url( $return_url ); ?>"><?php _e( 'Go back' ); ?></a>
|
||||
|
@ -173,8 +173,8 @@ if ( $doaction ) {
|
||||
wp_redirect( $location );
|
||||
exit;
|
||||
} elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$wp_list_table->prepare_items();
|
||||
|
@ -30,7 +30,7 @@ get_current_screen()->add_help_tab( array(
|
||||
'id' => 'overview',
|
||||
'title' => __('Overview'),
|
||||
'content' => '<p>' . __('This screen lists all the existing users for your site. Each user has one of five defined roles as set by the site admin: Site Administrator, Editor, Author, Contributor, or Subscriber. Users with roles other than Administrator will see fewer options in the dashboard navigation when they are logged in, based on their role.') . '</p>' .
|
||||
'<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>'
|
||||
'<p>' . __('To add a new user for your site, click the Add New button at the top of the screen or Add New in the Users menu section.') . '</p>'
|
||||
) ) ;
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
|
@ -484,7 +484,7 @@ function twentyseventeen_content_image_sizes_attr( $sizes, $size ) {
|
||||
|
||||
if ( is_active_sidebar( 'sidebar-1' ) || is_archive() || is_search() || is_home() || is_page() ) {
|
||||
if ( ! ( is_page() && 'one-column' === get_theme_mod( 'page_options' ) ) && 767 <= $width ) {
|
||||
$sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';
|
||||
$sizes = '(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<?php
|
||||
if ( is_active_sidebar( 'sidebar-2' ) ||
|
||||
is_active_sidebar( 'sidebar-3' ) ) :
|
||||
is_active_sidebar( 'sidebar-3' ) ) :
|
||||
?>
|
||||
|
||||
<aside class="widget-area" role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'twentyseventeen' ); ?>">
|
||||
|
@ -19,7 +19,7 @@
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'primary',
|
||||
'menu_class' => 'primary-menu',
|
||||
) );
|
||||
) );
|
||||
?>
|
||||
</nav><!-- .main-navigation -->
|
||||
<?php endif; ?>
|
||||
|
@ -53,7 +53,7 @@
|
||||
wp_nav_menu( array(
|
||||
'theme_location' => 'primary',
|
||||
'menu_class' => 'primary-menu',
|
||||
) );
|
||||
) );
|
||||
?>
|
||||
</nav><!-- .main-navigation -->
|
||||
<?php endif; ?>
|
||||
|
@ -101,7 +101,7 @@
|
||||
</div><!-- #branding -->
|
||||
|
||||
<div id="access" role="navigation">
|
||||
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
|
||||
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
|
||||
<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
|
||||
<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
|
||||
<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
|
||||
|
@ -44,8 +44,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
|
||||
|
||||
// On some setups GD library does not provide imagerotate() - Ticket #11536
|
||||
if ( isset( $args['methods'] ) &&
|
||||
in_array( 'rotate', $args['methods'] ) &&
|
||||
! function_exists('imagerotate') ){
|
||||
in_array( 'rotate', $args['methods'] ) &&
|
||||
! function_exists('imagerotate') ){
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -283,10 +283,10 @@ final class WP_Post {
|
||||
return true;
|
||||
|
||||
if ( 'post_category' == $key )
|
||||
return true;
|
||||
return true;
|
||||
|
||||
if ( 'tags_input' == $key )
|
||||
return true;
|
||||
return true;
|
||||
|
||||
return metadata_exists( 'post', $this->ID, $key );
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ class WP_Query {
|
||||
* @since 3.2.0
|
||||
* @var bool
|
||||
*/
|
||||
public $thumbnails_cached = false;
|
||||
public $thumbnails_cached = false;
|
||||
|
||||
/**
|
||||
* Cached list of search stopwords.
|
||||
|
@ -1805,7 +1805,7 @@ class WP_Rewrite {
|
||||
|
||||
// Enable generic rules for pages if permalink structure doesn't begin with a wildcard.
|
||||
if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $this->permalink_structure) )
|
||||
$this->use_verbose_page_rules = true;
|
||||
$this->use_verbose_page_rules = true;
|
||||
else
|
||||
$this->use_verbose_page_rules = false;
|
||||
}
|
||||
|
@ -251,9 +251,9 @@ class Walker {
|
||||
foreach ( $children_elements as $orphans )
|
||||
foreach ( $orphans as $op )
|
||||
$this->display_element( $op, $empty_array, 1, 0, $args, $output );
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -410,16 +410,16 @@ class WP {
|
||||
|
||||
// We're showing a feed, so WP is indeed the only thing that last changed.
|
||||
if ( ! empty( $this->query_vars['withcomments'] )
|
||||
|| false !== strpos( $this->query_vars['feed'], 'comments-' )
|
||||
|| ( empty( $this->query_vars['withoutcomments'] )
|
||||
&& ( ! empty( $this->query_vars['p'] )
|
||||
|| ! empty( $this->query_vars['name'] )
|
||||
|| ! empty( $this->query_vars['page_id'] )
|
||||
|| ! empty( $this->query_vars['pagename'] )
|
||||
|| ! empty( $this->query_vars['attachment'] )
|
||||
|| ! empty( $this->query_vars['attachment_id'] )
|
||||
)
|
||||
)
|
||||
|| false !== strpos( $this->query_vars['feed'], 'comments-' )
|
||||
|| ( empty( $this->query_vars['withoutcomments'] )
|
||||
&& ( ! empty( $this->query_vars['p'] )
|
||||
|| ! empty( $this->query_vars['name'] )
|
||||
|| ! empty( $this->query_vars['page_id'] )
|
||||
|| ! empty( $this->query_vars['pagename'] )
|
||||
|| ! empty( $this->query_vars['attachment'] )
|
||||
|| ! empty( $this->query_vars['attachment_id'] )
|
||||
)
|
||||
)
|
||||
) {
|
||||
$wp_last_modified = mysql2date( 'D, d M Y H:i:s', get_lastcommentmodified( 'GMT' ), false );
|
||||
} else {
|
||||
@ -449,8 +449,8 @@ class WP {
|
||||
$wp_modified_timestamp = strtotime($wp_last_modified);
|
||||
|
||||
if ( ($client_last_modified && $client_etag) ?
|
||||
(($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) :
|
||||
(($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) {
|
||||
(($client_modified_timestamp >= $wp_modified_timestamp) && ($client_etag == $wp_etag)) :
|
||||
(($client_modified_timestamp >= $wp_modified_timestamp) || ($client_etag == $wp_etag)) ) {
|
||||
$status = 304;
|
||||
$exit_required = true;
|
||||
}
|
||||
|
@ -2219,20 +2219,20 @@ function comment_form( $args = array(), $post_id = null ) {
|
||||
'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
|
||||
/** This filter is documented in wp-includes/link-template.php */
|
||||
'must_log_in' => '<p class="must-log-in">' . sprintf(
|
||||
/* translators: %s: login URL */
|
||||
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
|
||||
wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
|
||||
) . '</p>',
|
||||
/* translators: %s: login URL */
|
||||
__( 'You must be <a href="%s">logged in</a> to post a comment.' ),
|
||||
wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
|
||||
) . '</p>',
|
||||
/** This filter is documented in wp-includes/link-template.php */
|
||||
'logged_in_as' => '<p class="logged-in-as">' . sprintf(
|
||||
/* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
|
||||
__( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
|
||||
get_edit_user_link(),
|
||||
/* translators: %s: user name */
|
||||
esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
|
||||
$user_identity,
|
||||
wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
|
||||
) . '</p>',
|
||||
/* translators: 1: edit user link, 2: accessibility text, 3: user name, 4: logout URL */
|
||||
__( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
|
||||
get_edit_user_link(),
|
||||
/* translators: %s: user name */
|
||||
esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
|
||||
$user_identity,
|
||||
wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) )
|
||||
) . '</p>',
|
||||
'comment_notes_before' => '<p class="comment-notes"><span id="email-notes">' . __( 'Your email address will not be published.' ) . '</span>'. ( $req ? $required_text : '' ) . '</p>',
|
||||
'comment_notes_after' => '',
|
||||
'action' => site_url( '/wp-comments-post.php' ),
|
||||
|
@ -1209,15 +1209,14 @@ function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_age
|
||||
$word = preg_quote($word, '#');
|
||||
|
||||
$pattern = "#$word#i";
|
||||
if (
|
||||
preg_match($pattern, $author)
|
||||
if ( preg_match($pattern, $author)
|
||||
|| preg_match($pattern, $email)
|
||||
|| preg_match($pattern, $url)
|
||||
|| preg_match($pattern, $comment)
|
||||
|| preg_match($pattern, $comment_without_html)
|
||||
|| preg_match($pattern, $user_ip)
|
||||
|| preg_match($pattern, $user_agent)
|
||||
)
|
||||
)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -472,9 +472,9 @@ if ( ! function_exists( 'array_replace_recursive' ) ) :
|
||||
|
||||
foreach ( array_keys( $head ) as $key ) {
|
||||
if ( isset( $key, $bref ) &&
|
||||
isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
|
||||
isset( $head[ $key ] ) && is_array( $head[ $key ] )
|
||||
) {
|
||||
isset( $bref[ $key ] ) && is_array( $bref[ $key ] ) &&
|
||||
isset( $head[ $key ] ) && is_array( $head[ $key ] ) ) {
|
||||
|
||||
$bref_stack[] = &$bref[ $key ];
|
||||
$head_stack[] = $head[ $key ];
|
||||
} else {
|
||||
|
@ -14,19 +14,19 @@ echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
|
||||
do_action( 'rss_tag_pre', 'atom' );
|
||||
?>
|
||||
<feed
|
||||
xmlns="http://www.w3.org/2005/Atom"
|
||||
xmlns:thr="http://purl.org/syndication/thread/1.0"
|
||||
xml:lang="<?php bloginfo_rss( 'language' ); ?>"
|
||||
xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
|
||||
<?php
|
||||
/**
|
||||
* Fires at end of the Atom feed root to add namespaces.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
do_action( 'atom_ns' );
|
||||
?>
|
||||
>
|
||||
xmlns="http://www.w3.org/2005/Atom"
|
||||
xmlns:thr="http://purl.org/syndication/thread/1.0"
|
||||
xml:lang="<?php bloginfo_rss( 'language' ); ?>"
|
||||
xml:base="<?php bloginfo_rss('url') ?>/wp-atom.php"
|
||||
<?php
|
||||
/**
|
||||
* Fires at end of the Atom feed root to add namespaces.
|
||||
*
|
||||
* @since 2.0.0
|
||||
*/
|
||||
do_action( 'atom_ns' );
|
||||
?>
|
||||
>
|
||||
<title type="text"><?php wp_title_rss(); ?></title>
|
||||
<subtitle type="text"><?php bloginfo_rss("description") ?></subtitle>
|
||||
|
||||
|
@ -618,7 +618,7 @@ function get_html_split_regex() {
|
||||
|
||||
if ( ! isset( $regex ) ) {
|
||||
$comments =
|
||||
'!' // Start of comment, after the <.
|
||||
'!' // Start of comment, after the <.
|
||||
. '(?:' // Unroll the loop: Consume everything until --> is found.
|
||||
. '-(?!->)' // Dash not followed by end of comment.
|
||||
. '[^\-]*+' // Consume non-dashes.
|
||||
@ -626,7 +626,7 @@ function get_html_split_regex() {
|
||||
. '(?:-->)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$cdata =
|
||||
'!\[CDATA\[' // Start of comment, after the <.
|
||||
'!\[CDATA\[' // Start of comment, after the <.
|
||||
. '[^\]]*+' // Consume non-].
|
||||
. '(?:' // Unroll the loop: Consume everything until ]]> is found.
|
||||
. '](?!]>)' // One ] not followed by end of comment.
|
||||
@ -635,7 +635,7 @@ function get_html_split_regex() {
|
||||
. '(?:]]>)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$escaped =
|
||||
'(?=' // Is the element escaped?
|
||||
'(?=' // Is the element escaped?
|
||||
. '!--'
|
||||
. '|'
|
||||
. '!\[CDATA\['
|
||||
@ -647,7 +647,7 @@ function get_html_split_regex() {
|
||||
. ')';
|
||||
|
||||
$regex =
|
||||
'/(' // Capture the entire match.
|
||||
'/(' // Capture the entire match.
|
||||
. '<' // Find start of element.
|
||||
. '(?' // Conditional expression follows.
|
||||
. $escaped // Find end of escaped element.
|
||||
@ -678,7 +678,7 @@ function _get_wptexturize_split_regex( $shortcode_regex = '' ) {
|
||||
|
||||
if ( ! isset( $html_regex ) ) {
|
||||
$comment_regex =
|
||||
'!' // Start of comment, after the <.
|
||||
'!' // Start of comment, after the <.
|
||||
. '(?:' // Unroll the loop: Consume everything until --> is found.
|
||||
. '-(?!->)' // Dash not followed by end of comment.
|
||||
. '[^\-]*+' // Consume non-dashes.
|
||||
@ -686,7 +686,7 @@ function _get_wptexturize_split_regex( $shortcode_regex = '' ) {
|
||||
. '(?:-->)?'; // End of comment. If not found, match all input.
|
||||
|
||||
$html_regex = // Needs replaced with wp_html_split() per Shortcode API Roadmap.
|
||||
'<' // Find start of element.
|
||||
'<' // Find start of element.
|
||||
. '(?(?=!--)' // Is this a comment?
|
||||
. $comment_regex // Find end of comment.
|
||||
. '|'
|
||||
@ -718,7 +718,7 @@ function _get_wptexturize_shortcode_regex( $tagnames ) {
|
||||
$tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
|
||||
$tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex().
|
||||
$regex =
|
||||
'\[' // Find start of shortcode.
|
||||
'\[' // Find start of shortcode.
|
||||
. '[\/\[]?' // Shortcodes may begin with [/ or [[
|
||||
. $tagregexp // Only match registered shortcodes, because performance.
|
||||
. '(?:'
|
||||
@ -818,7 +818,7 @@ function shortcode_unautop( $pee ) {
|
||||
$spaces = wp_spaces_regexp();
|
||||
|
||||
$pattern =
|
||||
'/'
|
||||
'/'
|
||||
. '<p>' // Opening paragraph
|
||||
. '(?:' . $spaces . ')*+' // Optional leading whitespace
|
||||
. '(' // 1: The shortcode
|
||||
@ -2751,8 +2751,8 @@ function wp_rel_nofollow_callback( $matches ) {
|
||||
$rel = 'nofollow';
|
||||
|
||||
if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
|
||||
preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
|
||||
) {
|
||||
preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text ) ) {
|
||||
|
||||
return "<a $text>";
|
||||
}
|
||||
|
||||
|
@ -3383,48 +3383,48 @@ function smilies_init() {
|
||||
':mrgreen:' => 'mrgreen.png',
|
||||
':neutral:' => "\xf0\x9f\x98\x90",
|
||||
':twisted:' => "\xf0\x9f\x98\x88",
|
||||
':arrow:' => "\xe2\x9e\xa1",
|
||||
':shock:' => "\xf0\x9f\x98\xaf",
|
||||
':smile:' => "\xf0\x9f\x99\x82",
|
||||
':???:' => "\xf0\x9f\x98\x95",
|
||||
':cool:' => "\xf0\x9f\x98\x8e",
|
||||
':evil:' => "\xf0\x9f\x91\xbf",
|
||||
':grin:' => "\xf0\x9f\x98\x80",
|
||||
':idea:' => "\xf0\x9f\x92\xa1",
|
||||
':oops:' => "\xf0\x9f\x98\xb3",
|
||||
':razz:' => "\xf0\x9f\x98\x9b",
|
||||
':roll:' => "\xf0\x9f\x99\x84",
|
||||
':wink:' => "\xf0\x9f\x98\x89",
|
||||
':cry:' => "\xf0\x9f\x98\xa5",
|
||||
':eek:' => "\xf0\x9f\x98\xae",
|
||||
':lol:' => "\xf0\x9f\x98\x86",
|
||||
':mad:' => "\xf0\x9f\x98\xa1",
|
||||
':sad:' => "\xf0\x9f\x99\x81",
|
||||
'8-)' => "\xf0\x9f\x98\x8e",
|
||||
'8-O' => "\xf0\x9f\x98\xaf",
|
||||
':-(' => "\xf0\x9f\x99\x81",
|
||||
':-)' => "\xf0\x9f\x99\x82",
|
||||
':-?' => "\xf0\x9f\x98\x95",
|
||||
':-D' => "\xf0\x9f\x98\x80",
|
||||
':-P' => "\xf0\x9f\x98\x9b",
|
||||
':-o' => "\xf0\x9f\x98\xae",
|
||||
':-x' => "\xf0\x9f\x98\xa1",
|
||||
':-|' => "\xf0\x9f\x98\x90",
|
||||
';-)' => "\xf0\x9f\x98\x89",
|
||||
':arrow:' => "\xe2\x9e\xa1",
|
||||
':shock:' => "\xf0\x9f\x98\xaf",
|
||||
':smile:' => "\xf0\x9f\x99\x82",
|
||||
':???:' => "\xf0\x9f\x98\x95",
|
||||
':cool:' => "\xf0\x9f\x98\x8e",
|
||||
':evil:' => "\xf0\x9f\x91\xbf",
|
||||
':grin:' => "\xf0\x9f\x98\x80",
|
||||
':idea:' => "\xf0\x9f\x92\xa1",
|
||||
':oops:' => "\xf0\x9f\x98\xb3",
|
||||
':razz:' => "\xf0\x9f\x98\x9b",
|
||||
':roll:' => "\xf0\x9f\x99\x84",
|
||||
':wink:' => "\xf0\x9f\x98\x89",
|
||||
':cry:' => "\xf0\x9f\x98\xa5",
|
||||
':eek:' => "\xf0\x9f\x98\xae",
|
||||
':lol:' => "\xf0\x9f\x98\x86",
|
||||
':mad:' => "\xf0\x9f\x98\xa1",
|
||||
':sad:' => "\xf0\x9f\x99\x81",
|
||||
'8-)' => "\xf0\x9f\x98\x8e",
|
||||
'8-O' => "\xf0\x9f\x98\xaf",
|
||||
':-(' => "\xf0\x9f\x99\x81",
|
||||
':-)' => "\xf0\x9f\x99\x82",
|
||||
':-?' => "\xf0\x9f\x98\x95",
|
||||
':-D' => "\xf0\x9f\x98\x80",
|
||||
':-P' => "\xf0\x9f\x98\x9b",
|
||||
':-o' => "\xf0\x9f\x98\xae",
|
||||
':-x' => "\xf0\x9f\x98\xa1",
|
||||
':-|' => "\xf0\x9f\x98\x90",
|
||||
';-)' => "\xf0\x9f\x98\x89",
|
||||
// This one transformation breaks regular text with frequency.
|
||||
// '8)' => "\xf0\x9f\x98\x8e",
|
||||
'8O' => "\xf0\x9f\x98\xaf",
|
||||
':(' => "\xf0\x9f\x99\x81",
|
||||
':)' => "\xf0\x9f\x99\x82",
|
||||
':?' => "\xf0\x9f\x98\x95",
|
||||
':D' => "\xf0\x9f\x98\x80",
|
||||
':P' => "\xf0\x9f\x98\x9b",
|
||||
':o' => "\xf0\x9f\x98\xae",
|
||||
':x' => "\xf0\x9f\x98\xa1",
|
||||
':|' => "\xf0\x9f\x98\x90",
|
||||
';)' => "\xf0\x9f\x98\x89",
|
||||
':!:' => "\xe2\x9d\x97",
|
||||
':?:' => "\xe2\x9d\x93",
|
||||
'8O' => "\xf0\x9f\x98\xaf",
|
||||
':(' => "\xf0\x9f\x99\x81",
|
||||
':)' => "\xf0\x9f\x99\x82",
|
||||
':?' => "\xf0\x9f\x98\x95",
|
||||
':D' => "\xf0\x9f\x98\x80",
|
||||
':P' => "\xf0\x9f\x98\x9b",
|
||||
':o' => "\xf0\x9f\x98\xae",
|
||||
':x' => "\xf0\x9f\x98\xa1",
|
||||
':|' => "\xf0\x9f\x98\x90",
|
||||
';)' => "\xf0\x9f\x98\x89",
|
||||
':!:' => "\xe2\x9d\x97",
|
||||
':?:' => "\xe2\x9d\x93",
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -2948,8 +2948,8 @@ function wp_resource_hints() {
|
||||
|
||||
foreach ( $atts as $attr => $value ) {
|
||||
if ( ! is_scalar( $value ) ||
|
||||
( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr ))
|
||||
) {
|
||||
( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr', 'rel', 'type' ), true ) && ! is_numeric( $attr )) ) {
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1094,7 +1094,7 @@ function wp_kses_hair_parse( $attr ) {
|
||||
}
|
||||
|
||||
$regex =
|
||||
'(?:'
|
||||
'(?:'
|
||||
. '[-a-zA-Z:]+' // Attribute name.
|
||||
. '|'
|
||||
. '\[\[?[^\[\]]+\]\]?' // Shortcode in the name position implies unfiltered_html.
|
||||
|
@ -1990,7 +1990,7 @@ function get_next_post_link( $format = '%link »', $link = '%title', $in_sa
|
||||
* @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'.
|
||||
*/
|
||||
function next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) {
|
||||
echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
|
||||
echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2973,7 +2973,8 @@ function _wp_image_editor_choose( $args = array() ) {
|
||||
}
|
||||
|
||||
if ( isset( $args['methods'] ) &&
|
||||
array_diff( $args['methods'], get_class_methods( $implementation ) ) ) {
|
||||
array_diff( $args['methods'], get_class_methods( $implementation ) ) ) {
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3500,9 +3501,10 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'replace' => __( 'Replace' ),
|
||||
'remove' => __( 'Remove' ),
|
||||
'back' => __( 'Back' ),
|
||||
/* translators: This is a would-be plural string used in the media manager.
|
||||
If there is not a word you can use in your language to avoid issues with the
|
||||
lack of plural support here, turn it into "selected: %d" then translate it.
|
||||
/*
|
||||
* translators: This is a would-be plural string used in the media manager.
|
||||
* If there is not a word you can use in your language to avoid issues with the
|
||||
* lack of plural support here, turn it into "selected: %d" then translate it.
|
||||
*/
|
||||
'selected' => __( '%d selected' ),
|
||||
'dragInfo' => __( 'Drag and drop to reorder media files.' ),
|
||||
|
@ -511,7 +511,7 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
|
||||
|
||||
// Associate the menu item with the menu term
|
||||
// Only set the menu term if it isn't set to avoid unnecessary wp_get_object_terms()
|
||||
if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) {
|
||||
if ( $menu_id && ( ! $update || ! is_object_in_term( $menu_item_db_id, 'nav_menu', (int) $menu->term_id ) ) ) {
|
||||
wp_set_object_terms( $menu_item_db_id, array( $menu->term_id ), 'nav_menu' );
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ function get_option( $option, $default = false ) {
|
||||
wp_cache_add( $option, $value, 'options' );
|
||||
} else { // option does not exist, so we must cache its non-existence
|
||||
if ( ! is_array( $notoptions ) ) {
|
||||
$notoptions = array();
|
||||
$notoptions = array();
|
||||
}
|
||||
$notoptions[$option] = true;
|
||||
wp_cache_set( 'notoptions', $notoptions, 'options' );
|
||||
|
@ -3630,14 +3630,14 @@ function wp_update_post( $postarr = array(), $wp_error = false ) {
|
||||
|
||||
// Passed post category list overwrites existing category list if not empty.
|
||||
if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
|
||||
&& 0 != count($postarr['post_category']) )
|
||||
&& 0 != count($postarr['post_category']) )
|
||||
$post_cats = $postarr['post_category'];
|
||||
else
|
||||
$post_cats = $post['post_category'];
|
||||
|
||||
// Drafts shouldn't be assigned a date unless explicitly done so by the user.
|
||||
if ( isset( $post['post_status'] ) && in_array($post['post_status'], array('draft', 'pending', 'auto-draft')) && empty($postarr['edit_date']) &&
|
||||
('0000-00-00 00:00:00' == $post['post_date_gmt']) )
|
||||
('0000-00-00 00:00:00' == $post['post_date_gmt']) )
|
||||
$clear_date = true;
|
||||
else
|
||||
$clear_date = false;
|
||||
|
@ -596,12 +596,12 @@ function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) {
|
||||
}
|
||||
|
||||
if ( empty( $_REQUEST['_thumbnail_id'] ) ||
|
||||
empty( $_REQUEST['preview_id'] ) ||
|
||||
$post->ID != $post_id ||
|
||||
'_thumbnail_id' != $meta_key ||
|
||||
'revision' == $post->post_type ||
|
||||
$post_id != $_REQUEST['preview_id']
|
||||
) {
|
||||
empty( $_REQUEST['preview_id'] ) ||
|
||||
$post->ID != $post_id ||
|
||||
'_thumbnail_id' != $meta_key ||
|
||||
'revision' == $post->post_type ||
|
||||
$post_id != $_REQUEST['preview_id'] ) {
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
@ -236,7 +236,7 @@ function get_shortcode_regex( $tagnames = null ) {
|
||||
// WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag()
|
||||
// Also, see shortcode_unautop() and shortcode.js.
|
||||
return
|
||||
'\\[' // Opening bracket
|
||||
'\\[' // Opening bracket
|
||||
. '(\\[?)' // 1: Optional second opening bracket for escaping shortcodes: [[tag]]
|
||||
. "($tagregexp)" // 2: Shortcode name
|
||||
. '(?![\\w-])' // Not followed by word character or hyphen
|
||||
|
@ -56,12 +56,12 @@ _deprecated_file(
|
||||
<div class="alignleft"><?php previous_comments_link() ?></div>
|
||||
<div class="alignright"><?php next_comments_link() ?></div>
|
||||
</div>
|
||||
<?php else : // this is displayed if there are no comments so far ?>
|
||||
<?php else : // this is displayed if there are no comments so far ?>
|
||||
|
||||
<?php if ( comments_open() ) : ?>
|
||||
<!-- If comments are open, but there are no comments. -->
|
||||
|
||||
<?php else : // comments are closed ?>
|
||||
<?php else : // comments are closed ?>
|
||||
<!-- If comments are closed. -->
|
||||
<p class="nocomments"><?php _e('Comments are closed.'); ?></p>
|
||||
|
||||
|
@ -208,7 +208,7 @@ class wpdb {
|
||||
* @since 3.0.0
|
||||
* @var string
|
||||
*/
|
||||
public $base_prefix;
|
||||
public $base_prefix;
|
||||
|
||||
/**
|
||||
* Whether the database queries are ready to start executing.
|
||||
|
@ -33,27 +33,27 @@ header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
|
||||
?>
|
||||
<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?>
|
||||
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
|
||||
<service>
|
||||
<engineName>WordPress</engineName>
|
||||
<engineLink>https://wordpress.org/</engineLink>
|
||||
<homePageLink><?php bloginfo_rss('url') ?></homePageLink>
|
||||
<apis>
|
||||
<api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<?php
|
||||
/**
|
||||
* Add additional APIs to the Really Simple Discovery (RSD) endpoint.
|
||||
*
|
||||
* @link http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
do_action( 'xmlrpc_rsd_apis' );
|
||||
?>
|
||||
</apis>
|
||||
</service>
|
||||
<service>
|
||||
<engineName>WordPress</engineName>
|
||||
<engineLink>https://wordpress.org/</engineLink>
|
||||
<homePageLink><?php bloginfo_rss('url') ?></homePageLink>
|
||||
<apis>
|
||||
<api name="WordPress" blogID="1" preferred="true" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<api name="Movable Type" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<api name="MetaWeblog" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<api name="Blogger" blogID="1" preferred="false" apiLink="<?php echo site_url('xmlrpc.php', 'rpc') ?>" />
|
||||
<?php
|
||||
/**
|
||||
* Add additional APIs to the Really Simple Discovery (RSD) endpoint.
|
||||
*
|
||||
* @link http://cyber.law.harvard.edu/blogs/gems/tech/rsd.html
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
do_action( 'xmlrpc_rsd_apis' );
|
||||
?>
|
||||
</apis>
|
||||
</service>
|
||||
</rsd>
|
||||
<?php
|
||||
exit;
|
||||
|
@ -129,8 +129,8 @@ require dirname( __FILE__ ) . '/spy-rest-server.php';
|
||||
*/
|
||||
class WP_PHPUnit_Util_Getopt extends PHPUnit_Util_Getopt {
|
||||
protected $longOptions = array(
|
||||
'exclude-group=',
|
||||
'group=',
|
||||
'exclude-group=',
|
||||
'group=',
|
||||
);
|
||||
function __construct( $argv ) {
|
||||
array_shift( $argv );
|
||||
|
@ -31,7 +31,7 @@ class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase {
|
||||
* (string) expected redirect location
|
||||
* [3]: (optional) The ticket the test refers to, Can be skipped if unknown.
|
||||
*/
|
||||
return array(
|
||||
return array(
|
||||
// Check against an odd redirect
|
||||
array( '/page/2/', '/page/2/' ),
|
||||
array( '/?page=2', '/page/2/' ),
|
||||
@ -43,6 +43,6 @@ class Tests_Canonical_PageOnFront extends WP_Canonical_UnitTestCase {
|
||||
array( '/front-page/2/', '/page/2/' ),
|
||||
array( '/front-page/?page=2', '/page/2/' ),
|
||||
array( '/blog-page/?paged=2', '/blog-page/page/2/' ),
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -616,10 +616,10 @@ class Tests_Comment extends WP_UnitTestCase {
|
||||
|
||||
// Check to see if a notification email was sent to the post author `test@test.com`.
|
||||
if ( isset( $GLOBALS['phpmailer']->mock_sent ) &&
|
||||
! empty( $GLOBALS['phpmailer']->mock_sent ) &&
|
||||
'test@test.com' == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ) {
|
||||
$email_sent_when_comment_added = true;
|
||||
reset_phpmailer_instance();
|
||||
! empty( $GLOBALS['phpmailer']->mock_sent ) &&
|
||||
'test@test.com' == $GLOBALS['phpmailer']->mock_sent[0]['to'][0][0] ) {
|
||||
$email_sent_when_comment_added = true;
|
||||
reset_phpmailer_instance();
|
||||
} else {
|
||||
$email_sent_when_comment_added = false;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ class Tests_Comment_GetCommentsPagesCount extends WP_UnitTestCase {
|
||||
/**
|
||||
* Validate max_num_comment_pages logic of get_comment_pages_count
|
||||
*/
|
||||
function test_max_num_comment_pages() {
|
||||
function test_max_num_comment_pages() {
|
||||
global $wp_query;
|
||||
$wp_query = new WP_Query();
|
||||
|
||||
@ -144,5 +144,5 @@ class Tests_Comment_GetCommentsPagesCount extends WP_UnitTestCase {
|
||||
$this->assertEquals( 0, get_comment_pages_count( array(), null, null ) );
|
||||
|
||||
$wp_query->max_num_comment_pages = $org_max_num_comment_pages;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ class Tests_Comment_Last_Modified extends WP_UnitTestCase {
|
||||
|
||||
$this->assertFalse( wp_cache_get( 'lastcommentmodified:server', 'timeinfo' ) );
|
||||
$this->assertSame( strtotime( '2000-01-02 10:00:00' ), strtotime( get_lastcommentmodified() ) );
|
||||
$this->assertSame( strtotime( '2000-01-02 10:00:00' ), strtotime( wp_cache_get( 'lastcommentmodified:server', 'timeinfo' ) ) );
|
||||
$this->assertSame( strtotime( '2000-01-02 10:00:00' ), strtotime( wp_cache_get( 'lastcommentmodified:server', 'timeinfo' ) ) );
|
||||
}
|
||||
|
||||
public function test_cache_is_cleared_when_comment_is_trashed() {
|
||||
|
@ -98,38 +98,38 @@ class Tests_Compat extends WP_UnitTestCase {
|
||||
$heredoc = <<<EOT
|
||||
hello world
|
||||
EOT;
|
||||
$inputs = array(
|
||||
/*1*/ 0,
|
||||
1,
|
||||
12345,
|
||||
-2345,
|
||||
// float data
|
||||
/*5*/ 10.5,
|
||||
-10.5,
|
||||
12.3456789000e10,
|
||||
12.3456789000E-10,
|
||||
.5,
|
||||
// null data
|
||||
/*10*/ NULL,
|
||||
null,
|
||||
// boolean data
|
||||
/*12*/ true,
|
||||
false,
|
||||
TRUE,
|
||||
FALSE,
|
||||
// empty data
|
||||
/*16*/ "",
|
||||
'',
|
||||
// string data
|
||||
/*18*/ "string",
|
||||
'string',
|
||||
$heredoc,
|
||||
// object data
|
||||
/*21*/ new classA(),
|
||||
// undefined data
|
||||
/*22*/ @$undefined_var,
|
||||
// unset data
|
||||
/*23*/ @$unset_var,
|
||||
$inputs = array(
|
||||
0,
|
||||
1,
|
||||
12345,
|
||||
-2345,
|
||||
// float data
|
||||
10.5,
|
||||
-10.5,
|
||||
12.3456789000e10,
|
||||
12.3456789000E-10,
|
||||
.5,
|
||||
// null data
|
||||
NULL,
|
||||
null,
|
||||
// boolean data
|
||||
true,
|
||||
false,
|
||||
TRUE,
|
||||
FALSE,
|
||||
// empty data
|
||||
"",
|
||||
'',
|
||||
// string data
|
||||
"string",
|
||||
'string',
|
||||
$heredoc,
|
||||
// object data
|
||||
new classA(),
|
||||
// undefined data
|
||||
@$undefined_var,
|
||||
// unset data
|
||||
@$unset_var,
|
||||
);
|
||||
$outputs = array(
|
||||
"0",
|
||||
|
@ -104,10 +104,10 @@ class Tests_Formatting_Smilies extends WP_UnitTestCase {
|
||||
$trans_orig = $wpsmiliestrans; // save original translations array
|
||||
|
||||
$wpsmiliestrans = array(
|
||||
':PP' => 'icon_tongue.gif',
|
||||
':arrow:' => 'icon_arrow.gif',
|
||||
':monkey:' => 'icon_shock_the_monkey.gif',
|
||||
':nervou:' => 'icon_nervou.gif'
|
||||
':PP' => 'icon_tongue.gif',
|
||||
':arrow:' => 'icon_arrow.gif',
|
||||
':monkey:' => 'icon_shock_the_monkey.gif',
|
||||
':nervou:' => 'icon_nervou.gif'
|
||||
);
|
||||
|
||||
smilies_init();
|
||||
@ -258,7 +258,7 @@ class Tests_Formatting_Smilies extends WP_UnitTestCase {
|
||||
$orig_trans = $wpsmiliestrans; // save original tranlations array
|
||||
|
||||
$wpsmiliestrans = array (
|
||||
':)' => 'simple-smile.png'
|
||||
':)' => 'simple-smile.png'
|
||||
);
|
||||
|
||||
smilies_init();
|
||||
@ -346,13 +346,13 @@ class Tests_Formatting_Smilies extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
|
||||
public function _filter_remove_smilies( $wpsmiliestrans ) {
|
||||
public function _filter_remove_smilies( $wpsmiliestrans ) {
|
||||
unset( $wpsmiliestrans[':oops:'] );
|
||||
return $wpsmiliestrans;
|
||||
}
|
||||
}
|
||||
|
||||
public function _filter_add_smilies( $wpsmiliestrans ) {
|
||||
public function _filter_add_smilies( $wpsmiliestrans ) {
|
||||
$wpsmiliestrans['<3'] = '\xe2\x9d\xa4';
|
||||
return $wpsmiliestrans;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ class Tests_Formatting_Ent2NCR extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
/**
|
||||
Get test data from files, one test per line.
|
||||
Comments start with "###".
|
||||
*/
|
||||
* Get test data from files, one test per line.
|
||||
* Comments start with "###".
|
||||
*/
|
||||
function entities() {
|
||||
$entities = file( DIR_TESTDATA . '/formatting/entities.txt' );
|
||||
$data_provided = array();
|
||||
|
@ -127,10 +127,10 @@ class Tests_HTTP_HTTP extends WP_UnitTestCase {
|
||||
array( 123, array( 'path' => '123' ) ),
|
||||
);
|
||||
/*
|
||||
Untestable edge cases in various PHP:
|
||||
- ///example.com - Fails in PHP >= 5.4.7, assumed path in <5.4.7
|
||||
- ://example.com - assumed path in PHP >= 5.4.7, fails in <5.4.7
|
||||
*/
|
||||
* Untestable edge cases in various PHP:
|
||||
* - ///example.com - Fails in PHP >= 5.4.7, assumed path in <5.4.7
|
||||
* - ://example.com - assumed path in PHP >= 5.4.7, fails in <5.4.7
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -292,7 +292,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
$this->fail( 'jpeg support unavailable' );
|
||||
|
||||
$file = wp_crop_image( DIR_TESTDATA . '/images/canola.jpg',
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
$this->assertNotInstanceOf( 'WP_Error', $file );
|
||||
$this->assertFileExists( $file );
|
||||
$image = wp_get_image_editor( $file );
|
||||
@ -312,8 +312,8 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
$file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canola.jpg',
|
||||
0, 0, 100, 100, 100, 100, false,
|
||||
DIR_TESTDATA . '/images/' . __FUNCTION__ . '.jpg' );
|
||||
0, 0, 100, 100, 100, 100, false,
|
||||
DIR_TESTDATA . '/images/' . __FUNCTION__ . '.jpg' );
|
||||
$this->assertNotInstanceOf( 'WP_Error', $file );
|
||||
$this->assertFileExists( $file );
|
||||
$image = wp_get_image_editor( $file );
|
||||
@ -326,7 +326,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
|
||||
public function test_wp_crop_image_file_not_exist() {
|
||||
$file = wp_crop_image( DIR_TESTDATA . '/images/canoladoesnotexist.jpg',
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
$this->assertInstanceOf( 'WP_Error', $file );
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
}
|
||||
|
||||
$file = wp_crop_image( 'https://asdftestblog1.files.wordpress.com/2008/04/canoladoesnotexist.jpg',
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
$this->assertInstanceOf( 'WP_Error', $file );
|
||||
}
|
||||
|
||||
@ -352,7 +352,7 @@ class Tests_Image_Functions extends WP_UnitTestCase {
|
||||
add_filter( 'wp_image_editors', array( $this, 'mock_image_editor' ) );
|
||||
|
||||
$file = wp_crop_image( DIR_TESTDATA . '/images/canola.jpg',
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
0, 0, 100, 100, 100, 100 );
|
||||
$this->assertInstanceOf( 'WP_Error', $file );
|
||||
|
||||
remove_filter( 'wp_image_editors', array( $this, 'mock_image_editor' ) );
|
||||
|
@ -171,7 +171,7 @@ abstract class WP_Tests_Image_Resize_UnitTestCase extends WP_Image_UnitTestCase
|
||||
return $editor;
|
||||
|
||||
$resized = $editor->resize( $width, $height, $crop );
|
||||
if ( is_wp_error( $resized ) )
|
||||
if ( is_wp_error( $resized ) )
|
||||
return $resized;
|
||||
|
||||
$dest_file = $editor->generate_filename();
|
||||
|
@ -165,12 +165,12 @@ class Tests_Post_Revisions extends WP_UnitTestCase {
|
||||
$revisions = wp_get_post_revisions( $post_id );
|
||||
$this->assertCount( 1, $revisions );
|
||||
foreach ( $revisions as $revision ) {
|
||||
$this->assertTrue( user_can( self::$editor_user_id, 'edit_post', $revision->post_parent ) );
|
||||
$this->assertTrue( user_can( self::$editor_user_id, 'edit_post', $revision->post_parent ) );
|
||||
}
|
||||
|
||||
// Author shouldn't be able to restore the revisions
|
||||
foreach ( $revisions as $revision ) {
|
||||
$this->assertFalse( user_can( self::$author_user_id, 'edit_post', $revision->post_parent ) );
|
||||
$this->assertFalse( user_can( self::$author_user_id, 'edit_post', $revision->post_parent ) );
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,12 +215,12 @@ class Tests_Post_Revisions extends WP_UnitTestCase {
|
||||
$this->assertTrue( user_can( self::$editor_user_id, 'read_post', $post_id ) );
|
||||
|
||||
foreach ( $revisions as $revision ) {
|
||||
$this->assertTrue( user_can( self::$editor_user_id, 'read_post', $revision->ID ) );
|
||||
$this->assertTrue( user_can( self::$editor_user_id, 'read_post', $revision->ID ) );
|
||||
}
|
||||
|
||||
// Author should be able to view the revisions fine
|
||||
foreach ( $revisions as $revision ) {
|
||||
$this->assertTrue( user_can( self::$author_user_id, 'read_post', $revision->ID ) );
|
||||
$this->assertTrue( user_can( self::$author_user_id, 'read_post', $revision->ID ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -415,7 +415,7 @@ class Tests_Query_Results extends WP_UnitTestCase {
|
||||
|
||||
// Expect post ids in the same order as post__in array when order=asc is passed in
|
||||
$this->assertSame( $expected_returned_array, $q->posts );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 39055
|
||||
|
@ -7,9 +7,9 @@
|
||||
* @subpackage REST API
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
class WP_Test_REST_Pages_Controller extends WP_Test_REST_Post_Type_Controller_Testcase {
|
||||
protected static $editor_id;
|
||||
|
||||
|
@ -6,9 +6,9 @@
|
||||
* @subpackage REST API
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
class WP_Test_REST_Post_Meta_Fields extends WP_Test_REST_TestCase {
|
||||
protected static $wp_meta_keys_saved;
|
||||
protected static $post_id;
|
||||
|
@ -6,9 +6,9 @@
|
||||
* @subpackage REST API
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
class WP_Test_REST_Post_Statuses_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
|
||||
public function test_register_routes() {
|
||||
|
@ -6,9 +6,9 @@
|
||||
* @subpackage REST API
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
class WP_Test_REST_Post_Types_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
|
||||
public function test_register_routes() {
|
||||
|
@ -6,9 +6,9 @@
|
||||
* @subpackage REST API
|
||||
*/
|
||||
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
/**
|
||||
* @group restapi
|
||||
*/
|
||||
class WP_Test_REST_Revisions_Controller extends WP_Test_REST_Controller_Testcase {
|
||||
protected static $post_id;
|
||||
protected static $page_id;
|
||||
|
@ -397,12 +397,12 @@ class Tests_REST_Server extends WP_Test_REST_TestCase {
|
||||
|
||||
public function test_json_error_with_status() {
|
||||
$stub = $this->getMockBuilder( 'Spy_REST_Server' )
|
||||
->setMethods( array( 'set_status' ) )
|
||||
->getMock();
|
||||
->setMethods( array( 'set_status' ) )
|
||||
->getMock();
|
||||
|
||||
$stub->expects( $this->once() )
|
||||
->method( 'set_status' )
|
||||
->with( $this->equalTo( 400 ) );
|
||||
->method( 'set_status' )
|
||||
->with( $this->equalTo( 400 ) );
|
||||
|
||||
$data = array(
|
||||
'code' => 'wp-api-test-error',
|
||||
|
@ -145,7 +145,7 @@ class Tests_Term_GetTerm extends WP_UnitTestCase {
|
||||
/**
|
||||
* @ticket 34332
|
||||
*/
|
||||
public function test_should_return_null_when_provided_taxonomy_does_not_match_actual_term_taxonomy() {
|
||||
public function test_should_return_null_when_provided_taxonomy_does_not_match_actual_term_taxonomy() {
|
||||
$term_id = self::factory()->term->create( array( 'taxonomy' => 'post_tag' ) );
|
||||
$this->assertNull( get_term( $term_id, 'category' ) );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user