Commit Graph

380 Commits

Author SHA1 Message Date
Pascal Birchler d2fb0bd81e General: Remove any usage of `wp_reset_vars()`.
The way `wp_reset_vars()` sets global variables based on `$_POST` and `$_GET` values makes code hard to understand and maintain. It also makes it easy to forget to sanitize input.

This change removes the few places where `wp_reset_vars()` is used in the admin to explicitly use `$_REQUEST` and sanitize any input.

Props swissspidy, audrasjb, davideferre, killua99, weijland, voldemortensen.
Fixes #38073.
Built from https://develop.svn.wordpress.org/trunk@58069


git-svn-id: http://core.svn.wordpress.org/trunk@57534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-05-01 18:01:12 +00:00
Sergey Biryukov 1ce5dc7444 Code Modernization: Replace usage of `strpos()` with `str_contains()`.
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).

WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.

This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.

Follow-up to [52039], [52040], [52326], [55703], [55710], [55987].

Props Soean, spacedmonkey, costdev, dingo_d, azaozz, mikeschroder, flixos90, peterwilsoncc, SergeyBiryukov.
Fixes #58206.
Built from https://develop.svn.wordpress.org/trunk@55988


git-svn-id: http://core.svn.wordpress.org/trunk@55500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 14:36:26 +00:00
audrasjb 223cda987f Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes #38913.
See #39176.

Built from https://develop.svn.wordpress.org/trunk@52978


git-svn-id: http://core.svn.wordpress.org/trunk@52567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 16:25:03 +00:00
Dominik Schilling 219d92f75b Block Editor: Use a unique name for the nonce of the custom fields toggle form.
Avoids a browser warning for having two elements with a non-unique id `#_wpnonce` on the post edit screen.

See #23165.
Fixes #51483.
Props vandestouwe, Mista-Flo.
Built from https://develop.svn.wordpress.org/trunk@50255


git-svn-id: http://core.svn.wordpress.org/trunk@49900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-08 21:39:16 +00:00
John Blackbourn bd1fa2d998 Posts, Post Types: Switch to restoring posts to `draft` status by default when they are untrashed.
This allows for edits to be made to a restored post before it goes live again. This also prevents scheduled posts being published unexpectedly if they are untrashed after their originally scheduled date.

The old behaviour of restoring untrashed posts to their original status can be reinstated using the `wp_untrash_post_set_previous_status()` helper function.

Also fixes an issue where the incorrect post ID gets passed to hooks if no post ID is passed to the function.

Props harrym, bananastalktome, jaredcobb, chriscct7, melchoyce, johnbillion, pankajmohale

Fixes #23022

Built from https://develop.svn.wordpress.org/trunk@49125


git-svn-id: http://core.svn.wordpress.org/trunk@48887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-11 13:39:07 +00:00
Sergey Biryukov e0be0aef8b Posts, Post Types: Clarify some "Error in deleting" messages, use more specific strings for attachments.
Props dingo_d.
See #50546.
Built from https://develop.svn.wordpress.org/trunk@48312


git-svn-id: http://core.svn.wordpress.org/trunk@48081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-05 10:41:10 +00:00
Sergey Biryukov 7b192d406a Coding Standards: Fix instances of `Generic.WhiteSpace.ArbitraryParenthesesSpacing.FoundEmpty`.
See #49542.
Built from https://develop.svn.wordpress.org/trunk@47855


git-svn-id: http://core.svn.wordpress.org/trunk@47631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-26 09:37:10 +00:00
Sergey Biryukov 7932193708 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47808


git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-16 18:42:12 +00:00
Sergey Biryukov 38676936ba Coding Standards: Use strict type check for `in_array()` and `array_search()` where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47550


git-svn-id: http://core.svn.wordpress.org/trunk@47325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-05 03:02:11 +00:00
Sergey Biryukov 5e6c949861 Coding Standards: Use Yoda conditions in some `wp-admin` files.
Props subrataemfluence, marcio-zebedeu, bookdude13, 1naveengiri, alishankhan.
Fixes #44365, #48455.
Built from https://develop.svn.wordpress.org/trunk@47218


git-svn-id: http://core.svn.wordpress.org/trunk@47018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:53:06 +00:00
Sergey Biryukov 47ed56f38f Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.
Built from https://develop.svn.wordpress.org/trunk@47198


git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-06 06:33:11 +00:00
Sergey Biryukov 0544629460 Posts, Post Types: Wrap text submitted via Quick Draft dashboard widget in the Paragraph block.
Props audrasjb, jeroenrotty.
Fixes #48120.
Built from https://develop.svn.wordpress.org/trunk@47191


git-svn-id: http://core.svn.wordpress.org/trunk@46991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-05 08:10:05 +00:00
Sergey Biryukov 001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
John Blackbourn c8f91f77ac Docs: Correct invalid hook docblocks.
See #48303

Built from https://develop.svn.wordpress.org/trunk@46603


git-svn-id: http://core.svn.wordpress.org/trunk@46400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-10-27 19:11:02 +00:00
Sergey Biryukov e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov 16b8d91baa I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Sergey Biryukov 9967a3e030 Docs: Add missing description for `$post` global.
Props immeet94.
Fixes #46503. See #47110.
Built from https://develop.svn.wordpress.org/trunk@45742


git-svn-id: http://core.svn.wordpress.org/trunk@45553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-04 12:28:56 +00:00
Gary Pendergast 87675d288b Coding Standards: Fix all `WordPress.WhiteSpace.PrecisionAlignment` issues.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45602


git-svn-id: http://core.svn.wordpress.org/trunk@45413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-05 05:21:56 +00:00
Gary Pendergast cf3fa9f7c8 Coding Standards: Fix the `Squiz.PHP.DisallowMultipleAssignments` violations in `wp-admin`.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45583


git-svn-id: http://core.svn.wordpress.org/trunk@45394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 12:52:01 +00:00
Gary Pendergast bbbf0ee62e Admin: Re-add some validation from [44048] that was accidentally removed in [44165].
Props david.binda.
See #45037.


Built from https://develop.svn.wordpress.org/trunk@44726


git-svn-id: http://core.svn.wordpress.org/trunk@44557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-02-07 04:12:51 +00:00
Gary Pendergast 6d5cd6842a Coding Standards: Document intentional `case` block fall-throughs.
Fixes `PSR2.ControlStructures.SwitchDeclaration.TerminatingComment` violations.

See #45934.


Built from https://develop.svn.wordpress.org/trunk@44565


git-svn-id: http://core.svn.wordpress.org/trunk@44396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-11 06:26:50 +00:00
desrosj f082806afa Block Editor: Display notice to the user when JavaScript is disabled.
Currently, when viewing the block editor with JavaScript disabled, the user sees a blank admin page with the admin menu sidebar. This adds an admin notice informing the user that JavaScript is required for the new block editor.

Props mkaz, pento, azaozz, ocean90, desrosj.
Fixes #45453.
Built from https://develop.svn.wordpress.org/trunk@44437


git-svn-id: http://core.svn.wordpress.org/trunk@44268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-01-07 20:40:50 +00:00
desrosj 43bdb0e193 Editor: Remove unwanted fields before saving posts.
The meta_input, file, and guid fields are not intended to be updated through user input.

Merges [44047] to trunk.
Built from https://develop.svn.wordpress.org/trunk@44295


git-svn-id: http://core.svn.wordpress.org/trunk@44125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 21:32:48 +00:00
desrosj bbe9a37b6c Editor: Add custom fields meta box support in the block editor.
This brings support for the custom fields meta box into the new block editor.

The `webpack` and `copy-webpack-plugin` packages have also been updated.

This does not bump the `@wordpress` packages like in [43861] because of conflicts with package versions already installed in `trunk`. The packages will be brought up to date in a subsequent merge.

Merges [43861] and [43863] into trunk.

See #45145.
Fixes #45257.
Built from https://develop.svn.wordpress.org/trunk@44260


git-svn-id: http://core.svn.wordpress.org/trunk@44090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:52:51 +00:00
Gary Pendergast 8464097ea4 Editor: Merge some minor bug fixes.
There were some tweaks made to the post editor in WordPress 5.0 that hadn't been merged to `trunk`, this commit rectifies that.

Merges [43815,43816] from the 5.0 branch to trunk.

Props birgire, jorbin, abdullahramzan, adamsilverstein, mrahmadawais, airathalitov, ajitbohra, schlessera, albertomedina, aldavigdis, alexsanford1, xyfi, nitrajka, afercia, andreiglingeanu, euthelup, aduth, sumobi, anevins, azaozz, androb, andrewserong, kallehauge, nosolosw, apeatling, atimmer, arnaudban, asvinballoo, b-07, benlk, blowery, caxco93, benjamin_zekavica, kau-boy, bernhard-reiter, bcolumbia, bph, boblinthorst, bradyvercher, bpayton, brentswisher, bronsonquick, burhandodhy, icaleb, chouby, ehg, chrisvanpatten, butimnoexpert, christophherr, chriskmnds, claudiosanches, danielbachhuber, mrmadhat, danielhw, danieltj, goldsounds, dfangstrom, daniloercoli, dannycooper, nerrad, dsawardekar, davemoran118, davidherrera, dryanpress, davidsword, davisshaver, dmsnell, dlocc, diegoreymendez, dd32, dency, ocean90, donnapep, chopinbach, electricfeet, eliorivero, sewmyheadon, ericnmurphy, foobar4u, circlecube, fabs_pim, flixos90, floriansimeth, gma992, garrett-eclipse, garyj, pento, doomwaxer, revgeorge, gziolo, bordoni, hardeepasrani, helen, luehrsen, herbmiller, toro_unit, ianbelanger, iandunn, igorsch, ipstenu, ireneyoast, israelshmueli, sisanu, jd55, copons, jnylen0, jamestryon, ephoxjames, jamiehalvorson, jsnajdr, jagnew, dciso, octalmage, vengisss, jhoffm34, shenkj, audrasjb, jblz, jeremyfelt, motleydev, jipmoors, sephsekla, joemaller, joemcgill, joen, johndyer, johnjamesjacoby, joshuawold, johnny5, desrosj, jonsurrell, belcherj, sirjonathan, koke, jorgefilipecosta, shelob9, jvisick77, julienmelissas, kopepasah, kadamwhite, codebykat, ryelle, gwwar, kevinwhoffman, coderkevin, ixkaito, kjellr, obenland, lancewillett, postphotos, loicblascos, lucasstark, luigipulcini, lucaskowalski, lukepettway, mahdiyazdani, mahmoudsaeed, mkaz, tyxla, markjaquith, mapk, vindl, m-e-h, mboynes, mattheu, lonelyvegan, mtias, napy84, maurobringolf, maximebj, mayukojpn, woodent, michaelhull, mmtr86, stubgo, simison, mihai2u, mike-haydon-swo, mnelson4, mpheasant, mikeschroder, idpokute, mikeyarce, dimadin, gonzomir, milesdelliott, warmarks, munirkamal, nfmohit, nateconley, greatislander, njpanderson, notnownikki, nielslange, nikschavan, potbot, nshki, webmandesign, oskosk, pglewis, pareshradadiya-1, swissspidy, pbearne, pauldechov, psealock, paulstonier, paulwilde, pedromendonca, ptasker, peterwilsoncc, tyrannous, strategio, piersb, delawski, prtksxna, presskopp, rachelbaker, rachelmcr, rakshans1, rahmon, lamosty, youknowriad, riddhiehta02, noisysocks, deviodigital, sanchothefat, robertsky, _dorsvenabili, rohittm, magicroundabout, rmccue, welcher, ryo511, sagarprajapati, samikeijonen, scottmweaver, kluny, sharaz, giventofly76, designsimply, sstoqnov, hypest, netweb, stevehenty, stuartfeldt, sergioestevao, soean, tammie_l, karmatosed, thrijith, timgardner, timmydcrawford, tjnowell, mirucon, travislopes, truongwp, tjfunke001, vishalkakadiya, vtrpldn, walterebert, westonruter, skorasaurus, somtijds, earnjam, williampatton, willybahuaud, yoavf, zebulan, ziyaddin, abhijitrakas, andreamiddleton, csabotta, dixitadusara, etoledom, faishal, hideokamoto, imath, iseulde, j-falk, jaswrks, johnwatkins0, jomurgel, notlaura, leahkoerper, mcsf, meetjey, 0mirka00, mitogh, ephoxmogran, tacrapo, mzorz, nagayama, omarreiss, ramonopoly, rileybrook, tinkerbelly, shaileesheth, sikander, ssousa, tfrommen, yahil.

Fixes #45037.


Built from https://develop.svn.wordpress.org/trunk@44165


git-svn-id: http://core.svn.wordpress.org/trunk@43995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 05:12:52 +00:00
Peter Wilson a2c890409b Multisite: Validate activation links.
Built from https://develop.svn.wordpress.org/trunk@44048


git-svn-id: http://core.svn.wordpress.org/trunk@43878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-13 01:26:24 +00:00
Gary Pendergast 56c162fbc9 Coding Standards: Upgrade WPCS to 1.0.0
WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


Built from https://develop.svn.wordpress.org/trunk@43571


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-08-17 01:51:36 +00:00
Gary Pendergast aaf99e6913 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.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Gary Pendergast c90cfa3b50 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.


Built from https://develop.svn.wordpress.org/trunk@42228


git-svn-id: http://core.svn.wordpress.org/trunk@42057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-26 23:57:55 +00:00
Gary Pendergast a72be13ec0 Editor: Add the `replace_editor` filter.
This filter allows the Core editor to be replaced by an entirely different editor (coughcoughGUTENBERGcough).

Props azaozz, who is supposed to be on sabbatical right now.
Fixes #42119.


Built from https://develop.svn.wordpress.org/trunk@41829


git-svn-id: http://core.svn.wordpress.org/trunk@41663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-11 12:06:48 +00:00
Sergey Biryukov 9234febe06 Posts, Post Types: Use an existing string for "Invalid post type" error message.
Props ramiy.
Fixes #39171.
Built from https://develop.svn.wordpress.org/trunk@39756


git-svn-id: http://core.svn.wordpress.org/trunk@39694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-10 02:40:42 +00:00
Dominik Schilling 25e66e4f1e Text Changes: Unify permission error messages.
The new format looks like "Sorry, you are not allowed to <action>.". This provides a consistent experience for all error messages related to missing permissions. It also reduces the number of similar strings and allows translators to provide a consistent style in their language.

Props ramiy, Presskopp.
Fixes #34521.
Built from https://develop.svn.wordpress.org/trunk@37914


git-svn-id: http://core.svn.wordpress.org/trunk@37855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-29 15:16:29 +00:00
Dominik Schilling 7f1abd441f Posts: Fire a `post_action_{$action}` action for a custom post action request.
Props jfarthing84, Mte90, brianvan, sudar, DrewAPicture.
Fixes #27056.
Built from https://develop.svn.wordpress.org/trunk@37424


git-svn-id: http://core.svn.wordpress.org/trunk@37390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-12 15:44:28 +00:00
Scott Taylor b0561ed6e4 Dashboard: use the `create_posts` cap on the post type object when determining if the Quick Press widget can be displayed.
Props jim912, ocean90, chriscct7.
Fixes #25681.

Built from https://develop.svn.wordpress.org/trunk@35282


git-svn-id: http://core.svn.wordpress.org/trunk@35248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-20 05:49:24 +00:00
Sergey Biryukov d6865505d5 Respect the `force_delete` parameter of `get_delete_post_link()`.
Previously, it only worked if `EMPTY_TRASH_DAYS` was disabled.

Props johnbillion, chriscct7.
Fixes #26832.
Built from https://develop.svn.wordpress.org/trunk@34794


git-svn-id: http://core.svn.wordpress.org/trunk@34759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-03 01:50:25 +00:00
John Blackbourn 541dbb2711 Remove the ability to view the post listing screen and post editing screen for post types with `show_ui` set to `false`. It is unexpected and unintended behaviour that this is allowed.
If your plugin or site does rely on this behaviour, the arguments that are passed to `register_post_type()` should be altered so that `show_ui` is `true`, and arguments such as `show_in_menu`, `show_in_nav_menus`, and `show_in_admin_bar` are `false`.

Fixes #33763
Props swissspidy, johnbillion

Built from https://develop.svn.wordpress.org/trunk@34177


git-svn-id: http://core.svn.wordpress.org/trunk@34145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 10:27:29 +00:00
John Blackbourn 9bf86a74d0 Set the `secure` flag on the `wp-saving-post` cookie when using HTTPS.
This cookie doesn't contain any sensitive information, but this change brings its behaviour in line with all other core cookies.

Fixes #31056

Built from https://develop.svn.wordpress.org/trunk@34027


git-svn-id: http://core.svn.wordpress.org/trunk@33996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 22:42:23 +00:00
Scott Taylor 503aa8b76d Move `redirect_post()` from `wp-admin/post.php` to `wp-admin/includes/post.php`.
See #33813.

Built from https://develop.svn.wordpress.org/trunk@34020


git-svn-id: http://core.svn.wordpress.org/trunk@33989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 21:31:24 +00:00
Dominik Schilling a9b3f12826 Heartbeat: Ensure post locks are released.
Built from https://develop.svn.wordpress.org/trunk@33542


git-svn-id: http://core.svn.wordpress.org/trunk@33509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-04 04:54:34 +00:00
Sergey Biryukov 82034319e1 Merge duplicate strings related to Trash.
props pavelevap.
fixes #33133.
Built from https://develop.svn.wordpress.org/trunk@33431


git-svn-id: http://core.svn.wordpress.org/trunk@33398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-26 22:48:26 +00:00
Gary Pendergast fe5a844be5 Capabilities: When creating an auto-draft, ensure that the current user still has permission to do so.
Built from https://develop.svn.wordpress.org/trunk@33357


git-svn-id: http://core.svn.wordpress.org/trunk@33329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-22 04:02:25 +00:00
Konstantin Obenland a4e803fbd4 Use `get_default_comment_status()` globally.
Also makes the filter name static and passes the post type for context.

Props valendesigns.
Fixes #31168.


Built from https://develop.svn.wordpress.org/trunk@33054


git-svn-id: http://core.svn.wordpress.org/trunk@33025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-02 22:32:25 +00:00
Scott Taylor c6a4512b1b Add missing doc blocks to `wp-admin/includes/*`.
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32654


git-svn-id: http://core.svn.wordpress.org/trunk@32624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 20:17:26 +00:00
Scott Taylor b56b9b3e5c Add `@global` annotations for `wp-admin/*`.
See #32444.

Built from https://develop.svn.wordpress.org/trunk@32642


git-svn-id: http://core.svn.wordpress.org/trunk@32612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 21:41:30 +00:00
Scott Taylor b8341a472d When adding `post_type` to `$sendback` in `wp-admin/post.php`, use `add_query_arg()` instead of string concatenation.
Props podpirate.
Fixes #31492.

Built from https://develop.svn.wordpress.org/trunk@31633


git-svn-id: http://core.svn.wordpress.org/trunk@31614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-05 22:31:24 +00:00
Scott Taylor 84867b3e9c Admin globals:
* Declare `$wp_importers` as a global in `admin.php`
* Declare `$post_type`, `$post_type_object`, and  `$post` as globals where applicable

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31121


git-svn-id: http://core.svn.wordpress.org/trunk@31102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 05:29:22 +00:00
Andrew Ozz 3d60d9f875 Autosave: prevent setting multiple stale `wp-saving-post-*` cookies when the browser disregards "session cookies" expiration on quit:
- Add expiration time of 24 hours for these cookies.
- Rename them to `wp-saving-post` (no post_id) so there is never more than one cookie per domain.
Fixes #29294.
Built from https://develop.svn.wordpress.org/trunk@29572


git-svn-id: http://core.svn.wordpress.org/trunk@29346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-22 00:25:16 +00:00
Scott Taylor 517dbfaa21 In `wp-admin/post.php`, `break` is unreachabled after `exit`.
See #27882.

Built from https://develop.svn.wordpress.org/trunk@28312


git-svn-id: http://core.svn.wordpress.org/trunk@28140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 18:15:15 +00:00
Helen Hou-Sandí 593bd2a495 Avoid an undefined function due to `/wp-admin/includes/dashboard.php` being included too late. props obenland. fixes #27457.
Built from https://develop.svn.wordpress.org/trunk@27630


git-svn-id: http://core.svn.wordpress.org/trunk@27473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-20 01:31:15 +00:00
Andrew Ozz 335add2573 Autosave: refactor autosave.js, use heartbeat for transport and move all "Add/Edit Post" related functionality to post.js. See #25272.
Built from https://develop.svn.wordpress.org/trunk@26995


git-svn-id: http://core.svn.wordpress.org/trunk@26872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-22 04:56:16 +00:00