Commit Graph

5472 Commits

Author SHA1 Message Date
Andrew Ozz 5e524200b4 Editor: ensure there is a selection before getting the caret position. Fixes a bug in Firefox when there is no selection for a hidden element.
Props johnschulz, azaozz.

Fixes #43012 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@42430 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-08 20:20:00 +00:00
Anton Timmermans 7f94931449 Docs: Improve JSDoc for `js/media-upload.js`.
Props terwdan, diedeexterkate, andizer, ireneyoast.
Fixes #42956.


git-svn-id: https://develop.svn.wordpress.org/trunk@42426 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-04 14:36:13 +00:00
Rachel Baker 7567f588b3 Comments: Introduce filter for the arguments for the comment query in the comments list table.
Add `comments_list_table_query_args` filter to the Comments List Table.

Props soulseekah, birgire.
Fixes #42997.

git-svn-id: https://develop.svn.wordpress.org/trunk@42420 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-29 18:20:13 +00:00
Dion Hulse 64e3dc5bc8 i18n: Don't use `esc_attr_e()` on a variable.
Props yoavf.
Fuxes #42935.


git-svn-id: https://develop.svn.wordpress.org/trunk@42413 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-20 05:34:05 +00:00
John Blackbourn 2a9f696710 Docs: Improve the function and parameter descriptions for `do_meta_boxes()`.
See #42505


git-svn-id: https://develop.svn.wordpress.org/trunk@42412 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-19 15:02:36 +00:00
Anton Timmermans bc35d72a63 Docs: Remove `@summary` tags from JSDoc.
As decided in the JavaScript core chat. With a few reasons:

* It is visually cleaner when reading the source.
* This bring the JavaScript documentation closer to the PHP documentation.

The only disadvantage is that the JSDoc parser doesn't split out the summary and the description in the new format. We've decided to solve this when building the JavaScript documentation parser.

Props herregroen.
Fixes #42901.


git-svn-id: https://develop.svn.wordpress.org/trunk@42411 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-18 14:13:58 +00:00
John Blackbourn 186f963c34 Media: Pass the attachment ID to the `intermediate_image_sizes_advanced` filter.
Props drywallbmb, robbie505
Fixes 42745


git-svn-id: https://develop.svn.wordpress.org/trunk@42407 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-16 13:46:28 +00:00
Adam Silverstein 33514867dd Media: improve flows for cropping on attachment details screen.
On the "Attachment Details" screen:
* The crop button is always 'enabled'.
* Clicking the crop button with no selection selects the entire image.
* Clicking the crop button with the entire image selected doesn't do anything.
* Clicking the crop button with a selection crops as expected.

Props sonjanyc, afercia, mikeschroder.
Fixes #30155.


git-svn-id: https://develop.svn.wordpress.org/trunk@42404 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 22:02:02 +00:00
Anton Timmermans 53f1c74e1c Docs: Improve wp-admin JSDoc structural data globally.
JSDoc takes it structural data from `@namespace`, `@lends` and `@memberOf`. This change fixes these tags for all JavaScript files in the wp-admin folder.

* Add jsdoc configuration to parse wp-admin/js files. Use `jsdoc -c jsdoc.conf.json` to generate JSDoc.
* Define all used namespaces using `@namespace`.
* Define each usage of the extend function as a prototype assignment using `@lends`.
* Add `@alias` if JSDoc cannot detect the correct name automatically.

This has previously been corrected for all `wp-includes` JavaScript files: [41351].

Props herregroen.
Fixes #42485.


git-svn-id: https://develop.svn.wordpress.org/trunk@42403 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 13:41:56 +00:00
Sergey Biryukov 95ccede93d Docs: Remove extra dot from some `@since` tags.
Props hardik-amipara.
Fixes #42899.

git-svn-id: https://develop.svn.wordpress.org/trunk@42400 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 05:15:33 +00:00
Sergey Biryukov e47feac514 Docs: Add missing `@since` tags for add menu page functions.
Props keesiemeijer.
Fixes #42882.

git-svn-id: https://develop.svn.wordpress.org/trunk@42394 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-15 00:14:09 +00:00
Anton Timmermans a35b7f31be Docs: Improve JS Docs for `wp-admin/js/dashboard.js`.
Props jipmoors, andizer, ireneyoast, boblinthorst.
Fixes #42831.


git-svn-id: https://develop.svn.wordpress.org/trunk@42393 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-14 14:10:11 +00:00
Anton Timmermans 1b5554e818 Docs: Improve JS Docs for `custom-header.js`.
The `custom-header.js` file is only used on the `wp-admin/themes.php?page=custom-header` page. As that page is no longer linked from the UI the functions in the file are marked deprecated.

Props nicollle, jipmoors, diedeexterkate.
Fixes #42678.


git-svn-id: https://develop.svn.wordpress.org/trunk@42385 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 16:26:59 +00:00
Dion Hulse 35c13730dd Docs: Correct some typos in the docs for `wp_ajax_get_community_events()`.
Props Presskopp.
Fixes #42861.


git-svn-id: https://develop.svn.wordpress.org/trunk@42384 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-11 08:48:07 +00:00
Aaron Jorbin 6f4f8b7928 CODING STANDARDS: Fix single/double quotation mark
Broken in [42351].
Unprops adamsilverstein.
Fixes 42679.


git-svn-id: https://develop.svn.wordpress.org/trunk@42357 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 21:18:01 +00:00
Adam Silverstein 4619b059b1 Docs: Improve JSDocs for common.js.
Props andizer, rensw90, benvaassen, jipmoors, ireneyoast and nicollle.
Fixes 42679.



git-svn-id: https://develop.svn.wordpress.org/trunk@42351 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-03 18:10:21 +00:00
Drew Jaynes 6b325e9916 Hooks: Standardize naming of dynamic hooks using values derived from superglobals to use interpolation vs concatenation.
This is a continuation of the work that happened in [38307] for #37748.

Props ramiy.
Fixes #42698.


git-svn-id: https://develop.svn.wordpress.org/trunk@42349 602fd350-edb4-49c9-b593-d223f7449a82
2017-12-01 11:35:31 +00:00
Gary Pendergast 8f95800d52 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42343 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-30 23:09:33 +00:00
John Blackbourn e2291664f1 Hardening: Use a properly generated hash for the `newbloguser` key instead of a determinate substring.
git-svn-id: https://develop.svn.wordpress.org/trunk@42258 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:51:19 +00:00
Sergey Biryukov 63f8e4d122 Users: After [42256], remove unnecessary double quotes around `first_name` and `last_name` properties.
See #42713.

git-svn-id: https://develop.svn.wordpress.org/trunk@42257 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 15:27:55 +00:00
Dion Hulse c52f6ba995 Users: Display partial names in the user listing tables.
This allows showing a name when only the first or last name is provided.

Props shital-patel, antipole.
Fixes #42713.


git-svn-id: https://develop.svn.wordpress.org/trunk@42256 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-29 03:40:31 +00:00
Gary Pendergast 209ede72de General: Add inline PHPCS options to leave regex indentation.
We have a handful of super long regexen that are written over multiple lines, as a collection of strings concatenated together. Each string is indented appropriately for the regex, but PHPCS doesn't recognised this, so defaults to removing the extra whitespace.

Disabling the `Squiz.Strings.ConcatenationSpacing.PaddingFound` rule for these blocks stops the extra whitespace from being removed.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42249 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-28 04:23:11 +00:00
Dion Hulse a825a181e1 Theme Editor: Translate the URL to the Child Themes Codex page.
Props odysseygate, johnpgreen.
Fixes #42454.


git-svn-id: https://develop.svn.wordpress.org/trunk@42247 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:51:25 +00:00
Dion Hulse 44c75415b3 Theme Editior: Base the nonce on a simpler combination of fields, for easier debugging & reading.
See #42609.
Fixes #42705.


git-svn-id: https://develop.svn.wordpress.org/trunk@42246 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:43:11 +00:00
Dion Hulse 6e0ba7864f Theme Editor: Validate files are editable based on their relative filenames, rather than full file path.
This fixes theme editing on Windows platforms where `validate_file()` will return `2` on a full file path.

Fixes #42609.


git-svn-id: https://develop.svn.wordpress.org/trunk@42244 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 03:27:19 +00:00
dd32 76f77416d6 Theme/Plugin Editor: Remove the caching added in [41806] as it causes more problems than it fixes.
While caching here seemed like a good idea in theory, in practice the cache would be often stale causing development issues.
We exclude common folders (such as `node_modules`) from the scanning to avoid directories which are not useful to the end-user, so as long as those exclusion lists are held up this shouldn't cause too much of a degredation in the future.
We may consider adding caching here again in the future if it's determined that it is really needed.

Props precies, ibenic, mariovalney, schlessera, and all the others who commented on the ticket(s).
This partually reverts [41806].
See #6531.
Fixes #42573.


git-svn-id: https://develop.svn.wordpress.org/trunk@42242 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-27 02:58:02 +00:00
Gary Pendergast 574821573a General: Fix some precision alignment formatting warnings.
The WPCS `WordPress.WhiteSpace.PrecisionAlignment` rule throws warnings for a bunch of code that will likely cause issues for `wpcbf`. Fixing these manually beforehand gives us better auto-fixed results later.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42228 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-26 23:56:25 +00:00
Dion Hulse 26fb077862 Filesystem: Use a more unique filename in `wp_tempnam()` and `get_filesystem_method()`.
Using a filename which was generated from `time()` could cause two processes to try to use the same filename, causing unexpected behaviour.

Props jrchamp, bikecrazyy.
Fixes #42265.


git-svn-id: https://develop.svn.wordpress.org/trunk@42224 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-24 03:04:35 +00:00
Weston Ruter 53eaf9f078 Themes: Prevent JS error on Themes admin screen when only one theme is installed.
Amends [42029].
Props chetan200891, afercia.
See #42348.
Fixes #42673.


git-svn-id: https://develop.svn.wordpress.org/trunk@42222 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 19:28:33 +00:00
Gary Pendergast da9953aa47 Setup: Allow for `wp-config-sample.php` to be formatted according to coding standards.
When the setup process reads `wp-config-sample.php`, it assumes that there are no spaces inside the brackes of the `define()`s. Unfortunately, this doesn't match our coding standards, so will no longer work correctly once we start enforcing them.

This also improves coding standards of the generated `wp-config.php` file.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42218 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 05:23:01 +00:00
Gary Pendergast f797c252d9 General: Reformat inline `if ()` statements inside HTML tags.
This pattern occurs a handful of times across the codebase:

`<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">`

Unfortunately, it doesn't really play nicely with `phpcbf`, so all instances need to be removed in preperation for auto code formatting.

See #41057.



git-svn-id: https://develop.svn.wordpress.org/trunk@42217 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-23 04:08:42 +00:00
Dion Hulse 2c1858a8c3 Upgrade: Fix updating plugins which include a numeric file/folder names.
The fix in [41821] caused numeric folder names to be reindexed to 0..n when in the root directory (for example, `my-plugin/24/`).

Props edo888.
See #41524.
Fixes #42628 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42214 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-21 04:14:33 +00:00
Boone Gorges 4ec5d65dcc Introduce `meta_box_sanitize_cb` taxonomy argument.
The `meta_box_cb` argument was introduced in [25572] to allow plugin
authors to provide a custom callback for rendering their taxonomy's meta
box on the post edit screen. However, the routine used to handle the saving
of these custom taxonomy meta boxes was not customizable, but was instead
based simply on whether the taxonomy was hierarchicaly. See [13535].

The new `meta_box_sanitize_cb` argument defaults to the "tag" routine for
non-hierarchical taxonomies and the "category" routine for hierarchical ones,
thereby maintaining the current default behavior. Developers can override this
when the data passed from their `meta_box_cb` differs.

Props boonebgorges, ZaneMatthew, stephenharris.
Fixes #36514.

git-svn-id: https://develop.svn.wordpress.org/trunk@42211 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-21 03:14:52 +00:00
Felix Arntz 887214f7ce Multisite: Fix broken update `blog_versions` query after [41661].
Props Mista-Flo, lenasterg.
Fixes #42641.


git-svn-id: https://develop.svn.wordpress.org/trunk@42210 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 23:45:09 +00:00
Dion Hulse 61904426e2 DB Repair: Only allow non-falsey values of `WP_ALLOW_REPAIR` to access the DB repair functionality.
This allows defining the constant as `false` to prevent access (rather than requiring the constant to be removed entirely).

Props tiagohillebrandt, munklefish.
See #11717.
Fixes #42622.


git-svn-id: https://develop.svn.wordpress.org/trunk@42205 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-20 06:20:23 +00:00
johnbillion 4af1237176 Docs: Correct the `@since` property for the `page_attributes_misc_attributes` action.
Props jeremyescott, jfarthing84

Fixes #42607


git-svn-id: https://develop.svn.wordpress.org/trunk@42203 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-19 11:51:01 +00:00
Felix Arntz b424eecd0b Multisite: Do not show edit links in network users table for users that cannot be edited.
Props ocean90.
Fixes #42552.


git-svn-id: https://develop.svn.wordpress.org/trunk@42202 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-17 21:34:01 +00:00
Sergey Biryukov 603e195f10 Rewrite Rules: Correct the logic in `extract_from_markers()` after [41928].
Props stodorovic.
Fixes #42579. See #39920.

git-svn-id: https://develop.svn.wordpress.org/trunk@42199 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-16 13:24:57 +00:00
Weston Ruter 7371834069 Editor: Disable `wp_keep_scroll_position` in IE11 since buggy; fix `matches` polyfill conflict with ME.js by doing runtime feature detection in context window.
Props westonruter, SergeyBiryukov, Clorith for testing.
See #41962, #42029.
Fixes #42553 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42191 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 18:58:26 +00:00
Weston Ruter 551163278b File Editor: Eliminate gap inserted between code editor and heading in IE11 when CodeMirror initializes.
Props afercia, melchoyce, Clorith for testing, SergeyBiryukov for testing.
See #12423.
Fixes #42554 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42189 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 18:28:33 +00:00
Weston Ruter 323a8c95f0 Customize: Prevent themes panel from auto-expanding in IE11.
In IE11 the `input` event erroneously gets triggered initially without any user input.

Amends [41648].
See #37661.
Fixes #42556 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42187 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 18:11:17 +00:00
Weston Ruter c9b825d5f5 Editor: Improve scrolling behavior and prevent autosave logic from causing dirty state when just switching between Visual and Text tabs.
Props pento.
See #41962, #42029.
Fixes #42530 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42183 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-15 00:20:21 +00:00
Weston Ruter 4126cbbd9c About Page: Fix issue with overlapping images and text on IE11 and Edge 15.
Props Clorith, ryelle, afercia, la-geek, SergeyBiryukov.
See #42514.
Fixes #42545.


git-svn-id: https://develop.svn.wordpress.org/trunk@42181 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-14 23:01:55 +00:00
Peter Wilson ca40a244d7 Editor: Cease adding paragraphs when switching editor tabs.
Fixes an error since [41783] in which extra paragraphs could be added to content when switching editor tabs.

Props pento, adamsilverstein, aduth.
Fixes #42531.



git-svn-id: https://develop.svn.wordpress.org/trunk@42177 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-14 05:23:55 +00:00
Gary Pendergast 7dfdbf2754 Editor: When switching Editor tabs, don't scroll unnecessarily.
- When switching to the Text view, wait until after the Visual editor element has been hidden, before focussing the `<textarea>`.
- When switching to the Visual view, only scroll if the cursor is not visible on the current screen.

Fixes #42530.



git-svn-id: https://develop.svn.wordpress.org/trunk@42175 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-14 05:18:10 +00:00
Weston Ruter cc68415a23 About: Fix jumping behavior for titles and columns when scrolling.
Props ryelle.
See #42087.
Fixes #42514, #42526.


git-svn-id: https://develop.svn.wordpress.org/trunk@42173 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 22:28:20 +00:00
Weston Ruter e260210294 Customize: Allow notifications for linting errors in code editor control (for Additional CSS) to be overridden to allow saving.
Implements the same override that was implemented in [41721] for the theme/plugin editors.

See #41897, #41887.
Fixes #42528.


git-svn-id: https://develop.svn.wordpress.org/trunk@42171 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 21:18:49 +00:00
Weston Ruter 33f7cfd2b9 Customize: Prevent PHP notice on theme-switch dashboard welcome link (and link to themes admin screen) when user cannot `customize`.
Props skostadinov, ocean90.
Amends [41699].
See #42050.
Fixes #42525.


git-svn-id: https://develop.svn.wordpress.org/trunk@42169 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 19:24:49 +00:00
Weston Ruter 2f297cfeff About: Add vertical alignment for developer happiness sections.
Also run CSS autoprefixer to add `-ms-` prefixes for CSS grid identifiers for IE11.

Props Presskopp.
Amends [42121].
See #42087.
Fixes #42524 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42161 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 05:47:05 +00:00
Weston Ruter e6e518cbe5 About: Fix grammar typo with pluralization.
Props metodiew, westonruter.
Amends [42121].
See #42087.
Fixes #42476 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@42159 602fd350-edb4-49c9-b593-d223f7449a82
2017-11-13 05:18:10 +00:00