Commit Graph

121 Commits

Author SHA1 Message Date
Scott Taylor
8b1286417e ob_get_contents() followed by ob_end_clean() can be replaced by ob_get_clean().
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 01:12:24 +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
a51dfa3971 In the style of #30947 and default-filters.php, add 2 new files to wp-admin/includes:
`admin-filters.php`
`ms-admin-filters.php`

There are random actions and filters littered among files like `misc.php`. These files contain functions that won't work outside of admin context and are typically only loaded in files that have already loaded the admin bootstrap.

See #32529.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 17:04:26 +00:00
Scott Taylor
19a3aacc94 Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 15:43:29 +00:00
Scott Taylor
282e28ad81 Add @global annotations to (the rest of the?) wp-admin/* files.
Does not include list table file changes.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 02:06:31 +00:00
Dominik Schilling
e0657e6904 Don't return empty themes in wp_prepare_themes_for_js().
see #32002.
Built from https://develop.svn.wordpress.org/trunk@32264


git-svn-id: http://core.svn.wordpress.org/trunk@32235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-22 16:11:25 +00:00
Helen Hou-Sandí
1d1c026e8e Rename the pre_wp_prepare_themes_for_js filter to pre_prepare_themes_for_js.
props DrewAPicture.
fixes #31789.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-21 14:23:27 +00:00
Dominik Schilling
786bce5b9c Customizer: Escape theme preview URLs.
props johnbillion, ocean90.
see #31896.
Built from https://develop.svn.wordpress.org/trunk@32134


git-svn-id: http://core.svn.wordpress.org/trunk@32113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-15 16:33:25 +00:00
Dominik Schilling
8ab7c076d6 Customizer Theme Switcher: Switch the details/live preview buttons.
props celloexpressions, ocean90.
fixes #31791.
Built from https://develop.svn.wordpress.org/trunk@31954


git-svn-id: http://core.svn.wordpress.org/trunk@31933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-01 12:36:26 +00:00
Sergey Biryukov
efb2740e88 Themes: Add a filter to short-circuit wp_prepare_themes_for_js().
props mattwiebe, DrewAPicture.
fixes #31789.
Built from https://develop.svn.wordpress.org/trunk@31943


git-svn-id: http://core.svn.wordpress.org/trunk@31922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-31 20:04:25 +00:00
Dominik Schilling
289db2d37b Customizer: Revert [31911]. We want to preserve url and return URL parameters to make the experience smoother.
see #31782.
Built from https://develop.svn.wordpress.org/trunk@31933


git-svn-id: http://core.svn.wordpress.org/trunk@31912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-30 19:22:26 +00:00
Mark Jaquith
8b180b9a46 Add theme browsing and theme switching to the Customizer
* Brings into core the Customizer Theme Switcher feature plugin
* You can now browse, preview, and activate themes right from the Customizer

fixes #31303.
props celloexpressions, afercia, westonruter, folletto, designsimply
Built from https://develop.svn.wordpress.org/trunk@31533


git-svn-id: http://core.svn.wordpress.org/trunk@31514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-24 20:31:24 +00:00
Sergey Biryukov
1e0905793c Avoid inadvertent stomping of the original $args parameter passed to plugins_api_result and themes_api_result filters in plugins_api() and themes_api(), respectively.
Fixes a regression introduced in [25956].

props Corphi, obenland.
fixes #29079.
Built from https://develop.svn.wordpress.org/trunk@31363


git-svn-id: http://core.svn.wordpress.org/trunk@31344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-02-07 06:21:22 +00:00
Scott Taylor
0f6d0b84d1 Remove unused local vars in delete_plugins(), delete_theme(), WP_Date_Query->validate_date_values(), global_terms(), and WP_Text_Diff_Renderer_Table->_changed().
This will clear out the "Unused Code" label in the next Scrutinizer report.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:19:22 +00:00
Scott Taylor
fe6b5983df In PHP 5.0.0, is_a() became deprecated in favour of the instanceof operator. Calling is_a() would result in an E_STRICT warning.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 01:06:24 +00:00
Scott Taylor
60b0cd7943 The keyword elseif should be used instead of else if so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. 

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-08 07:05:25 +00:00
Scott Taylor
5eb5afac34 For clarity, initialize some arrays that previously were only assigned via short circuit in loops.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-20 22:47:22 +00:00
Dominik Schilling
eccd5a5eda Pass locale to wordpress.org theme/plugin API.
In the future this will be used to return localized plugin/theme info.

see #30735.
Built from https://develop.svn.wordpress.org/trunk@30944


git-svn-id: http://core.svn.wordpress.org/trunk@30933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-16 22:39:22 +00:00
John Blackbourn
6fcf4ed3c5 Prevent the deletion of a theme while it has an active child theme.
Fixes #29580
Props karpstrucking, jesin

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


git-svn-id: http://core.svn.wordpress.org/trunk@30687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-02 02:21:24 +00:00
Scott Taylor
2c32752abd Improve various @param docs for src/wp-admin/*.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-01 01:00:22 +00:00
Dominik Schilling
57c41263d7 Language packs: Remove translations when deleting a theme or a plugin.
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.
Built from https://develop.svn.wordpress.org/trunk@29856


git-svn-id: http://core.svn.wordpress.org/trunk@29619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-08 19:05:20 +00:00
Drew Jaynes
d33c807723 Fix some documentation typos in various core files.
Props vlajos.
Fixes #29199.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-13 03:56:17 +00:00
Dominik Schilling
57c914f75a Customizer: Add meta capability customize which is mapped to edit_theme_options.
You can now allow users to access the Customizer, say for any user who can `edit_posts`, via `map_meta_cap` or `user_has_cap` filter. See ticket for examples.

props westonruter, nacin.
fixes #28605.
Built from https://develop.svn.wordpress.org/trunk@29170


git-svn-id: http://core.svn.wordpress.org/trunk@28954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-14 19:01:16 +00:00
Sergey Biryukov
997cbaa03c Use a time constant in get_theme_feature_list() and File_Upload_Upgrader.
props GaVrA.
fixes #28124.
Built from https://develop.svn.wordpress.org/trunk@28253


git-svn-id: http://core.svn.wordpress.org/trunk@28081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-05 08:26:24 +00:00
Andrew Nacin
2bc282957c Translate a string added in 3.7.1 but never translated previously.
props SergeyBiryukov.
fixes #27819.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-16 00:38:14 +00:00
Andrew Nacin
9f81d0526e Theme Installer: Revert to proxying through PHP for WordPress.org API requests.
This is to ensure we have valid installation nonces, though we've run into this as a problem previously (see #27639, #27581, #27055).

A tad slower, but we gained speed in 3.9 by simplifying the request made to the API.

props ocean90.
fixes #27798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-15 01:16:14 +00:00
Andrew Nacin
e7fc009f7c Theme Installer: Combine 'Layout' and 'Columns' filters so 'Features' can span two columns.
see #27055.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-08 04:30:15 +00:00
Andrew Nacin
b5d0471fef Merge some theme update strings.
props pavelevap, yoavf.
fixes #25083.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-26 20:08:15 +00:00
Andrew Nacin
17ccbc86c9 Rename the new page_templates filter to theme_page_templates, and pass it a post object for proper context.
see #13265.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-08 04:19:16 +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
Sergey Biryukov
3a7ce85b4f Change 'Width' to 'Layout' to match the hard-coded list of translatable theme features in get_theme_feature_list().
props janrenn.
fixes #26777 for trunk.
Built from https://develop.svn.wordpress.org/trunk@26905


git-svn-id: http://core.svn.wordpress.org/trunk@26788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-01-05 17:16:11 +00:00
Ryan Boren
07c16fd23c The Pinking Shears stir from their slumber, awakened by what may seem, to those
innocent in the ways of The Shears, a triviality, a nothing-of-consequence. But there are consequences indeed for recklessly trailing your whitespace. Naturally, they a dire!

One, two! One, two! And through and through
The Pinking Shears went snicker-snack!
They plucked your tail and with your space
They went sniksnuking back.

Let me tell you, that can be uncomfortable, so always pre-sniksnuk your trailing whites. May The Shears be with you.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-11 19:49:11 +00:00
Drew Jaynes
7bf5470bab Inline documentation fixes for hooks and functions introduced in 3.8.0.
Built from https://develop.svn.wordpress.org/trunk@26736


git-svn-id: http://core.svn.wordpress.org/trunk@26625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-06 19:18:11 +00:00
Andrew Nacin
df48cebeb4 No-JavaScript and no-Customizer support for the new Themes screen.
JavaScript is rarely disabled, but graceful degradation is still important. For example, syntax errors can occur, usually with major WP updates that overhaul entire experiences and update external libraries combined with themes or plugins doing weird or old things. If this error is due to their current theme, a user needs to be able to access the themes screen to switch away from the theme. A more subtle issue could make things painful to diagnose.

This commit renders the grid in PHP (the template is duplicated, but it lightweight, fairly mundane, and easy to sync). On Backbone render, the grid is then re-rendered from JavaScript so searches can occur. Customize and Live Preview is disabled if JS fails to kick in. If JS is disabled, old-school "Preview" links are displayed.

No-Customizer support: The customizer is only supported when the browser supports postMessage (IE8+), and if the frontend is a different domain, CORS (IE10+). We use the .hide-if-no-customize class for this. Pre-customize "Preview" links should use .hide-if-customize.

The .load-customize class should be used to declare a link that opens the customizer. This enables customize-loader.js to intercept this link and load the customizer on top of the current window, making for a smoother experience.

fixes #25964.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-06 16:11:10 +00:00
Matt Mullenweg
ba93d95af0 Add and display new tags to highlight the ever-growing number of responsive themes available. Fixes #21442.
Props Otto42 and lancewillett.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-06 01:07:11 +00:00
Andrew Nacin
08430e2684 Theme: When showing an author in the grid (during a search), don't include the author's link.
fixes #26433.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-05 19:08:10 +00:00
Matt Mullenweg
e20a684463 Create a new tag for themes that have passed the theme check guidelines for accessibility. Fixes #26157
Props lancewillett.


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


git-svn-id: http://core.svn.wordpress.org/trunk@26548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-05 03:49:10 +00:00
Drew Jaynes
087289b6a4 Hook docs pinking shears.
Built from https://develop.svn.wordpress.org/trunk@26631


git-svn-id: http://core.svn.wordpress.org/trunk@26521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-04 20:03:09 +00:00
Andrew Nacin
bd17d08545 Add wp_prepare_themes_for_js filter to wp_prepare_themes_for_js().
props kovshenin.
fixes #25948.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-04 19:21:10 +00:00
Andrew Nacin
c6ddea79d1 Themes: Always include the current theme in the list, even if it is not allowed.
see #25948.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-02 18:46:11 +00:00
Dion Hulse
8ad620e51f Themes: Do extra Cap checks before outputting links, and use full URI's. See #25948
Built from https://develop.svn.wordpress.org/trunk@26470


git-svn-id: http://core.svn.wordpress.org/trunk@26368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-29 09:01:09 +00:00
Dion Hulse
c8b13eaa35 Themes: When the user doesn't have switch_themes capabilities, and we've passed the current theme, detect the theme slug/stylesheet correctly so that the flags are set properly. See #25948
Built from https://develop.svn.wordpress.org/trunk@26469


git-svn-id: http://core.svn.wordpress.org/trunk@26367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-29 08:38:09 +00:00
Dion Hulse
61ed60c619 Themes: Move the escaping of content from JS back to PHP. This allows us to take advantage of the display() WP_Theme method to translate the text properly, and to strip out any HTML tags we don't wish to display. Fixes #26100. See #25948
Built from https://develop.svn.wordpress.org/trunk@26316


git-svn-id: http://core.svn.wordpress.org/trunk@26220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-22 02:34:10 +00:00
Dion Hulse
893262f742 Themes: Add a get_theme_update_available() function to retrieve an update link and use it on the Themes page. See #26078
Built from https://develop.svn.wordpress.org/trunk@26282


git-svn-id: http://core.svn.wordpress.org/trunk@26187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-20 02:57:10 +00:00
Dion Hulse
5862ddbd8f Appearance: Fix a PHP Notice when the update transient isn't available (for example, due to a timeout or being used offline). See #25948
Built from https://develop.svn.wordpress.org/trunk@26278


git-svn-id: http://core.svn.wordpress.org/trunk@26183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-20 01:40:09 +00:00
Andrew Nacin
1832d880a5 Sort themes by name on the new themes.php page. see #25948.
Built from https://develop.svn.wordpress.org/trunk@26216


git-svn-id: http://core.svn.wordpress.org/trunk@26124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-15 16:42:10 +00:00
Andrew Nacin
52ecbebba3 Remove debug cruft. props dimadin. see #25948.
Built from https://develop.svn.wordpress.org/trunk@26215


git-svn-id: http://core.svn.wordpress.org/trunk@26123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-15 16:40:09 +00:00
Andrew Nacin
dce9327f2a Update the Themes screen, merging THX into core.
* Name: THX38
 * Description: Update the Themes screen with a new design and experience.
 * Tags: visually-focused, bigger-screenshots, fast, mobile-friendly, backbone-driven
 * Author: matveb, shaunandrews, melchoyce, designsimply, shelob9
 * URI: http://wordpress.org/plugins/thx38/

fixes #25948


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


git-svn-id: http://core.svn.wordpress.org/trunk@26052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-13 20:58:05 +00:00
Andrew Nacin
d0cfa40983 Add jshintrc to qunit.
props jorbin.
see #25187.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-30 14:39:10 +00:00
Andrew Nacin
a8ef13972c When an HTTPS request to api.wordpress.org fails, try an insecure HTTP request and issue a warning.
Certain versions of cURL appear to claim OpenSSL support but fail to work. We need to not trap users on older versions while we work this out, and instead fall back to an insecure request.

see #25716 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@25915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-10-27 21:09:10 +00:00