`is_user_logged_in()` is a pluggable function, and loaded after plugins are loaded. If a plugin calls `__()` too early, `is_user_logged_in()` is missing and WordPress will fatal. `get_user_locale()` already handles this scenario for us, so it's safe to rely on exclusively.
See #44758.
Fixes#45235.
Built from https://develop.svn.wordpress.org/branches/5.0@43846
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While the documentation for `add_meta_box()` specifices that `$callback_args` should be an array, this has never been enforced, and we have workarounds in place for when it's passed as something other than an array.
Rather than break sites that are passing unexpected data, we can quietly just allow for it, instead.
Props johnjamesjacoby, birgire.
Fixes#45206.
Built from https://develop.svn.wordpress.org/branches/5.0@43838
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The block editor needs to duplicate the classic meta box behaviour, so it can extract the registered meta boxes, and import them into the block editor.
To match the classic editor behaviour as closely as possible, this moves the relevant code from the classic editor, into a new function, so it can be called by both.
Props pento, peterwilsoncc.
Fixes#45172.
Built from https://develop.svn.wordpress.org/branches/5.0@43837
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Label elements should only be used for labelable elements.
- `Uploaded By` and `Uploaded To` aren't form controls and shouldn't be associated with labels
- changes the labels for media source, alternate sources, poster image, and tracks to solve a layout issue and explicitly associate the labels to their form fields (previously, the labels were wrapping also the Remove buttons)
Merges [42444] to the 5.0 branch.
Props Presskopp, afercia.
Fixes#38759, #40468.
Built from https://develop.svn.wordpress.org/branches/5.0@43829
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds the `wp_set_script_translations` function which registers translations for a JavaScript file. This function takes a handle, domain and optionally a path and ensures JavaScript translation files are loaded if they exist.
Props atimmer, omarreiss, nerrad, swissspidy, ocean90.
Fixes#45103.
Built from https://develop.svn.wordpress.org/branches/5.0@43825
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Instead of requiring the packages individually this commit changes it so the packages are used from the packages repository (gutenberg). This is a solution that makes updating the packages easier, as long as we don't have a monorepo to manage both WordPress & the JavaScript packages together.
Props youknowriad, gziolo, omarreiss, herregroen.
See #45145.
Built from https://develop.svn.wordpress.org/branches/5.0@43824
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adapts the response from `WP_oEmbed_Controller::get_proxy_item()` so that the response is correctly filtered and embeds work properly in JavaSccript editors. Introduces new `get_oembed_response_data_for_url()` function for preparing internal oEmbed responses.
Props danielbachhuber, imath, swissspidy.
Fixes#45142.
Built from https://develop.svn.wordpress.org/branches/5.0@43810
git-svn-id: http://core.svn.wordpress.org/branches/5.0@43639 1a063a9b-81f0-0310-95a4-ce76da25c4cd