Commit Graph

164 Commits

Author SHA1 Message Date
John Blackbourn f12b16a291 General: Add missing URL-encoding and add extra hardening to plugin and template names when they're displayed in the admin area.
Merges [41413] to the 4.6 branch

See #13377

Built from https://develop.svn.wordpress.org/branches/4.6@41414


git-svn-id: http://core.svn.wordpress.org/branches/4.6@41247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-19 10:22:34 +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
Andrea Fercia d01b200e6e Accessibility: Help text improvements.
Avoid references to "visual" positions in favour of positions in the document
structure. The help text shouldn't assume users can see.

Also, in the Posts screen don't mention specific types of posts and use a more
generic text instead.

Props odysseygate, pansotdev, zakb8.
Fixes #34761.
Built from https://develop.svn.wordpress.org/trunk@37680


git-svn-id: http://core.svn.wordpress.org/trunk@37646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 21:43:29 +00:00
Peter Wilson 47d26cd9fb DOCS: Replace HTTP links with HTTPS.
Replaces unsecure links in documentation and translator comments with their secure versions.

Props johnpgreen, netweb

Fixes #36993

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


git-svn-id: http://core.svn.wordpress.org/trunk@37640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 04:50:33 +00:00
Drew Jaynes c3055cc190 Docs: Standardize hook docs in wp-admin/* to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:01:30 +00:00
Sergey Biryukov 6d91caa931 Theme Editor: Repurpose the `'wp_theme_editor_filetypes'` filter added in [35134] to actually filter file types instead of files.
Default types include 'php' and 'css' and cannot be removed, only new types can be added.

Props DrewAPicture, SergeyBiryukov.
Fixes #22924.
Built from https://develop.svn.wordpress.org/trunk@35180


git-svn-id: http://core.svn.wordpress.org/trunk@35146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-15 02:20:24 +00:00
Scott Taylor 7c88e86bf6 Theme Editor: add a filter, `wp_theme_editor_filetypes`, to allow more filetypes to be edited via the Theme Editor. Usage of the Theme Editor is strenuously discouraged, but we should allow you to add whatever filetypes (`.less`, `.scss`) you would like.
Props MikeHansenMe, pross.
Fixes #22924.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-13 14:14:24 +00:00
John Blackbourn 815635548a Switch the remaining user-facing links to wordpress.org over to HTTPS.
Fixes #27115

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


git-svn-id: http://core.svn.wordpress.org/trunk@34748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-02 22:46:28 +00:00
Scott Taylor 8bb4c2c2e9 Theme Editor: ensure that files named `index.php` in theme subfolders are not labeled as "Main Index Template"
Props MikeHansenMe, wonderboymusic, bravokeyl, Shelob9.
Fixes #27201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-28 03:11:24 +00:00
Andrea Fercia f446d01b4c Bump H3 headings to H2 on the Theme Editor screen for better accessibility.
Props mrahmadawais.
Fixes #33660.
Built from https://develop.svn.wordpress.org/trunk@34066


git-svn-id: http://core.svn.wordpress.org/trunk@34034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 00:00:24 +00:00
Konstantin Obenland 7dc1d06e64 Proper heading for admin screens.
First step towards restoring a good heading structure in wp-admin.
The previous `<h1>` contained the site title and a link to the front page and was removed with the toolbar refactoring in 3.2.

Props joedolson, afercia.
Fixes #31650.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 15:41:25 +00:00
Dominik Schilling 64fc7294b6 Use HTTPS URLs for codex.wordpress.org.
see #27115.
Built from https://develop.svn.wordpress.org/trunk@32116


git-svn-id: http://core.svn.wordpress.org/trunk@32095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-12 21:29:32 +00:00
Helen Hou-Sandí d85f8fe326 Admin notices: Make (most) core notices dismissible.
These no longer return upon refreshing the page when JS is on and working, so users should be able to dismiss them. This is particularly important on the post edit screen when DFW is triggered, but pretty much all notices can be dismissed if needed. A post on Make/Core will follow with information on how this can be leveraged in plugins.

props valendesigns, afercia, paulwilde, adamsilverstein, helen.
fixes #31233. see #23367.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 22:06:28 +00:00
Andrew Ozz 321b551650 Fix focusing in the plugin and theme editors. Update the help.
Props afercia, Cheffheid. Fixes #31415.
Built from https://develop.svn.wordpress.org/trunk@31908


git-svn-id: http://core.svn.wordpress.org/trunk@31887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-26 22:35:27 +00:00
Scott Taylor af0e5cc851 Inline `<script>`s that are only printed in the admin for pages that are served with the HTML5 doctype absolutely do not need `CDATA` comments.
Props tw2113 for the initial patch.
See #18788.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-03 05:46:25 +00:00
Drew Jaynes 097dc8ee15 Fix syntax for single- and multi-line comments in wp-admin-directory files.
See #28931.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-17 09:14:16 +00:00
Scott Taylor 2f513d3320 Fix some `hackificator` odds and ends in `wp-admin`:
* `wp-activate.php` and `wp-admin/themes.php` don't need the closing PHP tag
* Switch single quotes for HTML attribute values to double in a few places
* Convert `include_once file.php` syntax to `include_once( 'file.php' )`
* Add access modifiers to methods/members in: `_WP_List_Table_Compat`, `Walker_Nav_Menu_Edit`, `Walker_Nav_Menu_Checklist`, `WP_Screen`, `Walker_Category_Checklist`
* `edit_user()` doesn't need to import the `$wpdb` global
* `wp_list_widgets()` doesn't need to import the `$sidebars_widgets` global
* switch/endswitch syntax is not supported in Hack
* A `<ul>` in `wp-admin/users.php` is unclosed

See #27881.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-19 05:04:16 +00:00
Scott Taylor e9bb9c0f12 In `wp-admin/theme-editor.php`, `break` is unreachabled after `exit`.
See #27882.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-06 18:16:26 +00:00
Andrew Nacin 0c16c0477b Reference https://wordpress.org rather than http://wordpress.org in strings, links, comments, etc.
props Ipstenu, markjaquith.
see #27115.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-03 02:34:27 +00:00
Andrew Ozz 8d6059b383 Remove all screen_icon() calls and deprecate the functions, props TobiasBg, fixes #26119
Built from https://develop.svn.wordpress.org/trunk@26518


git-svn-id: http://core.svn.wordpress.org/trunk@26411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-02 03:53:11 +00:00
Andrew Nacin fd57b239d2 Don't rely on include_path to include files.
Always use dirname() or, once available, ABSPATH.

props ketwaroo, hakre.
fixes #17092.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-09-25 00:18:11 +00:00
Sergey Biryukov 5ab3d3bf54 Remove redundant context for Child Themes link. fixes #25079.
Built from https://develop.svn.wordpress.org/trunk@25099


git-svn-id: http://core.svn.wordpress.org/trunk@25081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-08-23 00:31:10 +00:00
Sergey Biryukov 57c10eadbb Use ellipsis instead of three dots. props tjsingleton, jordie23, wojtek.szkutnik, DrewAPicture, SergeyBiryukov. see #8714.
git-svn-id: http://core.svn.wordpress.org/trunk@24207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-05-08 21:27:31 +00:00
Andrew Nacin b96c604833 Don't unslash variables that came from wp_reset_vars(). see #21767.
git-svn-id: http://core.svn.wordpress.org/trunk@23580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 18:59:54 +00:00
Ryan Boren f3a83744e9 Use wp_unslash() instead of stripslashes() and stripslashes_deep(). Use wp_slash() instead of add_magic_quotes().
git-svn-id: http://core.svn.wordpress.org/trunk@23567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 17:14:09 +00:00
Ryan Boren 43a7e695e9 Revert 23416, 23419, 23445 except for wp_reset_vars() changes. We are going a different direction with the slashing cleanup, so resetting to a clean slate. see #21767
git-svn-id: http://core.svn.wordpress.org/trunk@23554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-03-01 16:28:40 +00:00
Andrew Nacin 12c4b9bae9 Do not unslash variables reset by wp_reset_vars(). Remove variables that have never been used in plugin-editor.php. see #21767.
git-svn-id: http://core.svn.wordpress.org/trunk@23419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-15 02:01:36 +00:00
Ryan Boren cc5ed3a485 Change all core API to expect unslashed rather than slashed arguments.
The exceptions to this are update_post_meta() and add_post_meta() which are often used by plugins in POST handlers and will continue accepting slashed data for now.

Introduce wp_upate_post_meta() and wp_add_post_meta() as unslashed alternatives to update_post_meta() and add_post_meta(). These functions could become methods in WP_Post so don't use them too heavily yet.

Remove all escape() calls from wp_xmlrpc_server. Now that core expects unslashed data this is no longer needed.

Remove addslashes(), addslashes_gpc(), add_magic_quotes() calls on data being prepared for handoff to core functions that until now expected slashed data. Adding slashes in no longer necessary.

Introduce wp_unslash() and use to it remove slashes from GPCS data before using it in core API. Almost every instance of stripslashes() in core should now be wp_unslash(). In the future (a release or three) when GPCS is no longer slashed, wp_unslash() will stop stripping slashes and simply return what is passed. At this point wp_unslash() calls can be removed from core.

Introduce wp_slash() for slashing GPCS data. This will also turn into a noop once GPCS is no longer slashed. wp_slash() should almost never be used. It is mainly of use in unit tests.

Plugins should use wp_unslash() on data being passed to core API.

Plugins should no longer slash data being passed to core. So when you get_post() and then wp_insert_post() the post data from get_post() no longer needs addslashes(). Most plugins were not bothering with this. They will magically start doing the right thing. Unfortunately, those few souls who did it properly will now have to avoid calling addslashes() for 3.6 and newer.

Use wp_kses_post() and wp_kses_data(), which expect unslashed data, instead of wp_filter_post_kses() and wp_filter_kses(), which expect slashed data. Filters are no longer passed slashed data.

Remove many no longer necessary calls to $wpdb->escape() and esc_sql().

In wp_get_referer() and wp_get_original_referer(), return unslashed data.

Remove old stripslashes() calls from WP_Widget::update() handlers. These haven't been necessary since WP_Widget.

Switch several queries over to prepare().

Expect something to break.

Props alexkingorg
see #21767


git-svn-id: http://core.svn.wordpress.org/trunk@23416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-14 22:51:06 +00:00
Mark Jaquith da5c7a7c62 "Lookup" is a noun. "Look up" is the verb form. If you doubt me, you should have lookuped in a dictionary.
props johnbillion, SergeyBiryukov. fixes #22386

git-svn-id: http://core.svn.wordpress.org/trunk@23393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-02-08 16:19:04 +00:00
Andrew Nacin fb36abe6b7 Always URL-encode a stylesheet directory value before using it in a URL. These situations are saved by wp_nonce_url(), but we should not depend on that. see #21749, for trunk only.
git-svn-id: http://core.svn.wordpress.org/trunk@21755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-09-04 22:35:12 +00:00
azaozz 67d4a5f71a Move the description for tabbing out of the plugin and theme editors textareas to the Help tab, fixes #21347
git-svn-id: http://core.svn.wordpress.org/trunk@21358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-27 16:49:48 +00:00
azaozz 34535097b7 Remove nearly all tabindex attributes from the admin, leaving them only where absolutely necessary (for now that's only the toolbar).
Add tabindex="-1" for the menu images links to avoid double tab stops there when the menu is expanded.

Fix/add auto-focus on the first input fields on the Add/Edit Post, all taxonomy, all edit taxonomy, Log In and Edit Comment screens.

See #21340.

git-svn-id: http://core.svn.wordpress.org/trunk@21311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-24 00:15:15 +00:00
azaozz 6d556cbcdb Make it possible to tab out of the plugin and theme editors textareas by pressing Esc followed by Tab, fixes #21347
git-svn-id: http://core.svn.wordpress.org/trunk@21310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-07-23 23:46:27 +00:00
ryan b66fb16fe5 Show the template name instead of just the filename. Props arieputranto, SergeyBiryukov. fixes #20718
git-svn-id: http://core.svn.wordpress.org/trunk@20844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-05-22 15:25:35 +00:00
nacin 1e500bd76a Remove WP_Theme::is_child_theme() in favor of WP_Theme::parent(). see #20546.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-25 17:34:19 +00:00
nacin 53bdf5bffc Issue a 'This theme is broken' error (when applicable) on the theme editor. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-21 21:23:27 +00:00
nacin d62b91f228 Adjust [20557] and check only parent(), as it is more semantic. We don't care if the theme considers itself to be a child theme, we care if it has a valid parent. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-21 21:03:23 +00:00
nacin a5a13979bd A child theme with a missing parent might be is_child_theme() but not have a valid parent() object, so we need to check parent() too. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-21 21:00:24 +00:00
nacin f73524c272 Don't allow themes without a style.css editor to be edited. These themes are too broken to be salvaged by the theme editor. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-21 20:57:54 +00:00
nacin 789b3714d3 Use WP_Theme::exists(). see #20361.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-04-06 19:21:31 +00:00
nacin 70aa7f9607 Clear theme cache after editing. Reduce default cache persistence to 1800. (Could go lower.) see #20331.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-30 14:39:05 +00:00
nacin 5b8037afe6 Always set WP_Theme->template even when there is an error and we have no idea what the template is. (Assume it is the stylesheet.) Prevents a number of issues including WP_Theme->is_child_theme() lying. Tidy the theme editor for broken themes and themes with no templates (PHP files), or no template (parent), or are broken. Allow broken themes to be edited. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-29 04:16:17 +00:00
nacin 107733e263 urldecode() the incoming $file in the theme editor. see [20313] when the encode was added. see #2994 for the original bug report. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-29 03:34:51 +00:00
nacin 23abe58a59 Rewrite theme-editor.php to use the new WP_Theme API. see #20103.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-03-29 03:00:38 +00:00
ryan 83b131f8e3 User lowercase true, false, null instead of uppercase. Props c3mdigital, mfields. fixes #16302
git-svn-id: http://svn.automattic.com/wordpress/trunk@19687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2012-01-05 20:50:54 +00:00
ryan 6bba5a265b Pinking shears
git-svn-id: http://svn.automattic.com/wordpress/trunk@19528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-12-01 04:51:35 +00:00
ryan efbbab1b3c Help tabs. Props chexee. see #19020
git-svn-id: http://svn.automattic.com/wordpress/trunk@19445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-24 00:21:39 +00:00
nacin cece838d8f More s/add_help_sidebar/set_help_sidebar/. fixes #19020.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-02 21:32:16 +00:00
ryan 366db8c10b Use add_help_sidebar(). see #19020
git-svn-id: http://svn.automattic.com/wordpress/trunk@19114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-11-02 05:33:53 +00:00
azaozz 1cdec6ff6e Merge most admin css files, first run, see #18314
git-svn-id: http://svn.automattic.com/wordpress/trunk@18577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2011-08-21 03:46:43 +00:00