-
From 802ef884981a1f1b3c7c470fc2183b9bcb375ffd Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Sun, 18 Oct 2020 07:17:43 +0200
Subject: [PATCH] QA: don't use alias functions
Using the canonical function name for PHP functions is strongly recommended as aliases may be deprecated or removed without (much) warning.
This replaces all uses of the following:
* `join()` with `implode()`
* `sizeof()` with `count()`
* `is_writeable()` with `is_writable()`
* `doubleval()` with a `(float)` cast
In part, this is a follow-up to 47746
---
src/wp-admin/edit-comments.php | 2 +-
src/wp-admin/edit.php | 4 ++--
src/wp-admin/includes/ajax-actions.php | 2 +-
.../includes/class-wp-comments-list-table.php | 2 +-
src/wp-admin/includes/class-wp-importer.php | 2 +-
src/wp-admin/includes/class-wp-list-table.php | 4 ++--
.../includes/class-wp-media-list-table.php | 2 +-
.../includes/class-wp-posts-list-table.php | 2 +-
src/wp-admin/includes/class-wp-site-health.php | 4 ++--
src/wp-admin/includes/export.php | 2 +-
src/wp-admin/includes/file.php | 2 +-
src/wp-admin/includes/media.php | 12 ++++++------
src/wp-admin/includes/misc.php | 2 +-
src/wp-admin/includes/revision.php | 2 +-
src/wp-admin/includes/taxonomy.php | 2 +-
src/wp-admin/includes/upgrade.php | 2 +-
src/wp-admin/link.php | 2 +-
src/wp-admin/menu-header.php | 4 ++--
src/wp-admin/network/themes.php | 2 +-
src/wp-admin/plugin-editor.php | 6 +++---
src/wp-admin/plugins.php | 2 +-
src/wp-admin/theme-editor.php | 4 ++--
src/wp-admin/upload.php | 2 +-
.../twentytwenty/inc/starter-content.php | 2 +-
src/wp-includes/bookmark-template.php | 2 +-
src/wp-includes/category-template.php | 6 +++---
src/wp-includes/class-walker-nav-menu.php | 4 ++--
src/wp-includes/class-wp-customize-manager.php | 2 +-
src/wp-includes/class-wp-query.php | 16 ++++++++--------
.../class-wp-text-diff-renderer-table.php | 2 +-
src/wp-includes/class-wp-user-query.php | 2 +-
src/wp-includes/comment-template.php | 2 +-
src/wp-includes/comment.php | 2 +-
src/wp-includes/compat.php | 2 +-
src/wp-includes/embed.php | 6 +++---
src/wp-includes/formatting.php | 8 ++++----
src/wp-includes/functions.php | 10 +++++-----
src/wp-includes/general-template.php | 4 ++--
src/wp-includes/l10n.php | 2 +-
src/wp-includes/media.php | 6 +++---
src/wp-includes/meta.php | 2 +-
src/wp-includes/ms-network.php | 2 +-
src/wp-includes/ms-site.php | 2 +-
src/wp-includes/pluggable.php | 2 +-
src/wp-includes/post-template.php | 4 ++--
src/wp-includes/post.php | 4 ++--
src/wp-includes/shortcodes.php | 2 +-
src/wp-includes/taxonomy.php | 6 +++---
src/wp-includes/theme.php | 2 +-
.../widgets/class-wp-widget-custom-html.php | 2 +-
.../widgets/class-wp-widget-media-image.php | 2 +-
.../widgets/class-wp-widget-media.php | 4 ++--
tests/phpunit/includes/utils.php | 6 +++---
tests/phpunit/tests/customize/manager.php | 2 +-
tests/phpunit/tests/db.php | 2 +-
tests/phpunit/tests/formatting/Autop.php | 18 +++++++++---------
tests/phpunit/tests/media.php | 8 ++++----
tests/phpunit/tests/post/bodyClass.php | 4 ++--
tests/phpunit/tests/post/postClass.php | 4 ++--
tests/phpunit/tests/post/template.php | 2 +-
.../tests/widgets/media-gallery-widget.php | 2 +-
61 files changed, 115 insertions(+), 115 deletions(-)
diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php
index c2a16eef0b..0dde8df01a 100644
a
|
b
|
if ( $doaction ) { |
120 | 120 | $redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to ); |
121 | 121 | } |
122 | 122 | if ( $trashed || $spammed ) { |
123 | | $redirect_to = add_query_arg( 'ids', join( ',', $comment_ids ), $redirect_to ); |
| 123 | $redirect_to = add_query_arg( 'ids', implode( ',', $comment_ids ), $redirect_to ); |
124 | 124 | } |
125 | 125 | |
126 | 126 | wp_safe_redirect( $redirect_to ); |
-
diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php
index bf54037451..40bc41c512 100644
a
|
b
|
if ( $doaction ) { |
126 | 126 | $sendback = add_query_arg( |
127 | 127 | array( |
128 | 128 | 'trashed' => $trashed, |
129 | | 'ids' => join( ',', $post_ids ), |
| 129 | 'ids' => implode( ',', $post_ids ), |
130 | 130 | 'locked' => $locked, |
131 | 131 | ), |
132 | 132 | $sendback |
… |
… |
foreach ( $bulk_counts as $message => $count ) { |
442 | 442 | } |
443 | 443 | |
444 | 444 | if ( $messages ) { |
445 | | echo '<div id="message" class="updated notice is-dismissible"><p>' . join( ' ', $messages ) . '</p></div>'; |
| 445 | echo '<div id="message" class="updated notice is-dismissible"><p>' . implode( ' ', $messages ) . '</p></div>'; |
446 | 446 | } |
447 | 447 | unset( $messages ); |
448 | 448 | |
-
diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php
index f359732b15..6ff2d2d9fd 100644
a
|
b
|
function wp_ajax_ajax_tag_search() { |
162 | 162 | ) |
163 | 163 | ); |
164 | 164 | |
165 | | echo join( "\n", $results ); |
| 165 | echo implode( "\n", $results ); |
166 | 166 | wp_die(); |
167 | 167 | } |
168 | 168 | |
-
diff --git a/src/wp-admin/includes/class-wp-comments-list-table.php b/src/wp-admin/includes/class-wp-comments-list-table.php
index 1c7ac384ae..563187ffe4 100644
a
|
b
|
class WP_Comments_List_Table extends WP_List_Table { |
615 | 615 | if ( ! $the_comment_class ) { |
616 | 616 | $the_comment_class = ''; |
617 | 617 | } |
618 | | $the_comment_class = join( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) ); |
| 618 | $the_comment_class = implode( ' ', get_comment_class( $the_comment_class, $comment, $comment->comment_post_ID ) ); |
619 | 619 | |
620 | 620 | if ( $comment->comment_post_ID > 0 ) { |
621 | 621 | $post = get_post( $comment->comment_post_ID ); |
-
diff --git a/src/wp-admin/includes/class-wp-importer.php b/src/wp-admin/includes/class-wp-importer.php
index b60c783c90..d189061d5b 100644
a
|
b
|
function get_cli_args( $param, $required = false ) { |
291 | 291 | $last_arg = null; |
292 | 292 | $return = null; |
293 | 293 | |
294 | | $il = sizeof( $args ); |
| 294 | $il = count( $args ); |
295 | 295 | |
296 | 296 | for ( $i = 1, $il; $i < $il; $i++ ) { |
297 | 297 | if ( (bool) preg_match( '/^--(.+)/', $args[ $i ], $match ) ) { |
-
diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
index 485338e630..5363cc9e98 100644
a
|
b
|
class WP_List_Table { |
947 | 947 | if ( ! empty( $infinite_scroll ) ) { |
948 | 948 | $pagination_links_class .= ' hide-if-js'; |
949 | 949 | } |
950 | | $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>'; |
| 950 | $output .= "\n<span class='$pagination_links_class'>" . implode( "\n", $page_links ) . '</span>'; |
951 | 951 | |
952 | 952 | if ( $total_pages ) { |
953 | 953 | $page_class = $total_pages < 2 ? ' one-page' : ''; |
… |
… |
class WP_List_Table { |
1213 | 1213 | $id = $with_id ? "id='$column_key'" : ''; |
1214 | 1214 | |
1215 | 1215 | if ( ! empty( $class ) ) { |
1216 | | $class = "class='" . join( ' ', $class ) . "'"; |
| 1216 | $class = "class='" . implode( ' ', $class ) . "'"; |
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | echo "<$tag $scope $id $class>$column_display_name</$tag>"; |
-
diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php
index e5988ed3c9..031f306987 100644
a
|
b
|
class WP_Media_List_Table extends WP_List_Table { |
614 | 614 | ); |
615 | 615 | } |
616 | 616 | /* translators: Used between list items, there is a space after the comma. */ |
617 | | echo join( __( ', ' ), $out ); |
| 617 | echo implode( __( ', ' ), $out ); |
618 | 618 | } else { |
619 | 619 | echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . get_taxonomy( $taxonomy )->labels->no_terms . '</span>'; |
620 | 620 | } |
-
diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php
index 08e2ff58ec..67e7a279d4 100644
a
|
b
|
class WP_Posts_List_Table extends WP_List_Table { |
1219 | 1219 | $term_links = apply_filters( 'post_column_taxonomy_links', $term_links, $taxonomy, $terms ); |
1220 | 1220 | |
1221 | 1221 | /* translators: Used between list items, there is a space after the comma. */ |
1222 | | echo join( __( ', ' ), $term_links ); |
| 1222 | echo implode( __( ', ' ), $term_links ); |
1223 | 1223 | } else { |
1224 | 1224 | echo '<span aria-hidden="true">—</span><span class="screen-reader-text">' . $taxonomy_object->labels->no_terms . '</span>'; |
1225 | 1225 | } |
-
diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php
index 6070a57b9b..aa9d794095 100644
a
|
b
|
class WP_Site_Health { |
1855 | 1855 | $hosts = explode( ',', WP_ACCESSIBLE_HOSTS ); |
1856 | 1856 | } |
1857 | 1857 | |
1858 | | if ( $blocked && 0 === sizeof( $hosts ) ) { |
| 1858 | if ( $blocked && 0 === count( $hosts ) ) { |
1859 | 1859 | $result['status'] = 'critical'; |
1860 | 1860 | |
1861 | 1861 | $result['label'] = __( 'HTTP requests are blocked' ); |
… |
… |
class WP_Site_Health { |
1870 | 1870 | ); |
1871 | 1871 | } |
1872 | 1872 | |
1873 | | if ( $blocked && 0 < sizeof( $hosts ) ) { |
| 1873 | if ( $blocked && 0 < count( $hosts ) ) { |
1874 | 1874 | $result['status'] = 'recommended'; |
1875 | 1875 | |
1876 | 1876 | $result['label'] = __( 'HTTP requests are partially blocked' ); |
-
diff --git a/src/wp-admin/includes/export.php b/src/wp-admin/includes/export.php
index 03b7f4ccfa..74d7c5f823 100644
a
|
b
|
function export_wp( $args = array() ) { |
534 | 534 | |
535 | 535 | // Fetch 20 posts at a time rather than loading the entire table into memory. |
536 | 536 | while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) { |
537 | | $where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')'; |
| 537 | $where = 'WHERE ID IN (' . implode( ',', $next_posts ) . ')'; |
538 | 538 | $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" ); |
539 | 539 | |
540 | 540 | // Begin Loop. |
-
diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 88ac0cae2f..cfb40529a6 100644
a
|
b
|
function wp_edit_theme_plugin_file( $args ) { |
489 | 489 | |
490 | 490 | $previous_content = file_get_contents( $real_file ); |
491 | 491 | |
492 | | if ( ! is_writeable( $real_file ) ) { |
| 492 | if ( ! is_writable( $real_file ) ) { |
493 | 493 | return new WP_Error( 'file_not_writable' ); |
494 | 494 | } |
495 | 495 | |
-
diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index b23900961a..e2f21426dd 100644
a
|
b
|
function image_align_input_fields( $post, $checked = '' ) { |
1118 | 1118 | " /><label for='image-align-{$name}-{$post->ID}' class='align image-align-{$name}-label'>$label</label>"; |
1119 | 1119 | } |
1120 | 1120 | |
1121 | | return join( "\n", $out ); |
| 1121 | return implode( "\n", $out ); |
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | /** |
… |
… |
function image_size_input_fields( $post, $check = '' ) { |
1195 | 1195 | return array( |
1196 | 1196 | 'label' => __( 'Size' ), |
1197 | 1197 | 'input' => 'html', |
1198 | | 'html' => join( "\n", $out ), |
| 1198 | 'html' => implode( "\n", $out ), |
1199 | 1199 | ); |
1200 | 1200 | } |
1201 | 1201 | |
… |
… |
function get_attachment_fields_to_edit( $post, $errors = null ) { |
1424 | 1424 | $values[] = $term->slug; |
1425 | 1425 | } |
1426 | 1426 | |
1427 | | $t['value'] = join( ', ', $values ); |
| 1427 | $t['value'] = implode( ', ', $values ); |
1428 | 1428 | |
1429 | 1429 | $form_fields[ $taxonomy ] = $t; |
1430 | 1430 | } |
… |
… |
function get_media_item( $attachment_id, $args = null ) { |
1784 | 1784 | } |
1785 | 1785 | |
1786 | 1786 | if ( ! empty( $field['helps'] ) ) { |
1787 | | $item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>'; |
| 1787 | $item .= "<p class='help'>" . implode( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>'; |
1788 | 1788 | } |
1789 | 1789 | $item .= "</td>\n\t\t</tr>\n"; |
1790 | 1790 | |
… |
… |
function get_compat_media_markup( $attachment_id, $args = null ) { |
1883 | 1883 | $values[] = $term->slug; |
1884 | 1884 | } |
1885 | 1885 | |
1886 | | $t['value'] = join( ', ', $values ); |
| 1886 | $t['value'] = implode( ', ', $values ); |
1887 | 1887 | $t['taxonomy'] = true; |
1888 | 1888 | |
1889 | 1889 | $form_fields[ $taxonomy ] = $t; |
… |
… |
function get_compat_media_markup( $attachment_id, $args = null ) { |
1976 | 1976 | } |
1977 | 1977 | |
1978 | 1978 | if ( ! empty( $field['helps'] ) ) { |
1979 | | $item .= "<p class='help'>" . join( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>'; |
| 1979 | $item .= "<p class='help'>" . implode( "</p>\n<p class='help'>", array_unique( (array) $field['helps'] ) ) . '</p>'; |
1980 | 1980 | } |
1981 | 1981 | |
1982 | 1982 | $item .= "</td>\n\t\t</tr>\n"; |
-
diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
index 74ac6cec27..e13a46bc91 100644
a
|
b
|
function insert_with_markers( $filename, $marker, $insertion ) { |
121 | 121 | if ( $perms ) { |
122 | 122 | chmod( $filename, $perms | 0644 ); |
123 | 123 | } |
124 | | } elseif ( ! is_writeable( $filename ) ) { |
| 124 | } elseif ( ! is_writable( $filename ) ) { |
125 | 125 | return false; |
126 | 126 | } |
127 | 127 | |
-
diff --git a/src/wp-admin/includes/revision.php b/src/wp-admin/includes/revision.php
index 52600dce06..7718a831e4 100644
a
|
b
|
function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null |
275 | 275 | * If we only have one revision, the initial revision is missing; This happens |
276 | 276 | * when we have an autsosave and the user has clicked 'View the Autosave' |
277 | 277 | */ |
278 | | if ( 1 === sizeof( $revisions ) ) { |
| 278 | if ( 1 === count( $revisions ) ) { |
279 | 279 | $revisions[ $post->ID ] = array( |
280 | 280 | 'id' => $post->ID, |
281 | 281 | 'title' => get_the_title( $post->ID ), |
-
diff --git a/src/wp-admin/includes/taxonomy.php b/src/wp-admin/includes/taxonomy.php
index 7f7e60952c..de76917cd0 100644
a
|
b
|
function get_terms_to_edit( $post_id, $taxonomy = 'post_tag' ) { |
278 | 278 | $term_names[] = $term->name; |
279 | 279 | } |
280 | 280 | |
281 | | $terms_to_edit = esc_attr( join( ',', $term_names ) ); |
| 281 | $terms_to_edit = esc_attr( implode( ',', $term_names ) ); |
282 | 282 | |
283 | 283 | /** |
284 | 284 | * Filters the comma-separated list of terms available to edit. |
-
diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php
index 0a65659492..f68ee0b9ff 100644
a
|
b
|
function upgrade_130() { |
1112 | 1112 | $limit = $option->dupes - 1; |
1113 | 1113 | $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) ); |
1114 | 1114 | if ( $dupe_ids ) { |
1115 | | $dupe_ids = join( ',', $dupe_ids ); |
| 1115 | $dupe_ids = implode( ',', $dupe_ids ); |
1116 | 1116 | $wpdb->query( "DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)" ); |
1117 | 1117 | } |
1118 | 1118 | } |
-
diff --git a/src/wp-admin/link.php b/src/wp-admin/link.php
index 1824f80144..5494f9f15f 100644
a
|
b
|
switch ( $action ) { |
60 | 60 | wp_redirect( $this_file ); |
61 | 61 | exit; |
62 | 62 | } |
63 | | $all_links = join( ',', $linkcheck ); |
| 63 | $all_links = implode( ',', $linkcheck ); |
64 | 64 | /* |
65 | 65 | * Should now have an array of links we can change: |
66 | 66 | * $q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); |
-
diff --git a/src/wp-admin/menu-header.php b/src/wp-admin/menu-header.php
index 3e81e0bea7..1f481f8634 100644
a
|
b
|
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { |
106 | 106 | $class[] = esc_attr( $item[4] ); |
107 | 107 | } |
108 | 108 | |
109 | | $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; |
| 109 | $class = $class ? ' class="' . implode( ' ', $class ) . '"' : ''; |
110 | 110 | $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; |
111 | 111 | $img = ''; |
112 | 112 | $img_style = ''; |
… |
… |
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { |
240 | 240 | $class[] = esc_attr( $sub_item[4] ); |
241 | 241 | } |
242 | 242 | |
243 | | $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; |
| 243 | $class = $class ? ' class="' . implode( ' ', $class ) . '"' : ''; |
244 | 244 | |
245 | 245 | $menu_hook = get_plugin_page_hook( $sub_item[2], $item[2] ); |
246 | 246 | $sub_file = $sub_item[2]; |
-
diff --git a/src/wp-admin/network/themes.php b/src/wp-admin/network/themes.php
index 730ab906b1..84fbdf3106 100644
a
|
b
|
if ( $action ) { |
89 | 89 | echo '<div class="wrap">'; |
90 | 90 | echo '<h1>' . esc_html( $title ) . '</h1>'; |
91 | 91 | |
92 | | $url = self_admin_url( 'update.php?action=update-selected-themes&themes=' . urlencode( join( ',', $themes ) ) ); |
| 92 | $url = self_admin_url( 'update.php?action=update-selected-themes&themes=' . urlencode( implode( ',', $themes ) ) ); |
93 | 93 | $url = wp_nonce_url( $url, 'bulk-update-themes' ); |
94 | 94 | |
95 | 95 | echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>"; |
-
diff --git a/src/wp-admin/plugin-editor.php b/src/wp-admin/plugin-editor.php
index 50d5acee4f..7467ace6aa 100644
a
|
b
|
$content = esc_textarea( $content ); |
195 | 195 | <h2> |
196 | 196 | <?php |
197 | 197 | if ( is_plugin_active( $plugin ) ) { |
198 | | if ( is_writeable( $real_file ) ) { |
| 198 | if ( is_writable( $real_file ) ) { |
199 | 199 | /* translators: %s: Plugin file name. */ |
200 | 200 | printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
201 | 201 | } else { |
… |
… |
$content = esc_textarea( $content ); |
203 | 203 | printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
204 | 204 | } |
205 | 205 | } else { |
206 | | if ( is_writeable( $real_file ) ) { |
| 206 | if ( is_writable( $real_file ) ) { |
207 | 207 | /* translators: %s: Plugin file name. */ |
208 | 208 | printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' ); |
209 | 209 | } else { |
… |
… |
$content = esc_textarea( $content ); |
275 | 275 | </div> |
276 | 276 | <?php endif; ?> |
277 | 277 | |
278 | | <?php if ( is_writeable( $real_file ) ) : ?> |
| 278 | <?php if ( is_writable( $real_file ) ) : ?> |
279 | 279 | <div class="editor-notices"> |
280 | 280 | <?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { ?> |
281 | 281 | <div class="notice notice-warning inline active-plugin-edit-warning"> |
-
diff --git a/src/wp-admin/plugins.php b/src/wp-admin/plugins.php
index fe8ea41fb2..96d0b2cba9 100644
a
|
b
|
if ( $action ) { |
162 | 162 | echo '<div class="wrap">'; |
163 | 163 | echo '<h1>' . esc_html( $title ) . '</h1>'; |
164 | 164 | |
165 | | $url = self_admin_url( 'update.php?action=update-selected&plugins=' . urlencode( join( ',', $plugins ) ) ); |
| 165 | $url = self_admin_url( 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) ) ); |
166 | 166 | $url = wp_nonce_url( $url, 'bulk-update-plugins' ); |
167 | 167 | |
168 | 168 | echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>"; |
-
diff --git a/src/wp-admin/theme-editor.php b/src/wp-admin/theme-editor.php
index 61e15e4bcd..3cf24cc77e 100644
a
|
b
|
else : |
301 | 301 | <?php if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : ?> |
302 | 302 | <div class="notice notice-warning inline"> |
303 | 303 | <p> |
304 | | <?php if ( is_writeable( $file ) ) : ?> |
| 304 | <?php if ( is_writable( $file ) ) : ?> |
305 | 305 | <strong><?php _e( 'Caution:' ); ?></strong> |
306 | 306 | <?php endif; ?> |
307 | 307 | <?php _e( 'This is a file in your current parent theme.' ); ?> |
… |
… |
else : |
309 | 309 | </div> |
310 | 310 | <?php endif; ?> |
311 | 311 | </div> |
312 | | <?php if ( is_writeable( $file ) ) : ?> |
| 312 | <?php if ( is_writable( $file ) ) : ?> |
313 | 313 | <p class="submit"> |
314 | 314 | <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?> |
315 | 315 | <span class="spinner"></span> |
-
diff --git a/src/wp-admin/upload.php b/src/wp-admin/upload.php
index 3917ece191..2eb29da17d 100644
a
|
b
|
if ( $doaction ) { |
162 | 162 | $location = add_query_arg( |
163 | 163 | array( |
164 | 164 | 'trashed' => count( $post_ids ), |
165 | | 'ids' => join( ',', $post_ids ), |
| 165 | 'ids' => implode( ',', $post_ids ), |
166 | 166 | ), |
167 | 167 | $location |
168 | 168 | ); |
-
diff --git a/src/wp-content/themes/twentytwenty/inc/starter-content.php b/src/wp-content/themes/twentytwenty/inc/starter-content.php
index 95f7bc57aa..89be38bbe8 100644
a
|
b
|
function twentytwenty_get_starter_content() { |
48 | 48 | 'post_title' => __( 'The New UMoMA Opens its Doors', 'twentytwenty' ), |
49 | 49 | // Use the above featured image with the predefined about page. |
50 | 50 | 'thumbnail' => '{{image-opening}}', |
51 | | 'post_content' => join( |
| 51 | 'post_content' => implode( |
52 | 52 | '', |
53 | 53 | array( |
54 | 54 | '<!-- wp:group {"align":"wide"} -->', |
-
diff --git a/src/wp-includes/bookmark-template.php b/src/wp-includes/bookmark-template.php
index 2db315b034..0a3840502a 100644
a
|
b
|
function wp_list_bookmarks( $args = '' ) { |
234 | 234 | $parsed_args['class'] = explode( ' ', $parsed_args['class'] ); |
235 | 235 | } |
236 | 236 | $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] ); |
237 | | $parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) ); |
| 237 | $parsed_args['class'] = trim( implode( ' ', $parsed_args['class'] ) ); |
238 | 238 | |
239 | 239 | if ( $parsed_args['categorize'] ) { |
240 | 240 | $cats = get_terms( |
-
diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php
index df4ee350a9..e2f0cb0115 100644
a
|
b
|
function wp_generate_tag_cloud( $tags, $args = '' ) { |
1010 | 1010 | * Note: this is redundant but doesn't harm. |
1011 | 1011 | */ |
1012 | 1012 | $return = "<ul class='wp-tag-cloud' role='list'>\n\t<li>"; |
1013 | | $return .= join( "</li>\n\t<li>", $a ); |
| 1013 | $return .= implode( "</li>\n\t<li>", $a ); |
1014 | 1014 | $return .= "</li>\n</ul>\n"; |
1015 | 1015 | break; |
1016 | 1016 | default: |
1017 | | $return = join( $args['separator'], $a ); |
| 1017 | $return = implode( $args['separator'], $a ); |
1018 | 1018 | break; |
1019 | 1019 | } |
1020 | 1020 | |
… |
… |
function get_the_term_list( $post_id, $taxonomy, $before = '', $sep = '', $after |
1349 | 1349 | */ |
1350 | 1350 | $term_links = apply_filters( "term_links-{$taxonomy}", $links ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
1351 | 1351 | |
1352 | | return $before . join( $sep, $term_links ) . $after; |
| 1352 | return $before . implode( $sep, $term_links ) . $after; |
1353 | 1353 | } |
1354 | 1354 | |
1355 | 1355 | /** |
-
diff --git a/src/wp-includes/class-walker-nav-menu.php b/src/wp-includes/class-walker-nav-menu.php
index 5f4a53691c..66ba424da4 100644
a
|
b
|
class Walker_Nav_Menu extends Walker { |
72 | 72 | * @param stdClass $args An object of `wp_nav_menu()` arguments. |
73 | 73 | * @param int $depth Depth of menu item. Used for padding. |
74 | 74 | */ |
75 | | $class_names = join( ' ', apply_filters( 'nav_menu_submenu_css_class', $classes, $args, $depth ) ); |
| 75 | $class_names = implode( ' ', apply_filters( 'nav_menu_submenu_css_class', $classes, $args, $depth ) ); |
76 | 76 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
77 | 77 | |
78 | 78 | $output .= "{$n}{$indent}<ul$class_names>{$n}"; |
… |
… |
class Walker_Nav_Menu extends Walker { |
150 | 150 | * @param stdClass $args An object of wp_nav_menu() arguments. |
151 | 151 | * @param int $depth Depth of menu item. Used for padding. |
152 | 152 | */ |
153 | | $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) ); |
| 153 | $class_names = implode( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) ); |
154 | 154 | $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; |
155 | 155 | |
156 | 156 | /** |
-
diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php
index 88a8128acd..a46b97fa5a 100644
a
|
b
|
final class WP_Customize_Manager { |
2397 | 2397 | $notification = array(); |
2398 | 2398 | foreach ( $validity->errors as $error_code => $error_messages ) { |
2399 | 2399 | $notification[ $error_code ] = array( |
2400 | | 'message' => join( ' ', $error_messages ), |
| 2400 | 'message' => implode( ' ', $error_messages ), |
2401 | 2401 | 'data' => $validity->get_error_data( $error_code ), |
2402 | 2402 | ); |
2403 | 2403 | } |
-
diff --git a/src/wp-includes/class-wp-query.php b/src/wp-includes/class-wp-query.php
index 34d0a5de96..98f5c3c25b 100644
a
|
b
|
class WP_Query { |
2420 | 2420 | if ( empty( $in_search_post_types ) ) { |
2421 | 2421 | $where .= ' AND 1=0 '; |
2422 | 2422 | } else { |
2423 | | $where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')"; |
| 2423 | $where .= " AND {$wpdb->posts}.post_type IN ('" . implode( "', '", array_map( 'esc_sql', $in_search_post_types ) ) . "')"; |
2424 | 2424 | } |
2425 | 2425 | } elseif ( ! empty( $post_type ) && is_array( $post_type ) ) { |
2426 | | $where .= " AND {$wpdb->posts}.post_type IN ('" . join( "', '", esc_sql( $post_type ) ) . "')"; |
| 2426 | $where .= " AND {$wpdb->posts}.post_type IN ('" . implode( "', '", esc_sql( $post_type ) ) . "')"; |
2427 | 2427 | } elseif ( ! empty( $post_type ) ) { |
2428 | 2428 | $where .= $wpdb->prepare( " AND {$wpdb->posts}.post_type = %s", $post_type ); |
2429 | 2429 | $post_type_object = get_post_type_object( $post_type ); |
… |
… |
class WP_Query { |
2485 | 2485 | } |
2486 | 2486 | |
2487 | 2487 | if ( ! empty( $e_status ) ) { |
2488 | | $statuswheres[] = '(' . join( ' AND ', $e_status ) . ')'; |
| 2488 | $statuswheres[] = '(' . implode( ' AND ', $e_status ) . ')'; |
2489 | 2489 | } |
2490 | 2490 | if ( ! empty( $r_status ) ) { |
2491 | 2491 | if ( ! empty( $q['perm'] ) && 'editable' === $q['perm'] && ! current_user_can( $edit_others_cap ) ) { |
2492 | | $statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . join( ' OR ', $r_status ) . '))'; |
| 2492 | $statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . implode( ' OR ', $r_status ) . '))'; |
2493 | 2493 | } else { |
2494 | | $statuswheres[] = '(' . join( ' OR ', $r_status ) . ')'; |
| 2494 | $statuswheres[] = '(' . implode( ' OR ', $r_status ) . ')'; |
2495 | 2495 | } |
2496 | 2496 | } |
2497 | 2497 | if ( ! empty( $p_status ) ) { |
2498 | 2498 | if ( ! empty( $q['perm'] ) && 'readable' === $q['perm'] && ! current_user_can( $read_private_cap ) ) { |
2499 | | $statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . join( ' OR ', $p_status ) . '))'; |
| 2499 | $statuswheres[] = "({$wpdb->posts}.post_author = $user_id " . 'AND (' . implode( ' OR ', $p_status ) . '))'; |
2500 | 2500 | } else { |
2501 | | $statuswheres[] = '(' . join( ' OR ', $p_status ) . ')'; |
| 2501 | $statuswheres[] = '(' . implode( ' OR ', $p_status ) . ')'; |
2502 | 2502 | } |
2503 | 2503 | } |
2504 | 2504 | if ( $post_status_join ) { |
… |
… |
class WP_Query { |
2669 | 2669 | $post_ids[] = (int) $comment->comment_post_ID; |
2670 | 2670 | } |
2671 | 2671 | |
2672 | | $post_ids = join( ',', $post_ids ); |
| 2672 | $post_ids = implode( ',', $post_ids ); |
2673 | 2673 | $join = ''; |
2674 | 2674 | if ( $post_ids ) { |
2675 | 2675 | $where = "AND {$wpdb->posts}.ID IN ($post_ids) "; |
-
diff --git a/src/wp-includes/class-wp-text-diff-renderer-table.php b/src/wp-includes/class-wp-text-diff-renderer-table.php
index 4bc02d3750..c55add4885 100644
a
|
b
|
class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { |
274 | 274 | // If they're too different, don't include any <ins> or <del>'s. |
275 | 275 | if ( preg_match_all( '!(<ins>.*?</ins>|<del>.*?</del>)!', $diff, $diff_matches ) ) { |
276 | 276 | // Length of all text between <ins> or <del>. |
277 | | $stripped_matches = strlen( strip_tags( join( ' ', $diff_matches[0] ) ) ); |
| 277 | $stripped_matches = strlen( strip_tags( implode( ' ', $diff_matches[0] ) ) ); |
278 | 278 | // Since we count length of text between <ins> or <del> (instead of picking just one), |
279 | 279 | // we double the length of chars not in those tags. |
280 | 280 | $stripped_diff = strlen( strip_tags( $diff ) ) * 2 - $stripped_matches; |
-
diff --git a/src/wp-includes/class-wp-user-query.php b/src/wp-includes/class-wp-user-query.php
index d33f6fb624..967c6b6b05 100644
a
|
b
|
class WP_User_Query { |
279 | 279 | } |
280 | 280 | |
281 | 281 | $posts_table = $wpdb->get_blog_prefix( $blog_id ) . 'posts'; |
282 | | $this->query_where .= " AND $wpdb->users.ID IN ( SELECT DISTINCT $posts_table.post_author FROM $posts_table WHERE $posts_table.post_status = 'publish' AND $posts_table.post_type IN ( " . join( ', ', $post_types ) . ' ) )'; |
| 282 | $this->query_where .= " AND $wpdb->users.ID IN ( SELECT DISTINCT $posts_table.post_author FROM $posts_table WHERE $posts_table.post_status = 'publish' AND $posts_table.post_type IN ( " . implode( ', ', $post_types ) . ' ) )'; |
283 | 283 | } |
284 | 284 | |
285 | 285 | // nicename |
-
diff --git a/src/wp-includes/comment-template.php b/src/wp-includes/comment-template.php
index 89be475034..e3cfdef312 100644
a
|
b
|
function comment_author_url_link( $linktext = '', $before = '', $after = '', $co |
432 | 432 | */ |
433 | 433 | function comment_class( $class = '', $comment = null, $post_id = null, $echo = true ) { |
434 | 434 | // Separates classes with a single space, collates classes for comment DIV. |
435 | | $class = 'class="' . join( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"'; |
| 435 | $class = 'class="' . implode( ' ', get_comment_class( $class, $comment, $post_id ) ) . '"'; |
436 | 436 | |
437 | 437 | if ( $echo ) { |
438 | 438 | echo $class; |
-
diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
index cde13af806..71471eed12 100644
a
|
b
|
function _prime_comment_caches( $comment_ids, $update_meta_cache = true ) { |
3235 | 3235 | |
3236 | 3236 | $non_cached_ids = _get_non_cached_ids( $comment_ids, 'comment' ); |
3237 | 3237 | if ( ! empty( $non_cached_ids ) ) { |
3238 | | $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); |
| 3238 | $fresh_comments = $wpdb->get_results( sprintf( "SELECT $wpdb->comments.* FROM $wpdb->comments WHERE comment_ID IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); |
3239 | 3239 | |
3240 | 3240 | update_comment_cache( $fresh_comments, $update_meta_cache ); |
3241 | 3241 | } |
-
diff --git a/src/wp-includes/compat.php b/src/wp-includes/compat.php
index e322dd26de..7f6c59f03c 100644
a
|
b
|
function _mb_substr( $str, $start, $length = null, $encoding = null ) { |
127 | 127 | // If there's anything left over, repeat the loop. |
128 | 128 | } while ( count( $pieces ) > 1 && $str = array_pop( $pieces ) ); |
129 | 129 | |
130 | | return join( '', array_slice( $chars, $start, $length ) ); |
| 130 | return implode( '', array_slice( $chars, $start, $length ) ); |
131 | 131 | } |
132 | 132 | |
133 | 133 | if ( ! function_exists( 'mb_strlen' ) ) : |
-
diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php
index 449c08bf5d..a9704b7872 100644
a
|
b
|
function wp_maybe_load_embeds() { |
204 | 204 | * |
205 | 205 | * @param callable $handler Audio embed handler callback function. |
206 | 206 | */ |
207 | | wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 ); |
| 207 | wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . implode( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 ); |
208 | 208 | |
209 | 209 | /** |
210 | 210 | * Filters the video embed handler callback. |
… |
… |
function wp_maybe_load_embeds() { |
213 | 213 | * |
214 | 214 | * @param callable $handler Video embed handler callback function. |
215 | 215 | */ |
216 | | wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 ); |
| 216 | wp_embed_register_handler( 'video', '#^https?://.+?\.(' . implode( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 ); |
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
… |
… |
function wp_filter_oembed_iframe_title_attribute( $result, $data, $url ) { |
841 | 841 | |
842 | 842 | if ( isset( $attrs['title'] ) ) { |
843 | 843 | unset( $attrs['title'] ); |
844 | | $attr_string = join( ' ', wp_list_pluck( $attrs, 'whole' ) ); |
| 844 | $attr_string = implode( ' ', wp_list_pluck( $attrs, 'whole' ) ); |
845 | 845 | $result = str_replace( $matches[0], '<iframe ' . trim( $attr_string ) . '>', $result ); |
846 | 846 | } |
847 | 847 | return str_ireplace( '<iframe ', sprintf( '<iframe title="%s" ', esc_attr( $title ) ), $result ); |
-
diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
index a9bb603868..f73105bda1 100644
a
|
b
|
function _get_wptexturize_split_regex( $shortcode_regex = '' ) { |
722 | 722 | * @return string The regular expression |
723 | 723 | */ |
724 | 724 | function _get_wptexturize_shortcode_regex( $tagnames ) { |
725 | | $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); |
| 725 | $tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) ); |
726 | 726 | $tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex(). |
727 | 727 | // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation |
728 | 728 | $regex = |
… |
… |
function shortcode_unautop( $pee ) { |
824 | 824 | return $pee; |
825 | 825 | } |
826 | 826 | |
827 | | $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) ); |
| 827 | $tagregexp = implode( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) ); |
828 | 828 | $spaces = wp_spaces_regexp(); |
829 | 829 | |
830 | 830 | // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound,WordPress.WhiteSpace.PrecisionAlignment.Found -- don't remove regex indentation |
… |
… |
function wp_targeted_link_rel_callback( $matches ) { |
3232 | 3232 | } |
3233 | 3233 | |
3234 | 3234 | $atts['rel']['whole'] = 'rel="' . esc_attr( $rel ) . '"'; |
3235 | | $link_html = join( ' ', array_column( $atts, 'whole' ) ); |
| 3235 | $link_html = implode( ' ', array_column( $atts, 'whole' ) ); |
3236 | 3236 | |
3237 | 3237 | if ( $is_escaped ) { |
3238 | 3238 | $link_html = preg_replace( '/[\'"]/', '\\\\$0', $link_html ); |
… |
… |
function sanitize_email( $email ) { |
3696 | 3696 | } |
3697 | 3697 | |
3698 | 3698 | // Join valid subs into the new domain. |
3699 | | $domain = join( '.', $new_subs ); |
| 3699 | $domain = implode( '.', $new_subs ); |
3700 | 3700 | |
3701 | 3701 | // Put the email back together. |
3702 | 3702 | $sanitized_email = $local . '@' . $domain; |
-
diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php
index e3f9896211..0d034a5b08 100644
a
|
b
|
function size_format( $bytes, $decimals = 0 ) { |
467 | 467 | } |
468 | 468 | |
469 | 469 | foreach ( $quant as $unit => $mag ) { |
470 | | if ( doubleval( $bytes ) >= $mag ) { |
| 470 | if ( (float) $bytes >= $mag ) { |
471 | 471 | return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit; |
472 | 472 | } |
473 | 473 | } |
… |
… |
function _default_wp_die_handler( $message, $title = '', $args = array() ) { |
3431 | 3431 | array( $message ), |
3432 | 3432 | wp_list_pluck( $parsed_args['additional_errors'], 'message' ) |
3433 | 3433 | ); |
3434 | | $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $message ) . "</li>\n\t</ul>"; |
| 3434 | $message = "<ul>\n\t\t<li>" . implode( "</li>\n\t\t<li>", $message ) . "</li>\n\t</ul>"; |
3435 | 3435 | } |
3436 | 3436 | |
3437 | 3437 | $message = sprintf( |
… |
… |
function wp_timezone_choice( $selected_zone, $locale = null ) { |
5880 | 5880 | } |
5881 | 5881 | |
5882 | 5882 | // Build the value. |
5883 | | $value = join( '/', $value ); |
| 5883 | $value = implode( '/', $value ); |
5884 | 5884 | $selected = ''; |
5885 | 5885 | if ( $value === $selected_zone ) { |
5886 | 5886 | $selected = 'selected="selected" '; |
… |
… |
function wp_timezone_choice( $selected_zone, $locale = null ) { |
5981 | 5981 | } |
5982 | 5982 | $structure[] = '</optgroup>'; |
5983 | 5983 | |
5984 | | return join( "\n", $structure ); |
| 5984 | return implode( "\n", $structure ); |
5985 | 5985 | } |
5986 | 5986 | |
5987 | 5987 | /** |
… |
… |
function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr |
6419 | 6419 | } |
6420 | 6420 | } |
6421 | 6421 | if ( $pretty ) { |
6422 | | return join( ', ', array_reverse( $caller ) ); |
| 6422 | return implode( ', ', array_reverse( $caller ) ); |
6423 | 6423 | } else { |
6424 | 6424 | return $caller; |
6425 | 6425 | } |
-
diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
index dc5b374121..15c4974304 100644
a
|
b
|
function paginate_links( $args = '' ) { |
4345 | 4345 | |
4346 | 4346 | case 'list': |
4347 | 4347 | $r .= "<ul class='page-numbers'>\n\t<li>"; |
4348 | | $r .= join( "</li>\n\t<li>", $page_links ); |
| 4348 | $r .= implode( "</li>\n\t<li>", $page_links ); |
4349 | 4349 | $r .= "</li>\n</ul>\n"; |
4350 | 4350 | break; |
4351 | 4351 | |
4352 | 4352 | default: |
4353 | | $r = join( "\n", $page_links ); |
| 4353 | $r = implode( "\n", $page_links ); |
4354 | 4354 | break; |
4355 | 4355 | } |
4356 | 4356 | |
-
diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php
index 226cc2d8fd..0c6b75ea24 100644
a
|
b
|
function wp_dropdown_languages( $args = array() ) { |
1617 | 1617 | |
1618 | 1618 | // Combine the output string. |
1619 | 1619 | $output = sprintf( '<select name="%s" id="%s">', esc_attr( $parsed_args['name'] ), esc_attr( $parsed_args['id'] ) ); |
1620 | | $output .= join( "\n", $structure ); |
| 1620 | $output .= implode( "\n", $structure ); |
1621 | 1621 | $output .= '</select>'; |
1622 | 1622 | |
1623 | 1623 | if ( $parsed_args['echo'] ) { |
-
diff --git a/src/wp-includes/media.php b/src/wp-includes/media.php
index ab33c88c04..383ad9930f 100644
a
|
b
|
function wp_get_attachment_image( $attachment_id, $size = 'thumbnail', $icon = f |
1035 | 1035 | $size_class = $size; |
1036 | 1036 | |
1037 | 1037 | if ( is_array( $size_class ) ) { |
1038 | | $size_class = join( 'x', $size_class ); |
| 1038 | $size_class = implode( 'x', $size_class ); |
1039 | 1039 | } |
1040 | 1040 | |
1041 | 1041 | $default_attr = array( |
… |
… |
function wp_audio_shortcode( $attr, $content = '' ) { |
2950 | 2950 | $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n"; |
2951 | 2951 | } |
2952 | 2952 | |
2953 | | $html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) ); |
| 2953 | $html .= sprintf( '<audio %s controls="controls">', implode( ' ', $attr_strings ) ); |
2954 | 2954 | |
2955 | 2955 | $fileurl = ''; |
2956 | 2956 | $source = '<source type="%s" src="%s" />'; |
… |
… |
function wp_video_shortcode( $attr, $content = '' ) { |
3218 | 3218 | $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n"; |
3219 | 3219 | } |
3220 | 3220 | |
3221 | | $html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) ); |
| 3221 | $html .= sprintf( '<video %s controls="controls">', implode( ' ', $attr_strings ) ); |
3222 | 3222 | |
3223 | 3223 | $fileurl = ''; |
3224 | 3224 | $source = '<source type="%s" src="%s" />'; |
-
diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php
index 3cef8c1363..e1c1f92e48 100644
a
|
b
|
function update_meta_cache( $meta_type, $object_ids ) { |
1055 | 1055 | } |
1056 | 1056 | |
1057 | 1057 | // Get meta info. |
1058 | | $id_list = join( ',', $non_cached_ids ); |
| 1058 | $id_list = implode( ',', $non_cached_ids ); |
1059 | 1059 | $id_column = ( 'user' === $meta_type ) ? 'umeta_id' : 'meta_id'; |
1060 | 1060 | |
1061 | 1061 | $meta_list = $wpdb->get_results( "SELECT $column, meta_key, meta_value FROM $table WHERE $column IN ($id_list) ORDER BY $id_column ASC", ARRAY_A ); |
-
diff --git a/src/wp-includes/ms-network.php b/src/wp-includes/ms-network.php
index 0434fa8acb..91001ab9a0 100644
a
|
b
|
function _prime_network_caches( $network_ids ) { |
131 | 131 | |
132 | 132 | $non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' ); |
133 | 133 | if ( ! empty( $non_cached_ids ) ) { |
134 | | $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
| 134 | $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
135 | 135 | |
136 | 136 | update_network_cache( $fresh_networks ); |
137 | 137 | } |
-
diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php
index b90dde3cd0..31d1c7ce99 100644
a
|
b
|
function _prime_site_caches( $ids, $update_meta_cache = true ) { |
352 | 352 | |
353 | 353 | $non_cached_ids = _get_non_cached_ids( $ids, 'sites' ); |
354 | 354 | if ( ! empty( $non_cached_ids ) ) { |
355 | | $fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
| 355 | $fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
356 | 356 | |
357 | 357 | update_site_cache( $fresh_sites, $update_meta_cache ); |
358 | 358 | } |
-
diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index a822ff3bea..68187fcf05 100644
a
|
b
|
if ( ! function_exists( 'get_avatar' ) ) : |
2723 | 2723 | esc_attr( $args['alt'] ), |
2724 | 2724 | esc_url( $url ), |
2725 | 2725 | esc_url( $url2x ) . ' 2x', |
2726 | | esc_attr( join( ' ', $class ) ), |
| 2726 | esc_attr( implode( ' ', $class ) ), |
2727 | 2727 | (int) $args['height'], |
2728 | 2728 | (int) $args['width'], |
2729 | 2729 | $extra_attr |
-
diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php
index c65b2e473b..0aff64d119 100644
a
|
b
|
function has_excerpt( $post = 0 ) { |
456 | 456 | */ |
457 | 457 | function post_class( $class = '', $post_id = null ) { |
458 | 458 | // Separates classes with a single space, collates classes for post DIV. |
459 | | echo 'class="' . esc_attr( join( ' ', get_post_class( $class, $post_id ) ) ) . '"'; |
| 459 | echo 'class="' . esc_attr( implode( ' ', get_post_class( $class, $post_id ) ) ) . '"'; |
460 | 460 | } |
461 | 461 | |
462 | 462 | /** |
… |
… |
function get_post_class( $class = '', $post_id = null ) { |
592 | 592 | */ |
593 | 593 | function body_class( $class = '' ) { |
594 | 594 | // Separates class names with a single space, collates class names for body element. |
595 | | echo 'class="' . esc_attr( join( ' ', get_body_class( $class ) ) ) . '"'; |
| 595 | echo 'class="' . esc_attr( implode( ' ', get_body_class( $class ) ) ) . '"'; |
596 | 596 | } |
597 | 597 | |
598 | 598 | /** |
-
diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
index 32bfb1cac8..6e968f3f9f 100644
a
|
b
|
function wp_post_mime_type_where( $post_mime_types, $table_alias = '' ) { |
2955 | 2955 | } |
2956 | 2956 | |
2957 | 2957 | if ( ! empty( $wheres ) ) { |
2958 | | $where = ' AND (' . join( ' OR ', $wheres ) . ') '; |
| 2958 | $where = ' AND (' . implode( ' OR ', $wheres ) . ') '; |
2959 | 2959 | } |
2960 | 2960 | |
2961 | 2961 | return $where; |
… |
… |
function _prime_post_caches( $ids, $update_term_cache = true, $update_meta_cache |
7466 | 7466 | |
7467 | 7467 | $non_cached_ids = _get_non_cached_ids( $ids, 'posts' ); |
7468 | 7468 | if ( ! empty( $non_cached_ids ) ) { |
7469 | | $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", join( ',', $non_cached_ids ) ) ); |
| 7469 | $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", implode( ',', $non_cached_ids ) ) ); |
7470 | 7470 | |
7471 | 7471 | update_post_caches( $fresh_posts, 'any', $update_term_cache, $update_meta_cache ); |
7472 | 7472 | } |
-
diff --git a/src/wp-includes/shortcodes.php b/src/wp-includes/shortcodes.php
index d821caee9e..90ca735dae 100644
a
|
b
|
function get_shortcode_regex( $tagnames = null ) { |
252 | 252 | if ( empty( $tagnames ) ) { |
253 | 253 | $tagnames = array_keys( $shortcode_tags ); |
254 | 254 | } |
255 | | $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) ); |
| 255 | $tagregexp = implode( '|', array_map( 'preg_quote', $tagnames ) ); |
256 | 256 | |
257 | 257 | // WARNING! Do not change this regex without changing do_shortcode_tag() and strip_shortcode_tag(). |
258 | 258 | // Also, see shortcode_unautop() and shortcode.js. |
-
diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php
index e891af68d8..06fa0a0f47 100644
a
|
b
|
function wp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { |
2708 | 2708 | } |
2709 | 2709 | |
2710 | 2710 | if ( $values ) { |
2711 | | if ( false === $wpdb->query( "INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . join( ',', $values ) . ' ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)' ) ) { |
| 2711 | if ( false === $wpdb->query( "INSERT INTO $wpdb->term_relationships (object_id, term_taxonomy_id, term_order) VALUES " . implode( ',', $values ) . ' ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)' ) ) { |
2712 | 2712 | return new WP_Error( 'db_insert_error', __( 'Could not insert term relationship into the database.' ), $wpdb->last_error ); |
2713 | 2713 | } |
2714 | 2714 | } |
… |
… |
function _prime_term_caches( $term_ids, $update_meta_cache = true ) { |
4058 | 4058 | |
4059 | 4059 | $non_cached_ids = _get_non_cached_ids( $term_ids, 'terms' ); |
4060 | 4060 | if ( ! empty( $non_cached_ids ) ) { |
4061 | | $fresh_terms = $wpdb->get_results( sprintf( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s)", join( ',', array_map( 'intval', $non_cached_ids ) ) ) ); |
| 4061 | $fresh_terms = $wpdb->get_results( sprintf( "SELECT t.*, tt.* FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id WHERE t.term_id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); |
4062 | 4062 | |
4063 | 4063 | update_term_cache( $fresh_terms, $update_meta_cache ); |
4064 | 4064 | |
… |
… |
function the_taxonomies( $args = array() ) { |
4708 | 4708 | |
4709 | 4709 | $parsed_args = wp_parse_args( $args, $defaults ); |
4710 | 4710 | |
4711 | | echo $parsed_args['before'] . join( $parsed_args['sep'], get_the_taxonomies( $parsed_args['post'], $parsed_args ) ) . $parsed_args['after']; |
| 4711 | echo $parsed_args['before'] . implode( $parsed_args['sep'], get_the_taxonomies( $parsed_args['post'], $parsed_args ) ) . $parsed_args['after']; |
4712 | 4712 | } |
4713 | 4713 | |
4714 | 4714 | /** |
-
diff --git a/src/wp-includes/theme.php b/src/wp-includes/theme.php
index 5fa7a23146..a6ecad3ffe 100644
a
|
b
|
function get_theme_starter_content() { |
2149 | 2149 | 'text', |
2150 | 2150 | array( |
2151 | 2151 | 'title' => _x( 'Find Us', 'Theme starter content' ), |
2152 | | 'text' => join( |
| 2152 | 'text' => implode( |
2153 | 2153 | '', |
2154 | 2154 | array( |
2155 | 2155 | '<strong>' . _x( 'Address', 'Theme starter content' ) . "</strong>\n", |
-
diff --git a/src/wp-includes/widgets/class-wp-widget-custom-html.php b/src/wp-includes/widgets/class-wp-widget-custom-html.php
index a3314280b3..8412a4d371 100644
a
|
b
|
class WP_Widget_Custom_HTML extends WP_Widget { |
281 | 281 | <# if ( data.codeEditorDisabled ) { #> |
282 | 282 | <p> |
283 | 283 | <?php _e( 'Some HTML tags are not permitted, including:' ); ?> |
284 | | <code><?php echo join( '</code>, <code>', $disallowed_html ); ?></code> |
| 284 | <code><?php echo implode( '</code>, <code>', $disallowed_html ); ?></code> |
285 | 285 | </p> |
286 | 286 | <# } #> |
287 | 287 | <?php endif; ?> |
-
diff --git a/src/wp-includes/widgets/class-wp-widget-media-image.php b/src/wp-includes/widgets/class-wp-widget-media-image.php
index 01b7bae394..5ce3c9019a 100644
a
|
b
|
class WP_Widget_Media_Image extends WP_Widget_Media { |
219 | 219 | $width = empty( $caption_size[0] ) ? 0 : $caption_size[0]; |
220 | 220 | } |
221 | 221 | |
222 | | $image_attributes['class'] .= sprintf( ' attachment-%1$s size-%1$s', is_array( $size ) ? join( 'x', $size ) : $size ); |
| 222 | $image_attributes['class'] .= sprintf( ' attachment-%1$s size-%1$s', is_array( $size ) ? implode( 'x', $size ) : $size ); |
223 | 223 | |
224 | 224 | $image = wp_get_attachment_image( $attachment->ID, $size, false, $image_attributes ); |
225 | 225 | |
-
diff --git a/src/wp-includes/widgets/class-wp-widget-media.php b/src/wp-includes/widgets/class-wp-widget-media.php
index 9c0dc05275..59aeeeacdb 100644
a
|
b
|
abstract class WP_Widget_Media extends WP_Widget { |
208 | 208 | } |
209 | 209 | $tokens = array_map( 'sanitize_html_class', $tokens ); |
210 | 210 | $tokens = array_filter( $tokens ); |
211 | | return join( ' ', $tokens ); |
| 211 | return implode( ' ', $tokens ); |
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
… |
… |
abstract class WP_Widget_Media extends WP_Widget { |
343 | 343 | class="media-widget-instance-property" |
344 | 344 | name="<?php echo esc_attr( $this->get_field_name( $name ) ); ?>" |
345 | 345 | id="<?php echo esc_attr( $this->get_field_id( $name ) ); // Needed specifically by wpWidgets.appendTitle(). ?>" |
346 | | value="<?php echo esc_attr( is_array( $value ) ? join( ',', $value ) : (string) $value ); ?>" |
| 346 | value="<?php echo esc_attr( is_array( $value ) ? implode( ',', $value ) : (string) $value ); ?>" |
347 | 347 | /> |
348 | 348 | <?php |
349 | 349 | endforeach; |
-
diff --git a/tests/phpunit/includes/utils.php b/tests/phpunit/includes/utils.php
index 1546d4e973..b178418de7 100644
a
|
b
|
function strip_ws( $txt ) { |
28 | 28 | } |
29 | 29 | } |
30 | 30 | |
31 | | return trim( join( "\n", $result ) ); |
| 31 | return trim( implode( "\n", $result ) ); |
32 | 32 | } |
33 | 33 | |
34 | 34 | /* |
… |
… |
function xml_join_atts( $atts ) { |
275 | 275 | foreach ( $atts as $k => $v ) { |
276 | 276 | $a[] = $k . '="' . $v . '"'; |
277 | 277 | } |
278 | | return join( ' ', $a ); |
| 278 | return implode( ' ', $a ); |
279 | 279 | } |
280 | 280 | |
281 | 281 | function xml_array_dumbdown( &$data ) { |
… |
… |
function gen_tests_array( $name, $array ) { |
332 | 332 | $out[] = gen_tests_array( "{$name}[{$index}]", $v ); |
333 | 333 | } |
334 | 334 | } |
335 | | return join( "\n", $out ) . "\n"; |
| 335 | return implode( "\n", $out ) . "\n"; |
336 | 336 | } |
337 | 337 | |
338 | 338 | /** |
-
diff --git a/tests/phpunit/tests/customize/manager.php b/tests/phpunit/tests/customize/manager.php
index 015037012f..520e6683fd 100644
a
|
b
|
class Tests_WP_Customize_Manager extends WP_UnitTestCase { |
2719 | 2719 | foreach ( $error->errors as $code => $messages ) { |
2720 | 2720 | $this->assertArrayHasKey( $code, $validity ); |
2721 | 2721 | $this->assertInternalType( 'array', $validity[ $code ] ); |
2722 | | $this->assertSame( join( ' ', $messages ), $validity[ $code ]['message'] ); |
| 2722 | $this->assertSame( implode( ' ', $messages ), $validity[ $code ]['message'] ); |
2723 | 2723 | $this->assertArrayHasKey( 'data', $validity[ $code ] ); |
2724 | 2724 | $this->assertSame( $validity[ $code ]['data'], $error->get_error_data( $code ) ); |
2725 | 2725 | } |
-
diff --git a/tests/phpunit/tests/db.php b/tests/phpunit/tests/db.php
index 2ff9c65889..a75371636b 100644
a
|
b
|
class Tests_DB extends WP_UnitTestCase { |
489 | 489 | global $wpdb; |
490 | 490 | $str = $wpdb->get_caller(); |
491 | 491 | $calls = explode( ', ', $str ); |
492 | | $called = join( '->', array( __CLASS__, __FUNCTION__ ) ); |
| 492 | $called = implode( '->', array( __CLASS__, __FUNCTION__ ) ); |
493 | 493 | $this->assertSame( $called, end( $calls ) ); |
494 | 494 | } |
495 | 495 | |
-
diff --git a/tests/phpunit/tests/formatting/Autop.php b/tests/phpunit/tests/formatting/Autop.php
index 25e09d4c88..8a77c6879e 100644
a
|
b
|
Paragraph two.'; |
337 | 337 | $content[] = "<$block>foo</$block>"; |
338 | 338 | } |
339 | 339 | |
340 | | $expected = join( "\n", $content ); |
341 | | $input = join( "\n\n", $content ); // Whitespace difference. |
| 340 | $expected = implode( "\n", $content ); |
| 341 | $input = implode( "\n\n", $content ); // Whitespace difference. |
342 | 342 | |
343 | 343 | $this->assertSame( $expected, trim( wpautop( $input ) ) ); |
344 | 344 | |
345 | | $input = join( '', $content ); // Whitespace difference. |
| 345 | $input = implode( '', $content ); // Whitespace difference. |
346 | 346 | |
347 | 347 | $this->assertSame( $expected, trim( wpautop( $input ) ) ); |
348 | 348 | |
… |
… |
Paragraph two.'; |
353 | 353 | $content[] = "<$block/>"; |
354 | 354 | } |
355 | 355 | |
356 | | $expected = join( "\n", $content ); |
357 | | $input = join( '', $content ); |
| 356 | $expected = implode( "\n", $content ); |
| 357 | $input = implode( '', $content ); |
358 | 358 | |
359 | 359 | $this->assertSame( $expected, trim( wpautop( $input ) ) ); |
360 | 360 | |
… |
… |
Paragraph two.'; |
365 | 365 | $content[] = "<$block attr='value'>foo</$block>"; |
366 | 366 | } |
367 | 367 | |
368 | | $expected = join( "\n", $content ); |
369 | | $input = join( '', $content ); |
| 368 | $expected = implode( "\n", $content ); |
| 369 | $input = implode( '', $content ); |
370 | 370 | |
371 | 371 | $this->assertSame( $expected, trim( wpautop( $input ) ) ); |
372 | 372 | } |
… |
… |
Paragraph two.'; |
426 | 426 | $expected[] = "<p><$inline>foo</$inline></p>"; |
427 | 427 | } |
428 | 428 | |
429 | | $content = join( "\n\n", $content ); |
430 | | $expected = join( "\n", $expected ); |
| 429 | $content = implode( "\n\n", $content ); |
| 430 | $expected = implode( "\n", $expected ); |
431 | 431 | |
432 | 432 | $this->assertSame( $expected, trim( wpautop( $content ) ) ); |
433 | 433 | } |
-
diff --git a/tests/phpunit/tests/media.php b/tests/phpunit/tests/media.php
index 622ce7289b..32d62f6efd 100644
a
|
b
|
https://w.org</a>', |
512 | 512 | $ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg"; |
513 | 513 | } |
514 | 514 | |
515 | | $ids1_joined = join( ',', $ids1 ); |
516 | | $ids2_joined = join( ',', $ids2 ); |
| 515 | $ids1_joined = implode( ',', $ids1 ); |
| 516 | $ids2_joined = implode( ',', $ids2 ); |
517 | 517 | |
518 | 518 | $blob = <<<BLOB |
519 | 519 | [gallery ids="$ids1_joined"] |
… |
… |
BLOB; |
662 | 662 | $ids2_srcs[] = 'http://' . WP_TESTS_DOMAIN . '/wp-content/uploads/' . "image$i.jpg"; |
663 | 663 | } |
664 | 664 | |
665 | | $ids1_joined = join( ',', $ids1 ); |
666 | | $ids2_joined = join( ',', $ids2 ); |
| 665 | $ids1_joined = implode( ',', $ids1 ); |
| 666 | $ids2_joined = implode( ',', $ids2 ); |
667 | 667 | |
668 | 668 | $blob = <<<BLOB |
669 | 669 | [gallery ids="$ids1_joined"] |
-
diff --git a/tests/phpunit/tests/post/bodyClass.php b/tests/phpunit/tests/post/bodyClass.php
index dbe65fcd1a..aee0e1c8cd 100644
a
|
b
|
class Tests_Post_BodyClass extends WP_UnitTestCase { |
13 | 13 | } |
14 | 14 | |
15 | 15 | public function test_body_class() { |
16 | | $expected = 'class="' . join( ' ', get_body_class( '', $this->post_id ) ) . '"'; |
| 16 | $expected = 'class="' . implode( ' ', get_body_class( '', $this->post_id ) ) . '"'; |
17 | 17 | $this->expectOutputString( $expected ); |
18 | 18 | body_class( '', $this->post_id ); |
19 | 19 | } |
… |
… |
class Tests_Post_BodyClass extends WP_UnitTestCase { |
21 | 21 | public function test_body_class_extra_esc_attr() { |
22 | 22 | $classes = get_body_class( '', $this->post_id ); |
23 | 23 | $escaped_again = array_map( 'esc_attr', $classes ); |
24 | | $escaped_another_time = 'class="' . esc_attr( join( ' ', $escaped_again ) ) . '"'; |
| 24 | $escaped_another_time = 'class="' . esc_attr( implode( ' ', $escaped_again ) ) . '"'; |
25 | 25 | |
26 | 26 | $this->expectOutputString( $escaped_another_time ); |
27 | 27 | body_class( '', $this->post_id ); |
-
diff --git a/tests/phpunit/tests/post/postClass.php b/tests/phpunit/tests/post/postClass.php
index f8501e9dc1..3236e68e26 100644
a
|
b
|
class Tests_Post_PostClass extends WP_UnitTestCase { |
13 | 13 | } |
14 | 14 | |
15 | 15 | public function test_post_class() { |
16 | | $expected = 'class="' . join( ' ', get_post_class( '', $this->post_id ) ) . '"'; |
| 16 | $expected = 'class="' . implode( ' ', get_post_class( '', $this->post_id ) ) . '"'; |
17 | 17 | $this->expectOutputString( $expected ); |
18 | 18 | post_class( '', $this->post_id ); |
19 | 19 | } |
… |
… |
class Tests_Post_PostClass extends WP_UnitTestCase { |
21 | 21 | public function test_post_class_extra_esc_attr() { |
22 | 22 | $classes = get_post_class( '', $this->post_id ); |
23 | 23 | $escaped_again = array_map( 'esc_attr', $classes ); |
24 | | $escaped_another_time = 'class="' . esc_attr( join( ' ', $escaped_again ) ) . '"'; |
| 24 | $escaped_another_time = 'class="' . esc_attr( implode( ' ', $escaped_again ) ) . '"'; |
25 | 25 | |
26 | 26 | $this->expectOutputString( $escaped_another_time ); |
27 | 27 | post_class( '', $this->post_id ); |
-
diff --git a/tests/phpunit/tests/post/template.php b/tests/phpunit/tests/post/template.php
index dad6bf1d11..f1bcaebcf0 100644
a
|
b
|
class Tests_Post_Template extends WP_UnitTestCase { |
7 | 7 | |
8 | 8 | function test_wp_link_pages() { |
9 | 9 | $contents = array( 'One', 'Two', 'Three' ); |
10 | | $content = join( '<!--nextpage-->', $contents ); |
| 10 | $content = implode( '<!--nextpage-->', $contents ); |
11 | 11 | $post_id = self::factory()->post->create( array( 'post_content' => $content ) ); |
12 | 12 | |
13 | 13 | $this->go_to( '?p=' . $post_id ); |
-
diff --git a/tests/phpunit/tests/widgets/media-gallery-widget.php b/tests/phpunit/tests/widgets/media-gallery-widget.php
index 091b3b3c5f..d3ca909bcb 100644
a
|
b
|
class Test_WP_Widget_Media_Gallery extends WP_UnitTestCase { |
101 | 101 | |
102 | 102 | $this->assertTrue( wp_script_is( 'media-gallery-widget' ) ); |
103 | 103 | |
104 | | $after = join( '', wp_scripts()->registered['media-gallery-widget']->extra['after'] ); |
| 104 | $after = implode( '', wp_scripts()->registered['media-gallery-widget']->extra['after'] ); |
105 | 105 | $this->assertContains( 'wp.mediaWidgets.modelConstructors[ "media_gallery" ].prototype', $after ); |
106 | 106 | } |
107 | 107 | |