* In `WP_Importer->is_user_over_quota()`, the default value for the first argument for `upload_is_user_over_quota()` is `true`. Don't bother passing `1`.
* When calling `submit_button()` with no `$name`, pass empty string instead of `false`.
* The default value for the 2nd argument to `get_edit_post_link()` is `'display'`. Because PHP is PHP, passing `true` is the same as passing `'display'` or nothing. Don't bother passing `true`.
* In `WP_User_Meta_Session_Tokens::drop_sessions()`, pass `0` instead of `false` to `delete_metadata()` as the value for `$object_id`, which expects an int.
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@31220 602fd350-edb4-49c9-b593-d223f7449a82
* `get_metadata()` will return literally anything, needs to be `mixed`
* `wp()` and `WP_Query::__construct()` no longer just take a query string
* Clarify a few others
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@31212 602fd350-edb4-49c9-b593-d223f7449a82
`WP_List_Table` is essentially an `abstract` class. Some of its methods throw `die()` warnings if they aren't overridden in a child class.
These noop methods wouldn't be `abstract`, because they are not required in subclasses. However, `WP_List_Table` can call these methods in its own method, `->single_row_columns()`, whether a subclass defined them or not.
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@31210 602fd350-edb4-49c9-b593-d223f7449a82
Unused since [8009] - "Make WP_Filesystem work with new directory constants"
There is currently no declared field and no `@property` annotation.
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@31209 602fd350-edb4-49c9-b593-d223f7449a82
`embed` is the only shortcode that requires a post ID. This will allow MCE views to work for `playlist`, `audio`, and `video` outside of the Edit Post screen.
See #30835.
git-svn-id: https://develop.svn.wordpress.org/trunk@31201 602fd350-edb4-49c9-b593-d223f7449a82
In PHP 5.3.0, `is_a()` is no longer deprecated, and will therefore no longer throw `E_STRICT` warnings.
To avoid warnings in PHP < 5.3.0, convert all `is_a()` calls to `$var instanceof WP_Class` calls.
`instanceof` does not throw any error if the variable being tested is not an object, it simply returns `false`.
Props markoheijnen, wonderboymusic.
Fixes#25672.
git-svn-id: https://develop.svn.wordpress.org/trunk@31188 602fd350-edb4-49c9-b593-d223f7449a82
Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the `.alternate` class for now. IE8 and below gracefully degrade by not having zebra striping.
There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.
fixes#30981 and #26060. see #25060.
git-svn-id: https://develop.svn.wordpress.org/trunk@31181 602fd350-edb4-49c9-b593-d223f7449a82
[29863] made the corresponding change in `term_exists()`. Failure to change the
default value in `category_exists()` meant that an unspecified value for
`$parent` would limit results to top-level categories.
Includes unit tests and corrected function documentation.
Props hissy.
Fixes#30975 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@31140 602fd350-edb4-49c9-b593-d223f7449a82
Add `@property` annotations to `WP_User` and `WP_Post`.
Remove erroneous `@param`s from image editor class methods.
Officially add the property `$_column_headers` to `WP_List_Table`.
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@31127 602fd350-edb4-49c9-b593-d223f7449a82
* In `WP_Plugin_Install_List_Table`, use `public` instead of `var`
* In `WP_User`, `->data` is accessed directly on an instance if the constructor receives it: make it `public`
* In `WP_Locale`, every property is exported to a global and is already `public` via `var`, half of the properties are accessed directly already, make them all `public`
* In `WP_Rewrite`, several properties are accessed publicly in functions via the `$wp_rewrite` global, make those props `public`.
* In `WP_Rewrite`, the property `->comment_feed_structure` was misspelled as `->comments_feed_structure`
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@31078 602fd350-edb4-49c9-b593-d223f7449a82
`text/javascript` is obsolete, `application/x-javascript` was experimental. `application/javascript` is the recommended type per RFC 4329.
Props sergej.mueller.
Fixes#29196.
git-svn-id: https://develop.svn.wordpress.org/trunk@31029 602fd350-edb4-49c9-b593-d223f7449a82
* Bump MediaElement script loader versions to 2.16.2 - missed in [30634], oops!
* Add `Froogaloop` to `js/mediaelement` scripts for Vimeo
* Check for Vimeo in the same locations that YouTube is checked
* Dynamically load Froogaloop script in admin when editing a TinyMCE view
* Edit MediaElement to call `mejs.$.extend` instead of `$.extend` in `mejs.HtmlMediaElementShim.createPlugin()`, since `$` is not available via WP's jQuery (I will report this upstream):
6f9a78e008/src/js/me-shim.js (L631)Fixes#29267.
git-svn-id: https://develop.svn.wordpress.org/trunk@31016 602fd350-edb4-49c9-b593-d223f7449a82
This creates parity with the behavior of the function when plugins *are* active,
but none are invalid. It also makes it possible to write unit tests for the
function.
Props sgrant.
Fixes#30860.
git-svn-id: https://develop.svn.wordpress.org/trunk@31003 602fd350-edb4-49c9-b593-d223f7449a82
* Declare `$extra_items` property
* Since `->get_column_info()` overrides its parent's method, it doesn't need to set `_column_headers`, which is an undeclared property that is only used for caching the lookup after the first run in the parent class, which isn't called in the child class.
* `$_args` in `WP_List_Table` has to be `protected` for `WP_Post_Comments_List_Table` to legally access it. `$_args` is awkward as is and should probably be only available via a getter.
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@30984 602fd350-edb4-49c9-b593-d223f7449a82
* Declare `$out` as an empty array - this is not a strict PHP requirement, but is a good practice before loops
* Most of this function was tabbed twice, instead of once
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@30981 602fd350-edb4-49c9-b593-d223f7449a82
`$file` was essentially getting declared/overwritten 3 times. In lieu of this, return an array containing the error immediately instead of doing a short-circuit array key assignment on error. Rename the local variable to `$upload` and use its properties instead of creating 3 new local vars, one of which stomped the array.
See #30799.
git-svn-id: https://develop.svn.wordpress.org/trunk@30980 602fd350-edb4-49c9-b593-d223f7449a82
* Include a message and a disabled button when you're only logged in at one location.
* Avoid leaking the session token in HTML.
* Simplify, simplify, simplify.
see #30264.
git-svn-id: https://develop.svn.wordpress.org/trunk@30888 602fd350-edb4-49c9-b593-d223f7449a82
This makes it match most cache-clearing functions, including the ones it wraps. Also no need for it to be prefixed as "private."
wp_clean_plugins_cache() doesn't always exist, so as a quick fix, clear the transient we care to clear.
see #30369.
git-svn-id: https://develop.svn.wordpress.org/trunk@30856 602fd350-edb4-49c9-b593-d223f7449a82
The style for marking parameters optional in inline PHP docs is: `@param type $var Optional. Description. Accepts. Default.`, where Accepts can be omitted on a case-by-case basis.
Props coffee2code.
Fixes#30591.
git-svn-id: https://develop.svn.wordpress.org/trunk@30753 602fd350-edb4-49c9-b593-d223f7449a82
`urlencode()` was introduced in [28553] via _duck and yours truly.
Got weirder after [29625].
Props birgire.
Fixes#30123.
git-svn-id: https://develop.svn.wordpress.org/trunk@30661 602fd350-edb4-49c9-b593-d223f7449a82
Including:
* Add a correct type (array) for the `$changes` parameter
* Add the `@since` version
* Add proper descriptions for both parameters and the return value.
Props tillkruess for the initial patch.
See #30508.
git-svn-id: https://develop.svn.wordpress.org/trunk@30644 602fd350-edb4-49c9-b593-d223f7449a82
Also properly mark the parameter as optional and specify the default value.
Props jaimieolmstead for the initial patch.
Fixes#30540.
git-svn-id: https://develop.svn.wordpress.org/trunk@30627 602fd350-edb4-49c9-b593-d223f7449a82
Previously, it was being overridden after the default post had been inserted
into the database, making it cumbersome to override with the 'wp_insert_post_data'
filter.
Props danielbachhuber.
Fixes#29847.
git-svn-id: https://develop.svn.wordpress.org/trunk@30626 602fd350-edb4-49c9-b593-d223f7449a82
Includes hyphenating 'drop-down', ensuring the DocBlock itself is correctly indented, and wraps lines at an appropriate length.
See #30469.
git-svn-id: https://develop.svn.wordpress.org/trunk@30601 602fd350-edb4-49c9-b593-d223f7449a82
If the token is set (`$keep` is a string), this means the user is viewing their own profile-editing screen and destroying their own sessions (except the current one). If it isn't set (`$keep` is null), the user is editing another user's profile and destroying all of their sessions with no exceptions.
See #30264, #30469
git-svn-id: https://develop.svn.wordpress.org/trunk@30595 602fd350-edb4-49c9-b593-d223f7449a82
The update screen has a re-install button which could show the wrong language locale after the site language was changed. That's because the update data is cached.
Introduce `_wp_clear_update_cache()` as a helper function to clean up the update cache.
props SergeyBiryukov, ocean90.
fixes#30369.
git-svn-id: https://develop.svn.wordpress.org/trunk@30554 602fd350-edb4-49c9-b593-d223f7449a82
Affects DocBlocks for the following core elements:
* Backtick-escape code snippets in the description for `get_object_taxonomies()`
* Backtick-escape inline code in a markdown-formatted unordered list in the description for `get_taxonomy_labels()`
* Remove an HTML tag from the summary for the `Walker_Category_Checklist` class
* Remove an HTML tag from the summary for `wp_category_checklist()`, various formatting
* Remove an HTML tag from the summary for `wp_terms_checklist()`
* Backtick-escape an HTML tag in the description for `wp_popular_terms_checklist()`
* Remove HTML tags from the summaries for `page_template_dropdown()`, `parent_dropdown()`, and `wp_dropdown_roles()`
* Backtick-escape HTML tags in a parameter description for `add_settings_error()`
* Various formatting in the description and summary for `settings_errors()`
* Markdown-indent code snippets in the descriptions for `wpdb::prepare()`, `wpdb::insert()`, `wpdb::replace()`, `wpdb::update()`, and `wpdb::delete()`
* Backtick-escape an HTML tag in a parameter description for `login_header()`
* Remove HTML tags from the summaries for the `lostpassword_form` and `signup_header` hooks
Props rarst.
See #30473.
git-svn-id: https://develop.svn.wordpress.org/trunk@30546 602fd350-edb4-49c9-b593-d223f7449a82
Affects DocBlocks for the following core elements:
* Markdown-indent a code snippet in the description for `wp_salt()`
* Backtick-escape inline code in the return description for `get_avatar()`
* Various markdown formatting in the description for `add_filter()`
* Markdown-indent a code snippet in the description for `apply_filters()`
* Backtick-escape inline code in the `@see` description for `apply_filters_ref_array()`
* Backtick-escape inline code in the description for `do_action()`
* Backtick-escape variables in the parameter and return descriptions for `do_action_ref_array()`
* Various markdown formatting in the description for `get_plugin_data()`
Props rarst.
See #30473.
git-svn-id: https://develop.svn.wordpress.org/trunk@30544 602fd350-edb4-49c9-b593-d223f7449a82
Affects DocBlocks for the following core elements:
* Backtick-escape an HTML tag in the description for the `media_upload_mime_type_links()` hook
* Backtick-escape inline code in the description for `wp_get_active_network_plugins()`
* Remove HTML tags from the summaries for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks
* Backtick-escape HTML tags, add inline `@see` tags to parameter descriptions for the `nav_menu_css_class`, `nav_menu_item_id`, and `nav_menu_link_attributes` hooks
Props rarst.
See #30473.
git-svn-id: https://develop.svn.wordpress.org/trunk@30543 602fd350-edb4-49c9-b593-d223f7449a82
Affects DocBlocks for the following core elements:
* Remove HTML tag from parameter description in `comment_form()`
* Remove HTML tag from a summary for the `comment_form_top` hook
* Markdown-indent a code snippet in the description for `get_linkobjectsbyname()`
* Markdown-indent a code snippet and format an unordered list in the description for `get_linkobjects()`
* Backtick-escape some inline code in the description for `clean_pre()`
* Remove HTML tag from the summary for the `rss_tag_pre` hook
* Various formatting fixes in the descriptions for `get_filesystem_method()` and `request_filesystem_credentials()`
Props rarst for the initial patch.
See #30473.
git-svn-id: https://develop.svn.wordpress.org/trunk@30538 602fd350-edb4-49c9-b593-d223f7449a82
Affects DocBlocks for the following core elements:
* Backtick-escapes a `<link>` tag in a parameter description for the `embed_oembed_discover` hook
* Inline code fixes in the summary and return description for `WP_List_Table::get_table_classes()`
* Removes HTML markup from the summary for `WP_List_Table::display_rows_or_placeholder()`
* Backtick-escapes a `<tr>` tag in a parameter description for `WP_Users_List_Table::single_row()`
* Converts non-DocBlocks into multi-line comments in `WP_Dependencies::do_items()`
* Removes HTML markup from the summary for the `comment_form_top` hook.
* Inline code and snippet fixes in the description for `wp_get_schedules()`
Props rarst for the initial patch.
See #30473.
git-svn-id: https://develop.svn.wordpress.org/trunk@30537 602fd350-edb4-49c9-b593-d223f7449a82
There is now a base class of `notice`, with additional classes of `notice-success`, `notice-warning`, `notice-error`, and a new blue `notice-info`.
Also corrects some misleading notice colors, such as plugin tested up to warnings and login messages.
props avryl, melchoyce.
fixes#27418.
git-svn-id: https://develop.svn.wordpress.org/trunk@30505 602fd350-edb4-49c9-b593-d223f7449a82
Converts backticked-inline-code to inline `@see` tags (for the full benefit of Code Reference automagical behavior).
See [30396]. See #24908.
git-svn-id: https://develop.svn.wordpress.org/trunk@30497 602fd350-edb4-49c9-b593-d223f7449a82
`wp_upload_dir()` includes some logic to fall back to the default site's upload directory if a specific directory for the requested site cannot be found. Because of this, if `wpmu_delete_blog()` is fired twice in a row for the same site, the main site's upload directory could be deleted as well.
This adds some checks in `wpmu_delete_blog()` so that we are confident in the site and it's upload directory's existence before dropping the site. Tests are added for when `ms_files_rewriting` is enabled or disabled.
Fixes#30121
git-svn-id: https://develop.svn.wordpress.org/trunk@30404 602fd350-edb4-49c9-b593-d223f7449a82
* `process_text_diff_html` for contextually filtering a diffed line. Allows for the line to be processed in a different manner to the default `htmlspecialchars`.
* `revision_text_diff_options` for filtering the options passed to `wp_text_diff()` when viewing a post revision.
Fixes#24908
Props adamsilverstein
git-svn-id: https://develop.svn.wordpress.org/trunk@30396 602fd350-edb4-49c9-b593-d223f7449a82
This is only enabled when new files will not be installed during the update (as indicated by the WordPress.org API), and does not apply to Plugin/Theme/Translation Background Updates.
Additionally, the code to determine if the 'direct' filesystem transport should be used has been tweaked for wider support (where getmyuid() was unavailalbe) which fixes#10424
See #10205, #30245
git-svn-id: https://develop.svn.wordpress.org/trunk@30384 602fd350-edb4-49c9-b593-d223f7449a82
* Variables in DocBlocks should be backtick-escaped
* Parameter and return types should be as specific as possible
* `@param` types and variables should align with each other, but not intentionally with the `@return` description
See #30230.
git-svn-id: https://develop.svn.wordpress.org/trunk@30284 602fd350-edb4-49c9-b593-d223f7449a82
Being explicit about resource type (taxonomy vs post_type) allows for the
proper resolution of conflicts when a taxonomy and post_type share a slug.
Props filosofo.
Fixes#15029.
git-svn-id: https://develop.svn.wordpress.org/trunk@30141 602fd350-edb4-49c9-b593-d223f7449a82
The index must be manually dropped before `dbDelta()` can add the new index
without throwing a notice.
Fixes#22023.
git-svn-id: https://develop.svn.wordpress.org/trunk@30134 602fd350-edb4-49c9-b593-d223f7449a82
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.
Fixes#30191.
git-svn-id: https://develop.svn.wordpress.org/trunk@30105 602fd350-edb4-49c9-b593-d223f7449a82
* `wp_save_post_revision_post_has_changed` filter which can be used to determine if a post has been changed, and therefore if a revision should be created for a post.
* `wp_get_revision_ui_diff` filter which can be used to filter the fields displayed in the post revision diff UI.
* `wp_creating_autosave` action which is fired just before an autosave is created.
See #20564.
Props mattheu, adamsilverstein.
git-svn-id: https://develop.svn.wordpress.org/trunk@30091 602fd350-edb4-49c9-b593-d223f7449a82
`$test_uploaded_file` lets is know if `$file['tmp_name']` exists, which allows to exit with an error, instead of continuing to attempt to move the file.
`$test_upload` override is now a noop.
Fixes#28208.
git-svn-id: https://develop.svn.wordpress.org/trunk@30076 602fd350-edb4-49c9-b593-d223f7449a82
Each slug is a unique and beautiful snowflake, but let's enforce that
uniqueness elsewhere.
Props hotchkissconsulting.
Fixes#22023.
git-svn-id: https://develop.svn.wordpress.org/trunk@30056 602fd350-edb4-49c9-b593-d223f7449a82
Also removes several `@uses` tags, which are no longer leveraged as part of the inline documentation standard.
Props tareq1988.
Fixes#30118.
git-svn-id: https://develop.svn.wordpress.org/trunk@30034 602fd350-edb4-49c9-b593-d223f7449a82
Email addresses entered in a number of interfaces were not being stripslashed
properly, with the result that the emails were not being recognized as valid.
Fixes#18039.
git-svn-id: https://develop.svn.wordpress.org/trunk@29966 602fd350-edb4-49c9-b593-d223f7449a82
This is for translation files in WP_LANG_DIR which are installed through a language pack.
Change `wp_get_installed_translations()` to only return a translation if the .mo file also exists.
fixes#29860.
git-svn-id: https://develop.svn.wordpress.org/trunk@29856 602fd350-edb4-49c9-b593-d223f7449a82
Because jQUI's build process no longer provides individual minified files we need some additional changes:
* Rename all files, remove the "jquery.ui." prefix. Add old files to `$_old_files`.
* Add and use non-minified files in /src.
* Add grunt task to minify jQuery UI files.
* (Non-minified files will not be shipped.)
Changelogs:
* http://jqueryui.com/changelog/1.11.0/
* http://jqueryui.com/changelog/1.11.1/
props Fab1en, ocean90.
fixes#29833.
git-svn-id: https://develop.svn.wordpress.org/trunk@29847 602fd350-edb4-49c9-b593-d223f7449a82
`wp_comment_reply()`'s output can be complete overridden by the `wp_comment_reply` filter, so this check is justified and makes the AJAX callback more flexible.
Props nerrad.
Fixes#29704.
git-svn-id: https://develop.svn.wordpress.org/trunk@29758 602fd350-edb4-49c9-b593-d223f7449a82
* Don't touch VCS installs.
* Use the `async_update_translation` filter (which corresponds exactly to `auto_update_translation`) to entirely disable it, or based on the update offer.
props nacin, ocean90.
fixes#28571.
git-svn-id: https://develop.svn.wordpress.org/trunk@29694 602fd350-edb4-49c9-b593-d223f7449a82
Introduce upload_plugins and upload_themes capabilities to allow blocking of plugin and theme uploads, versus the old hacky (and not secure) ways of just hiding UI tabs. These are simply meta capabilities that map to install_plugins and install_themes.
Also:
* Use the same nice design for the plugin upload screen as the theme upload screen.
* Better compatibility for the old install_themes_tabs filter added in [29002]. see #28578.
* Ensure using the install_plugins_tabs filter to remove the upload tab removes the new button.
* Use 'Add Plugins' instead of 'Install Plugins' to match 'Add Themes'.
fixes#29236.
git-svn-id: https://develop.svn.wordpress.org/trunk@29634 602fd350-edb4-49c9-b593-d223f7449a82
* The WPLANG constant is no longer needed. Remove define('WPLANG', ''); from wp-config-sample.php. Populate WPLANG option based on the WPLANG constant. When get_option('WPLANG') is an empty string it will override WPLANG.
* Introduce translations_api() which is available to communicate with the translation API. Move translation install related functions to a new file.
* Replace mu_dropdown_languages() with wp_dropdown_languages(). wp_dropdown_languages() is now populated by the translation API.
* Remove wp_install_load_language() and allow load_default_textdomain() to switch a core translation.
fixes#13069, #15677, #19760, #28730, #29281.
git-svn-id: https://develop.svn.wordpress.org/trunk@29630 602fd350-edb4-49c9-b593-d223f7449a82
Includes back compat for `views_upload` links. These look a little awkward, but do not appear to be commonly used. Also prevents the view mode links from being dropped on smaller screens so a user doesn't get "stuck" in the list view.
This is different from other list tables, but aligns well with other uploaded content management screens (themes, plugins).
props pento, helen.
fixes#28946.
git-svn-id: https://develop.svn.wordpress.org/trunk@29625 602fd350-edb4-49c9-b593-d223f7449a82
* Prevent horizontal scrollbars in Chrome.
* URL fields should be always LTR.
* Force the plugin details to be LTR for all screens, see #19778.
fixes#29352.
git-svn-id: https://develop.svn.wordpress.org/trunk@29623 602fd350-edb4-49c9-b593-d223f7449a82
* Use a `MutationObserver` to listen to the `body` class of the parent editor frame.
* In `wpview_media_sandbox_styles()`, only return the MEjs stylesheets.
* In `wp_ajax_parse_media_shortcode()` and `wp_ajax_parse_embed()`, return an object instead of an HTML blob to allow passing `body` and `head` separately
Props avryl, azaozz.
Fixes#29048.
git-svn-id: https://develop.svn.wordpress.org/trunk@29615 602fd350-edb4-49c9-b593-d223f7449a82