`the_post()` sets the `$in_the_loop` property to true which is unexpected in the admin if you're using filters which should only affect real loops.
Props ruud@joyo.
Fixes#27042.
git-svn-id: https://develop.svn.wordpress.org/trunk@37881 602fd350-edb4-49c9-b593-d223f7449a82
This adds the missing `$post` reference in the inline docblock for
the `wp_edit_form_attachment_display` hook after [37879].
Props DrewAPicture.
See 36052.
git-svn-id: https://develop.svn.wordpress.org/trunk@37880 602fd350-edb4-49c9-b593-d223f7449a82
This adds a new action hook, `wp_edit_form_attachment_display` to
`edit_form_image_editor()`, which can be used as a fallback to render
previews of an attachment that isn't an image, audio, or video file
included in the media library.
Props georgestephanis.
Fixes#36502.
git-svn-id: https://develop.svn.wordpress.org/trunk@37879 602fd350-edb4-49c9-b593-d223f7449a82
In [37657], the `blog_id` and `site_id` properties were changed to private. Any `WP_Site` objects previously stored in cache with public properties should now be considered invalid. We can detect this by checking for these missing properties and clearing the dirty cache if found.
Props flixos90.
Fixes#36717.
git-svn-id: https://develop.svn.wordpress.org/trunk@37874 602fd350-edb4-49c9-b593-d223f7449a82
The `blog_id` property is always returned (and expected) as a string, so we should set it as one by default.
Props flixos90.
See #36717.
git-svn-id: https://develop.svn.wordpress.org/trunk@37871 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a second uncached query used to determine found rows. Instead, we can cache the number of found sites and the max number of pages for reuse when the same query is requested in the future.
Props spacedmonkey.
See #35791.
git-svn-id: https://develop.svn.wordpress.org/trunk@37868 602fd350-edb4-49c9-b593-d223f7449a82
Moves definitions of functions outside of a `jQuery.ready()` callback, as these functions needn't be deferred to DOM ready. This change also ensures that the functions are available if `customize-controls` is enqueued outside of the Customizer context, as the ready callback short-circuits if `_wpCustomizeSettings` is not defined. The `findControlsForSettings` and `_handleSettingValidities` functions were misplaced in r37700.
See #34893.
See #36944.
See #29071.
git-svn-id: https://develop.svn.wordpress.org/trunk@37867 602fd350-edb4-49c9-b593-d223f7449a82
When no valid post exists for `get_the_modified_time` or `get_the_modified_date` calls, the result (`false`) is passed through the functions respective filters to maintain back-compat.
Introduces unit tests to ensure filters are applied and for the `get_the_modified_date` function.
Fixes#37059.
git-svn-id: https://develop.svn.wordpress.org/trunk@37866 602fd350-edb4-49c9-b593-d223f7449a82
When a filter or action hook is deprecated, the corresponding `apply_filters()`
or `do_action()` calls should be switched out with `apply_filters_deprecated()`
or `do_action_deprecated()`. The latter functions will throw a deprecation
before invoking the original hook.
Props solarissmoke, SergeyBiryukov, DrewAPicture.
Fixes#10441.
git-svn-id: https://develop.svn.wordpress.org/trunk@37861 602fd350-edb4-49c9-b593-d223f7449a82
In order to allow meta-related values of `orderby` to be handled properly,
the term query's `meta_query` object must run its `get_sql()` method before
`orderby` parsing.
Fixing this bug required addressing another bug in `WP_Meta_Query`, which
caused the table alias index not to be reset when calling `get_sql()`
multiple times on the same object.
Props littler.chicken.
Fixes#37151.
git-svn-id: https://develop.svn.wordpress.org/trunk@37860 602fd350-edb4-49c9-b593-d223f7449a82
We prompt when deleting a single item from the Media Library, but not when deleting multiple items. This inconsistency is now rectified.
Props southp.
Fixes#28235.
git-svn-id: https://develop.svn.wordpress.org/trunk@37859 602fd350-edb4-49c9-b593-d223f7449a82
This adds a new `post_stuck` action that fires when a post is made sticky and a `post_unstuck` action that fires when the sticky flag is removed again.
Props ojrask.
Fixes#35600.
git-svn-id: https://develop.svn.wordpress.org/trunk@37857 602fd350-edb4-49c9-b593-d223f7449a82
This allows one to short-circuit its output before any queries are run, similar to how it was done for the months dropdown in [31438].
Props davidmosterd for initial patch.
Fixes#36152.
git-svn-id: https://develop.svn.wordpress.org/trunk@37856 602fd350-edb4-49c9-b593-d223f7449a82
[37415] removed the requirement to call `load_plugin_textdomain()` / `load_theme_textdomain()`. This caused `unload_textdomain()` to not work properly anymore in these cases.
With this change, unloaded text domains need to be explicitly loaded manually if you want to use them again.
Props swissspidy, ocean90.
Fixes#37113. See #34114.
git-svn-id: https://develop.svn.wordpress.org/trunk@37855 602fd350-edb4-49c9-b593-d223f7449a82
Introduced in [23811], WordPress displayed some additional information for restored revisions for a short period of time. This was removed again in [25194], but the meta data was still being saved unnecessarily.
After 3 years and no plugins ever using this meta data, it's time to stop collecting it.
Fixes#36526.
git-svn-id: https://develop.svn.wordpress.org/trunk@37854 602fd350-edb4-49c9-b593-d223f7449a82
Removes passing a `null` value for the back-compat only `data` parameter to `_.template`.
Props jnylen0.
Fixes#36695.
git-svn-id: https://develop.svn.wordpress.org/trunk@37851 602fd350-edb4-49c9-b593-d223f7449a82
This allows the `ms_site_check` filter or `is_super_admin()` check to return `true` before `get_blog_details()` is used.
Props danielbachhuber.
Fixes#37118.
git-svn-id: https://develop.svn.wordpress.org/trunk@37850 602fd350-edb4-49c9-b593-d223f7449a82
This changes the binding of event listeners in the Attachments Browser
to use `on` instead of `listenTo` for the `attachment:keydown:arrow` and
`attachment:details:shift-tab` events. The existing listeners broke
when we upgraded Backbone in [36546].
Props adamsilverstein.
Fixes#36900.
git-svn-id: https://develop.svn.wordpress.org/trunk@37755 602fd350-edb4-49c9-b593-d223f7449a82
The return from `wp_logout_url()` is HTML-encoded due to its value passing through `wp_nonce_url()` and thus `esc_html()`. Adversely `wp_login_url()` passes through no such escaping and therefore should not be expected to return an HTML-encoded value.
Props akibjorklund for the initial patch.
Fixes#34352.
git-svn-id: https://develop.svn.wordpress.org/trunk@37753 602fd350-edb4-49c9-b593-d223f7449a82
- Add white outline for contrast on darker backgrounds.
- Change red colour in toolbar.
Props iseulde. Props rockwell15 for the initial patch.
See #36638.
git-svn-id: https://develop.svn.wordpress.org/trunk@37751 602fd350-edb4-49c9-b593-d223f7449a82
[37748] introduced `_wp_expand_nav_menu_post_data()` together with an `array_replace_recursive()` compatibility function for PHP 5.2.
Even though that compat function is tried and tested in other projects like BuddyPress, we need to add additional `isset()` checks in order to avoid 'Undefined index' notices in our case.
See #36590.
git-svn-id: https://develop.svn.wordpress.org/trunk@37750 602fd350-edb4-49c9-b593-d223f7449a82
[36510] allowed larger menus to be created in the Edit Menu screen by JSON-encoding the entire form into a single input field. However, it did not correctly handle nested arrays.
This introduces a new `_wp_expand_nav_menu_post_data()` helper function to handle this POST data which uses `array_replace_recursive()` internally. Since the latter is only available on PHP 5.3+, we add a compatibility function to ensure PHP 5.2 support.
Props ericlewis, neverything, swissspidy.
Fixes#36590 for trunk. See #14134.
git-svn-id: https://develop.svn.wordpress.org/trunk@37748 602fd350-edb4-49c9-b593-d223f7449a82