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/comment.js src/wp-admin/js/comment.js
index d194148f60..3541a2f68b 100644
|
|
|
1 | 1 | /* global postboxes, commentL10n */ |
| 2 | |
| 3 | /** |
| 4 | * @summary Binds to the document ready event. |
| 5 | * |
| 6 | * @since 2.5.0 |
| 7 | * |
| 8 | * @param {jQuery} $ The jQuery object. |
| 9 | */ |
2 | 10 | jQuery(document).ready( function($) { |
3 | 11 | |
4 | 12 | postboxes.add_postbox_toggles('comment'); |
… |
… |
jQuery(document).ready( function($) { |
9 | 17 | $timestampwrap = $timestampdiv.find( '.timestamp-wrap' ), |
10 | 18 | $edittimestamp = $timestampdiv.siblings( 'a.edit-timestamp' ); |
11 | 19 | |
| 20 | /** |
| 21 | * @summary Adds event that opens the time stamp form if the form is hidden. |
| 22 | * |
| 23 | * @listens $edittimestamp:click |
| 24 | * |
| 25 | * @param {Event} event The event object. |
| 26 | * @returns {void} |
| 27 | */ |
12 | 28 | $edittimestamp.click( function( event ) { |
13 | 29 | if ( $timestampdiv.is( ':hidden' ) ) { |
| 30 | // Slide down the form and set focus on the first field. |
14 | 31 | $timestampdiv.slideDown( 'fast', function() { |
15 | 32 | $( 'input, select', $timestampwrap ).first().focus(); |
16 | 33 | } ); |
… |
… |
jQuery(document).ready( function($) { |
19 | 36 | event.preventDefault(); |
20 | 37 | }); |
21 | 38 | |
| 39 | /** |
| 40 | * @summary Resets the time stamp values when the cancel button is clicked. |
| 41 | * |
| 42 | * @listens .cancel-timestamp:click |
| 43 | * |
| 44 | * @param {Event} event The event object. |
| 45 | * @returns {void} |
| 46 | */ |
| 47 | |
22 | 48 | $timestampdiv.find('.cancel-timestamp').click( function( event ) { |
23 | 49 | // Move focus back to the Edit link. |
24 | 50 | $edittimestamp.show().focus(); |
… |
… |
jQuery(document).ready( function($) { |
32 | 58 | event.preventDefault(); |
33 | 59 | }); |
34 | 60 | |
| 61 | /** |
| 62 | * @summary Sets the time stamp values when the ok button is clicked. |
| 63 | * |
| 64 | * @listens .save-timestamp:click |
| 65 | * |
| 66 | * @param {Event} event The event object. |
| 67 | * @returns {void} |
| 68 | */ |
35 | 69 | $timestampdiv.find('.save-timestamp').click( function( event ) { // crazyhorse - multiple ok cancels |
36 | 70 | var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(), |
37 | 71 | newD = new Date( aa, mm - 1, jj, hh, mn ); |
diff --git src/wp-admin/js/custom-background.js src/wp-admin/js/custom-background.js
index c3f4e294f1..9e96015e75 100644
|
|
|
1 | 1 | /* global ajaxurl */ |
| 2 | |
| 3 | /** |
| 4 | * @summary Registers all events for customizing the background. |
| 5 | * |
| 6 | * @since 3.0.0 |
| 7 | * |
| 8 | * @requires jQuery |
| 9 | */ |
2 | 10 | (function($) { |
3 | 11 | $(document).ready(function() { |
4 | 12 | var frame, |
5 | 13 | bgImage = $( '#custom-background-image' ); |
6 | 14 | |
| 15 | /** |
| 16 | * @summary Instantiates the WordPress color picker and binds the change and clear events. |
| 17 | * |
| 18 | * @since 3.5.0 |
| 19 | * |
| 20 | * @returns {void} |
| 21 | */ |
7 | 22 | $('#background-color').wpColorPicker({ |
8 | 23 | change: function( event, ui ) { |
9 | 24 | bgImage.css('background-color', ui.color.toString()); |
… |
… |
|
13 | 28 | } |
14 | 29 | }); |
15 | 30 | |
| 31 | /** |
| 32 | * @summary Alters the background size CSS property whenever the background size input has changed. |
| 33 | * |
| 34 | * @since 4.7.0 |
| 35 | * |
| 36 | * @returns {void} |
| 37 | */ |
16 | 38 | $( 'select[name="background-size"]' ).change( function() { |
17 | 39 | bgImage.css( 'background-size', $( this ).val() ); |
18 | 40 | }); |
19 | 41 | |
| 42 | /** |
| 43 | * @summary Alters the background position CSS property whenever the background position input has changed. |
| 44 | * |
| 45 | * @since 4.7.0 |
| 46 | * |
| 47 | * @returns {void} |
| 48 | */ |
20 | 49 | $( 'input[name="background-position"]' ).change( function() { |
21 | 50 | bgImage.css( 'background-position', $( this ).val() ); |
22 | 51 | }); |
23 | 52 | |
| 53 | /** |
| 54 | * @summary Alters the background repeat CSS property whenever the background repeat input has changed. |
| 55 | * |
| 56 | * @since 3.0.0 |
| 57 | * |
| 58 | * @returns {void} |
| 59 | */ |
24 | 60 | $( 'input[name="background-repeat"]' ).change( function() { |
25 | 61 | bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' ); |
26 | 62 | }); |
27 | 63 | |
| 64 | /** |
| 65 | * @summary Alters the background attachment CSS property whenever the background attachment input has changed. |
| 66 | * |
| 67 | * @since 4.7.0 |
| 68 | * |
| 69 | * @returns {void} |
| 70 | */ |
28 | 71 | $( 'input[name="background-attachment"]' ).change( function() { |
29 | 72 | bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' ); |
30 | 73 | }); |
31 | 74 | |
| 75 | /** |
| 76 | * @summary Binds the event for opening the WP Media dialog. |
| 77 | * |
| 78 | * @since 3.5.0 |
| 79 | * |
| 80 | * @returns {void} |
| 81 | */ |
32 | 82 | $('#choose-from-library-link').click( function( event ) { |
33 | 83 | var $el = $(this); |
34 | 84 | |
… |
… |
|
54 | 104 | button: { |
55 | 105 | // Set the text of the button. |
56 | 106 | text: $el.data('update'), |
57 | | // Tell the button not to close the modal, since we're |
58 | | // going to refresh the page when the image is selected. |
| 107 | /* |
| 108 | * Tell the button not to close the modal, since we're |
| 109 | * going to refresh the page when the image is selected. |
| 110 | */ |
59 | 111 | close: false |
60 | 112 | } |
61 | 113 | }); |
62 | 114 | |
63 | | // When an image is selected, run a callback. |
| 115 | /** |
| 116 | * @summary When an image is selected, run a callback. |
| 117 | * |
| 118 | * @since 3.5.0 |
| 119 | * |
| 120 | * @returns {void} |
| 121 | */ |
64 | 122 | frame.on( 'select', function() { |
65 | 123 | // Grab the selected attachment. |
66 | 124 | var attachment = frame.state().get('selection').first(); |
diff --git src/wp-admin/js/media.js src/wp-admin/js/media.js
index e23adebb17..4c1dc58fc3 100644
|
|
|
1 | 1 | /* global ajaxurl, attachMediaBoxL10n, _wpMediaGridSettings, showNotice */ |
2 | 2 | |
| 3 | /** |
| 4 | * @summary Creates a dialog containing posts that can have a particular media attached to it. |
| 5 | * |
| 6 | * @since 2.7.0 |
| 7 | * |
| 8 | * @global |
| 9 | * @namespace |
| 10 | * |
| 11 | * @requires jQuery |
| 12 | */ |
3 | 13 | var findPosts; |
| 14 | |
4 | 15 | ( function( $ ){ |
5 | 16 | findPosts = { |
| 17 | /** |
| 18 | * @summary Opens a dialog to attach media to a post. |
| 19 | * |
| 20 | * Adds an overlay prior to retrieving a list of posts to attach the media to. |
| 21 | * |
| 22 | * @since 2.7.0 |
| 23 | * |
| 24 | * @memberOf findPosts |
| 25 | * |
| 26 | * @param {string} af_name The name of the affected element. |
| 27 | * @param {string} af_val The value of the affected post element. |
| 28 | * |
| 29 | * @returns {boolean} Always returns false. |
| 30 | */ |
6 | 31 | open: function( af_name, af_val ) { |
7 | 32 | var overlay = $( '.ui-find-overlay' ); |
8 | 33 | |
… |
… |
var findPosts; |
14 | 39 | overlay.show(); |
15 | 40 | |
16 | 41 | if ( af_name && af_val ) { |
| 42 | // #affected is a hidden input field in the dialog that keeps track of which media should be attached. |
17 | 43 | $( '#affected' ).attr( 'name', af_name ).val( af_val ); |
18 | 44 | } |
19 | 45 | |
20 | 46 | $( '#find-posts' ).show(); |
21 | 47 | |
| 48 | // Close the dialog when the escape key is pressed. |
22 | 49 | $('#find-posts-input').focus().keyup( function( event ){ |
23 | 50 | if ( event.which == 27 ) { |
24 | 51 | findPosts.close(); |
25 | | } // close on Escape |
| 52 | } |
26 | 53 | }); |
27 | 54 | |
28 | | // Pull some results up by default |
| 55 | // Retrieves a list of applicable posts for media attachment and shows them. |
29 | 56 | findPosts.send(); |
30 | 57 | |
31 | 58 | return false; |
32 | 59 | }, |
33 | 60 | |
| 61 | /** |
| 62 | * @summary Clears the found posts lists before hiding the attach media dialog. |
| 63 | * |
| 64 | * @since 2.7.0 |
| 65 | * |
| 66 | * @memberOf findPosts |
| 67 | * |
| 68 | * @returns {void} |
| 69 | */ |
34 | 70 | close: function() { |
35 | 71 | $('#find-posts-response').empty(); |
36 | 72 | $('#find-posts').hide(); |
37 | 73 | $( '.ui-find-overlay' ).hide(); |
38 | 74 | }, |
39 | 75 | |
| 76 | /** |
| 77 | * @summary Binds a click event listener to the overlay which closes the attach media dialog. |
| 78 | * |
| 79 | * @since 3.5.0 |
| 80 | * |
| 81 | * @memberOf findPosts |
| 82 | * |
| 83 | * @returns {void} |
| 84 | */ |
40 | 85 | overlay: function() { |
41 | 86 | $( '.ui-find-overlay' ).on( 'click', function () { |
42 | 87 | findPosts.close(); |
43 | 88 | }); |
44 | 89 | }, |
45 | 90 | |
| 91 | /** |
| 92 | * @summary Retrieves and displays posts based on the search term. |
| 93 | * |
| 94 | * Sends a post request to the admin_ajax.php, requesting posts based on the search term provided by the user. |
| 95 | * Defaults to all posts if no search term is provided. |
| 96 | * |
| 97 | * @since 2.7.0 |
| 98 | * |
| 99 | * @memberOf findPosts |
| 100 | * |
| 101 | * @returns {void} |
| 102 | */ |
46 | 103 | send: function() { |
47 | 104 | var post = { |
48 | 105 | ps: $( '#find-posts-input' ).val(), |
… |
… |
var findPosts; |
53 | 110 | |
54 | 111 | spinner.addClass( 'is-active' ); |
55 | 112 | |
| 113 | /** |
| 114 | * Send a POST request to admin_ajax.php, hide the spinner and replace the list of posts with the response data. |
| 115 | * If an error occurs, display it. |
| 116 | */ |
56 | 117 | $.ajax( ajaxurl, { |
57 | 118 | type: 'POST', |
58 | 119 | data: post, |
… |
… |
var findPosts; |
71 | 132 | } |
72 | 133 | }; |
73 | 134 | |
| 135 | /** |
| 136 | * @summary Initializes the file once the DOM is fully loaded and attaches events to the various form elements. |
| 137 | * |
| 138 | * @returns {void} |
| 139 | */ |
74 | 140 | $( document ).ready( function() { |
75 | 141 | var settings, $mediaGridWrap = $( '#wp-media-grid' ); |
76 | 142 | |
77 | | // Open up a manage media frame into the grid. |
| 143 | // Opens a manage media frame into the grid. |
78 | 144 | if ( $mediaGridWrap.length && window.wp && window.wp.media ) { |
79 | 145 | settings = _wpMediaGridSettings; |
80 | 146 | |
… |
… |
var findPosts; |
85 | 151 | }).open(); |
86 | 152 | } |
87 | 153 | |
| 154 | // Prevents form submission if no post has been selected. |
88 | 155 | $( '#find-posts-submit' ).click( function( event ) { |
89 | 156 | if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length ) |
90 | 157 | event.preventDefault(); |
91 | 158 | }); |
| 159 | |
| 160 | // Submits the search query when hitting the enter key in the search input. |
92 | 161 | $( '#find-posts .find-box-search :input' ).keypress( function( event ) { |
93 | 162 | if ( 13 == event.which ) { |
94 | 163 | findPosts.send(); |
95 | 164 | return false; |
96 | 165 | } |
97 | 166 | }); |
| 167 | |
| 168 | // Binds the click event to the search button. |
98 | 169 | $( '#find-posts-search' ).click( findPosts.send ); |
| 170 | |
| 171 | // Binds the close dialog click event. |
99 | 172 | $( '#find-posts-close' ).click( findPosts.close ); |
| 173 | |
| 174 | // Binds the bulk action events to the submit buttons. |
100 | 175 | $( '#doaction, #doaction2' ).click( function( event ) { |
| 176 | |
| 177 | /* |
| 178 | * Retrieves all select elements for bulk actions that have a name starting with `action` |
| 179 | * and handle its action based on its value. |
| 180 | */ |
101 | 181 | $( 'select[name^="action"]' ).each( function() { |
102 | 182 | var optionValue = $( this ).val(); |
103 | 183 | |
… |
… |
var findPosts; |
112 | 192 | }); |
113 | 193 | }); |
114 | 194 | |
115 | | // Enable whole row to be clicked |
| 195 | /** |
| 196 | * @summary Enables clicking on the entire table row. |
| 197 | * |
| 198 | * @returns {void} |
| 199 | */ |
116 | 200 | $( '.find-box-inside' ).on( 'click', 'tr', function() { |
117 | 201 | $( this ).find( '.found-radio input' ).prop( 'checked', true ); |
118 | 202 | }); |
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/class-wp-query.php src/wp-includes/class-wp-query.php
index baefec75b4..e20d574409 100644
|
|
class WP_Query { |
2405 | 2405 | * |
2406 | 2406 | * @since 1.5.0 |
2407 | 2407 | * |
2408 | | * @param string $where The JOIN clause of the query. |
| 2408 | * @param string $join The JOIN clause of the query. |
2409 | 2409 | * @param WP_Query &$this The WP_Query instance (passed by reference). |
2410 | 2410 | */ |
2411 | 2411 | $join = apply_filters_ref_array( 'posts_join', array( $join, &$this ) ); |
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 ) { |