Move the internals of `get_network_by_path()` to `WP_Network()` and allow network objects to be retrieved by passing a requested domain and path.
Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic.
See #31985.
git-svn-id: https://develop.svn.wordpress.org/trunk@34099 602fd350-edb4-49c9-b593-d223f7449a82
A `WP_Network` object initially matches a row from `wp_site` and is populated with additional properties used by WordPress core. The first iteration is used to retrieve an existing network based on data passed to the class.
* A network can be retrieved by its ID through `WP_Network::get_instance()`, following in the steps of `WP_Post` and `WP_Comment`.
* A network object can be created or completed by passing initial properties in as a standard object to `new WP_Network()`.
Using these methods, we are now able to populate the global `$current_site` during load via this class.
Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic.
See #31985.
git-svn-id: https://develop.svn.wordpress.org/trunk@34097 602fd350-edb4-49c9-b593-d223f7449a82
Adds an `$options` array argument to `WP_Screen::render_screen_options()` to allow the `div#screen-options-wrap` element to be omitted when `wrap` value is `false`.
Props afercia, westonruter.
Fixes#33182.
git-svn-id: https://develop.svn.wordpress.org/trunk@34093 602fd350-edb4-49c9-b593-d223f7449a82
Post type objects are reponsible for mapping their capabilities to core caps.
As a result, when the post type is no longer registered, the caps are no
longer mapped. This causes problems when a post is left in the database after
the post type is no longer present, and WP does an 'edit_post' or other cap
check against it: a PHP notice is thrown, and the cap check always fails.
As a more graceful fallback, we map all post-type-dependent caps onto
'edit_others_posts', which allows highly privileged users to be able to
access orphaned content (such as comments belonging to disabled post types),
while minimizing the possibility of unintended privilege escalation.
We also add a `_doing_it_wrong()` notice, so that developers and site
administrators are aware that the cap mapping is failing in the absence of
the registered post type.
Props mitchoyoshitaka, DrewAPicture, imath, codeelite, boonebgorges, nofearinc, SergeyBiryukov, jorbin, dlh.
Fixes#16956.
git-svn-id: https://develop.svn.wordpress.org/trunk@34091 602fd350-edb4-49c9-b593-d223f7449a82
By forcing all clause keys to be strings, we make it possible to use strict
comparison when validating values of 'orderby' as passed to `WP_Query`. This
eliminates situations where the presence of numeric clause keys could result
in an improperly validated 'orderby' value.
Props nikolov.tmw.
Fixes#32937.
git-svn-id: https://develop.svn.wordpress.org/trunk@34090 602fd350-edb4-49c9-b593-d223f7449a82
Since [29248], a table join has not been necessary to process the
`$excluded_terms` parameter of `get_adjacent_post()`. Aside from adding extra
overhead, this join meant that post records that don't have any corresponding
rows in `wp_term_relationships` were erroneously excluded from results.
Fixes#32833.
git-svn-id: https://develop.svn.wordpress.org/trunk@34088 602fd350-edb4-49c9-b593-d223f7449a82
* `_WP_Editors::wp_mce_translation()` can't be changed without changing strings in TinyMCE and plugins.
* `\u2026` is escaped by `json_encode()` to `\\u2026`, makes `\u2026` visible in our UI.
See #32875.
git-svn-id: https://develop.svn.wordpress.org/trunk@34087 602fd350-edb4-49c9-b593-d223f7449a82
Also ensure that the Months dropdown, when it is shown, shows months from the proper set of posts.
Props egower, CoenJacobs, MikeHansenMe, mehulkaklotar.
Fixes#33824, #21015, #21856.
git-svn-id: https://develop.svn.wordpress.org/trunk@34076 602fd350-edb4-49c9-b593-d223f7449a82
Setting the default value of the `queried_object_id` property to `0` meant
that, when called early enough in the WP bootstrap, `get_queried_object()`
could short-circuit the normal query by fooling it into thinking that the
request was for a page with id 0. Setting the default value to `null` instead
avoids this problem.
Props gradyetc, jazbek.
Fixes#31355.
git-svn-id: https://develop.svn.wordpress.org/trunk@34073 602fd350-edb4-49c9-b593-d223f7449a82
Be sure to hide the `jquery.suggest` Tags textarea tooltip also when using the keyboard to Save/Cancel.
Props rommelxcastro for the initial patch.
Fixes#32580.
git-svn-id: https://develop.svn.wordpress.org/trunk@34064 602fd350-edb4-49c9-b593-d223f7449a82
Use feature detection to determine whether password inputs should use the `keyup` or `input` event.
Props peterwilsoncc, adamsilverstein.
Fixes#33398.
git-svn-id: https://develop.svn.wordpress.org/trunk@34060 602fd350-edb4-49c9-b593-d223f7449a82
Prevents a JavaScript error for rare cases when cropping is skipped and the image is smaller than `thumbnail`.
Props tyxla.
Fixes#33417.
git-svn-id: https://develop.svn.wordpress.org/trunk@34056 602fd350-edb4-49c9-b593-d223f7449a82
The position of periods is different in some languages, like Japanese. This removes the period from the last placeholder for the Template Hierarchy section. It doesn't include a new period to avoid a string change in a minor release.
Props extendwings, chriscct7.
Fixes#33429.
git-svn-id: https://develop.svn.wordpress.org/trunk@34054 602fd350-edb4-49c9-b593-d223f7449a82