diff --git src/wp-admin/includes/class-wp-community-events.php src/wp-admin/includes/class-wp-community-events.php
index cfe12fd52c..211d37ea5e 100644
|
|
class WP_Community_Events { |
107 | 107 | } elseif ( 200 !== $response_code ) { |
108 | 108 | $response_error = new WP_Error( |
109 | 109 | 'api-error', |
110 | | /* translators: %s is a numeric HTTP status code; e.g., 400, 403, 500, 504, etc. */ |
| 110 | /* translators: %d: numeric HTTP status code, e.g. 400, 403, 500, 504, etc. */ |
111 | 111 | sprintf( __( 'Invalid API response code (%d)' ), $response_code ) |
112 | 112 | ); |
113 | 113 | } elseif ( ! isset( $response_body['location'], $response_body['events'] ) ) { |
diff --git src/wp-admin/js/tags.js src/wp-admin/js/tags.js
index fc923f1f8d..c35efaa177 100644
|
|
|
1 | 1 | /* global ajaxurl, wpAjax, tagsl10n, showNotice, validateForm */ |
| 2 | /** |
| 3 | * Contains logic for both adding and deleting tags. For deleting tags it makes a request |
| 4 | * to the server to delete the tag. For adding tags it makes a request to the server to |
| 5 | * add the tag. |
| 6 | * |
| 7 | * @summary Contains logic for deleting and adding tags |
| 8 | */ |
2 | 9 | |
3 | 10 | jQuery(document).ready(function($) { |
4 | 11 | |
| 12 | /** |
| 13 | * @summary Adds an event handler to the delete term link on the term overview page. |
| 14 | * |
| 15 | * Adds an event handler to the delete term link on the term overview page. |
| 16 | * Cancels default event handling and event bubbling. |
| 17 | * |
| 18 | * @since 2.8.0 |
| 19 | * |
| 20 | * @returns boolean Always returns false to cancel the default event handling. |
| 21 | */ |
5 | 22 | $( '#the-list' ).on( 'click', '.delete-tag', function() { |
6 | 23 | var t = $(this), tr = t.parents('tr'), r = true, data; |
| 24 | |
7 | 25 | if ( 'undefined' != showNotice ) |
8 | 26 | r = showNotice.warn(); |
| 27 | |
9 | 28 | if ( r ) { |
10 | 29 | data = t.attr('href').replace(/[^?]*\?/, '').replace(/action=delete/, 'action=delete-tag'); |
| 30 | |
| 31 | /** |
| 32 | * @summary Makes a request to the server to delete the term that |
| 33 | * corresponds to the delete term button. |
| 34 | * |
| 35 | * @param {string} r The response from the server. |
| 36 | * |
| 37 | * @returns {void} |
| 38 | */ |
11 | 39 | $.post(ajaxurl, data, function(r){ |
12 | 40 | if ( '1' == r ) { |
13 | 41 | $('#ajax-response').empty(); |
14 | 42 | tr.fadeOut('normal', function(){ tr.remove(); }); |
15 | | // Remove the term from the parent box and tag cloud |
| 43 | |
| 44 | /** |
| 45 | * @summary Remove the term from the parent box and the tag cloud |
| 46 | * |
| 47 | * `data.match(/tag_ID=(\d+)/)[1]` matches the term id from the data variable. |
| 48 | * This term id is then used to select the relevant HTML elements: |
| 49 | * The parent box and the tag cloud. |
| 50 | */ |
16 | 51 | $('select#parent option[value="' + data.match(/tag_ID=(\d+)/)[1] + '"]').remove(); |
17 | 52 | $('a.tag-link-' + data.match(/tag_ID=(\d+)/)[1]).remove(); |
| 53 | |
18 | 54 | } else if ( '-1' == r ) { |
19 | 55 | $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.noPerm + '</p></div>'); |
20 | 56 | tr.children().css('backgroundColor', ''); |
| 57 | |
21 | 58 | } else { |
22 | 59 | $('#ajax-response').empty().append('<div class="error"><p>' + tagsl10n.broken + '</p></div>'); |
23 | 60 | tr.children().css('backgroundColor', ''); |
24 | 61 | } |
25 | 62 | }); |
| 63 | |
26 | 64 | tr.children().css('backgroundColor', '#f33'); |
27 | 65 | } |
| 66 | |
28 | 67 | return false; |
29 | 68 | }); |
30 | 69 | |
| 70 | /** |
| 71 | * Adds a deletion confirmation when removing a tag. |
| 72 | * |
| 73 | * @since 4.8.0 |
| 74 | * |
| 75 | * @returns {void} |
| 76 | */ |
31 | 77 | $( '#edittag' ).on( 'click', '.delete', function( e ) { |
32 | 78 | if ( 'undefined' === typeof showNotice ) { |
33 | 79 | return true; |
34 | 80 | } |
35 | 81 | |
| 82 | // Confirms the deletion, a negative response means the deletion must not be executed. |
36 | 83 | var response = showNotice.warn(); |
37 | 84 | if ( ! response ) { |
38 | 85 | e.preventDefault(); |
39 | 86 | } |
40 | 87 | }); |
41 | 88 | |
| 89 | /** |
| 90 | * @summary Adds an event handler tot he form submit on the term overview page. |
| 91 | * |
| 92 | * Cancels default event handling and event bubbling. |
| 93 | * |
| 94 | * @since 2.8.0 |
| 95 | * |
| 96 | * @returns boolean Always returns false to cancel the default event handling. |
| 97 | */ |
42 | 98 | $('#submit').click(function(){ |
43 | 99 | var form = $(this).parents('form'); |
44 | 100 | |
45 | 101 | if ( ! validateForm( form ) ) |
46 | 102 | return false; |
47 | 103 | |
| 104 | /** |
| 105 | * Does a request to the server to add a new term to the database |
| 106 | * |
| 107 | * @param {string} r The response from the server. |
| 108 | * |
| 109 | * @returns {void} |
| 110 | */ |
48 | 111 | $.post(ajaxurl, $('#addtag').serialize(), function(r){ |
49 | 112 | var res, parent, term, indent, i; |
50 | 113 | |
diff --git src/wp-content/themes/twentysixteen/inc/template-tags.php src/wp-content/themes/twentysixteen/inc/template-tags.php
index eb87203062..fa1ad8efed 100644
|
|
function twentysixteen_categorized_blog() { |
213 | 213 | set_transient( 'twentysixteen_categories', $all_the_cool_cats ); |
214 | 214 | } |
215 | 215 | |
216 | | if ( $all_the_cool_cats > 1 ) { |
| 216 | if ( $all_the_cool_cats > 1 || is_preview() ) { |
217 | 217 | // This blog has more than 1 category so twentysixteen_categorized_blog should return true. |
218 | 218 | return true; |
219 | 219 | } else { |
diff --git src/wp-includes/class-wp-editor.php src/wp-includes/class-wp-editor.php
index 8879797914..73de84de2b 100644
|
|
final class _WP_Editors { |
144 | 144 | * @static |
145 | 145 | * @param string $content The initial content of the editor. |
146 | 146 | * @param string $editor_id ID for the textarea and TinyMCE and Quicktags instances (can contain only ASCII letters and numbers). |
147 | | * @param array $settings See the _parse_settings() method for description. |
| 147 | * @param array $settings See _WP_Editors()::parse_settings() for description. |
148 | 148 | */ |
149 | 149 | public static function editor( $content, $editor_id, $settings = array() ) { |
150 | 150 | $set = self::parse_settings( $editor_id, $settings ); |
diff --git src/wp-includes/functions.php src/wp-includes/functions.php
index 966dcd8265..828f123491 100644
|
|
function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { |
158 | 158 | * |
159 | 159 | * @since 4.4.0 |
160 | 160 | * |
| 161 | * @global WP_Locale $wp_locale |
| 162 | * |
161 | 163 | * @param string $date Formatted date string. |
162 | 164 | * @return string The date, declined if locale specifies it. |
163 | 165 | */ |
diff --git src/wp-includes/vars.php src/wp-includes/vars.php
index 2e97c9a0ae..89b3532327 100644
|
|
function wp_is_mobile() { |
139 | 139 | $is_mobile = false; |
140 | 140 | } |
141 | 141 | |
142 | | return $is_mobile; |
| 142 | /** |
| 143 | * Filters whether the request should be treated as coming from a mobile device or not. |
| 144 | * |
| 145 | * @since 4.9.0 |
| 146 | * |
| 147 | * @param bool $is_mobile Whether the request is from a mobile device or not. |
| 148 | */ |
| 149 | return apply_filters( 'wp_is_mobile', $is_mobile ); |
143 | 150 | } |
diff --git src/wp-includes/wp-db.php src/wp-includes/wp-db.php
index 74dedd5130..2c9cceabf7 100644
|
|
class wpdb { |
3268 | 3268 | * |
3269 | 3269 | * @param string $db_cap The feature to check for. Accepts 'collation', |
3270 | 3270 | * 'group_concat', 'subqueries', 'set_charset', |
3271 | | * or 'utf8mb4'. |
| 3271 | * 'utf8mb4', or 'utf8mb4_520'. |
3272 | 3272 | * @return int|false Whether the database feature is supported, false otherwise. |
3273 | 3273 | */ |
3274 | 3274 | public function has_cap( $db_cap ) { |