Andrew Ozz
5d4a0adebd
Don't pass non-existing rtl stylesheet to TinyMCE, update phpdoc for add_editor_style(), see #19437
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20059 602fd350-edb4-49c9-b593-d223f7449a82
2012-03-01 00:18:26 +00:00
Andrew Nacin
b57da5a92a
Strict comparisons for the $allowed arg for wp_get_themes(). Otherwise 'network' does == true. see #20103 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20053 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 23:04:25 +00:00
Andrew Nacin
6a4a8df204
Deprecate get_current_theme(). Use (string) wp_get_theme() to get the translated name of the theme. Keep the current_theme option for now. see #20103 , see #20138 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20040 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 20:07:22 +00:00
Andrew Nacin
7253e53962
Update switch_theme() to use wp_get_theme(). see #20103 , #20138 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20033 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-29 05:09:29 +00:00
Andrew Nacin
53a209a4ee
Introduce WP_Theme, wp_get_themes(), and wp_get_theme() to replace get_themes(), get_theme(), get_theme_data(), current_theme_info(), and others.
...
* Getters and Helpers: Introduces a series of methods to allow for easy generation of headers for display, and other theme metadata, including page templates.
* Screenshots: Handles support for multiple screenshots. (see # Additional screenshots must be PNG and start with screenshot-2.png, and be sequential to be counted. see #19816 .
* Error Handling: Broken themes have a WP_Error object attached to them.
* Caching: Introduces a wp_cache_themes_persistently filter (also in [20020]) to enable persistent caching of all filesystem and sanitization operations normally handled by WP_Theme (and formerly get_file_data() and get_themes()). Themes are cached individually and across five different cache keys for different data pieces.
* Compatibility: A WP_Theme object is backwards compatible with a theme's array formerly returned by get_themes() and get_theme(), and an stdClass object formerly returned by current_theme_info().
* i18n/L10n: Theme headers are now localizable with proper Text Domain and Domain Path headers, like plugins. (Language packs may remove the requirement for headers.) For page templates, see #6007 (not fixed yet, but will be easy now). For headers, fixes #15858 .
* PHP and CSS files: New methods that fetch a list of theme files (for the theme editor) only on demand, rather than only loading them into memory. fixes #11214 .
Functions deprecated:
* get_themes(), get_allowed_themes() and get_broken_themes() -- use wp_get_themes()
* get_theme() and current_theme_info() -- use wp_get_theme()
* get_site_allowed_themes() -- use WP_Theme::get_allowed_on_network()
* wpmu_get_blog_allowedthemes() -- use WP_theme::get_allowed_on_site()
see also [20016], [20018], [20019], [20020], [20021], [20022], [20025], [20026], [20027]. also fixes #19244 .
see #20103 .
git-svn-id: https://develop.svn.wordpress.org/trunk@20029 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 21:24:44 +00:00
Andrew Nacin
696f52729e
Theme root transient caching is now in search_theme_directories(), not get_themes(). see #20103 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20021 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 20:08:08 +00:00
Andrew Nacin
3459ca246e
Rewrite search_theme_directories() -- better performance and allow for caching.
...
* Update it to use PHP5 scandir().
* Don't scan individual theme dirs -- we only need to check for style.css. (Solid performance gains.)
* Improve and simplify branching.
* Introduce wp_cache_themes_persistently filter to enable persistent caching of the return value, based on the theme_roots transient.
see #20103 .
git-svn-id: https://develop.svn.wordpress.org/trunk@20020 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 20:05:00 +00:00
Andrew Nacin
75540de79c
Clarify second argument for get_raw_theme_root() as the multiple negatives can get confusing. see #20103 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20018 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 19:59:53 +00:00
Andrew Nacin
d738367d99
Fix the return value of get_theme_root() when the theme root is outside of WP_CONTENT_DIR, thus making it absolute rather than the typical relative theme root.
...
Make get_theme_root_uri() tolerate an absolute path for a theme root. It will now make an attempt to find a corresponding URL for absolute paths as well.
see #17597 .
git-svn-id: https://develop.svn.wordpress.org/trunk@20016 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 18:02:21 +00:00
Andrew Nacin
bf2495e09c
Revert [20001]. Theme roots that are passed around, stored, and cached can be valid as absolute paths or paths relative to wp-content. We'll have to patch this elsewhere. see #17597 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20015 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 16:22:26 +00:00
Andrew Nacin
563c3231b2
Move the template loading functions from wp-includes/theme.php to wp-includes/template.php. This includes get_query_template(), locate_template(), and friends. see #20103 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@20002 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 01:49:49 +00:00
Andrew Nacin
97adddcaf7
Always return an absolute path in get_raw_theme_root() and get_theme_roots().
...
These functions were changed in [15641] to avoid any calculations when only one theme directory is registered. However, the short-circuit ended up being relative to WP_CONTENT_DIR, rather than absolute. This broke situations where theme roots are outside the content directory (technically allowed), and made return values inconsistent, as when multiple roots were registered, absolute paths were always returned.
fixes #17597 . see #20103 . see #14911 .
git-svn-id: https://develop.svn.wordpress.org/trunk@20001 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-28 01:28:56 +00:00
Daryl Koopersmith
9f29c06954
Introduce new theme customizer to replace theme preview. Rough first pass. props koopersmith, ocean90. see #19910 .
...
Merges in http://plugins.svn.wordpress.org/gandalf/branches/dev/ rev 510148.
git-svn-id: https://develop.svn.wordpress.org/trunk@19995 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-25 04:12:43 +00:00
Andrew Nacin
b21b3b75f3
Twenty Twelve always trumps its pretenders. see #19978 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19969 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-21 17:39:05 +00:00
Andrew Nacin
b3aee653fd
Return an empty object properly. see #17242 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19821 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-03 13:38:03 +00:00
Ryan Boren
80cc194365
Allow flexible sizes for custom header uploads. Round 1. Props aaroncampbell, sabreuse. see #17242
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19815 602fd350-edb4-49c9-b593-d223f7449a82
2012-02-02 23:35:37 +00:00
Ryan Boren
a8d77cbae9
User lowercase true, false, null instead of uppercase. Props c3mdigital, mfields. fixes #16302
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19687 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-05 20:50:54 +00:00
Ryan Boren
7f92b7ec89
Allow pluggable arg checking in current_theme_supports. Props dd32. fixes #11611
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19682 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-05 18:29:40 +00:00
Ryan Boren
f1ec82c3a7
Update some @since. Props dgwyer. fixes #19638
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19673 602fd350-edb4-49c9-b593-d223f7449a82
2012-01-04 19:03:33 +00:00
Andrew Nacin
1af5a43882
Hide the toolbar on all subsequent links in the theme preview. props linuxologos, fixes #19610 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19617 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-20 22:10:47 +00:00
Ryan Boren
676ba7043e
Use one space, not two, after trailing punctuation. fixes #19537
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19593 602fd350-edb4-49c9-b593-d223f7449a82
2011-12-13 23:45:31 +00:00
Andrew Nacin
f4659c7f76
Check is_array() against get_themes() in get_theme(). props cgrymala, see #19244 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19287 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-14 23:56:18 +00:00
Ryan Boren
d154749f87
Avoid notice when themes dir is empty or missing. Don't reset current theme in current_theme_info() if there are no themes. Show warning in Right Now if there are no themes. Props azaozz. fixes #19089
...
git-svn-id: https://develop.svn.wordpress.org/trunk@19251 602fd350-edb4-49c9-b593-d223f7449a82
2011-11-11 14:10:54 +00:00
Andrew Nacin
90f95e0204
new does not require by reference.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18995 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-18 20:20:59 +00:00
Mark Jaquith
0fe5c09e64
Give custom background CSS more specificity. props GaryJ. fixes #18698
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18886 602fd350-edb4-49c9-b593-d223f7449a82
2011-10-05 17:20:43 +00:00
Ryan Boren
8e77c91883
* Move the old sidebars_widgets array upgrade code to wp-admin/includes/upgrade.php
...
* Avoid infinite loop with wp_get_sidebars_widgets()
* Remove two unneeded wp_get_sidebars_widgets() calls
* Remove unused $wp_registered_sidebars variable from wp_get_sidebars_widgets().
* Combine a couple of !empty( $sidebars_widgets ) checks in retrieve_widgets()
Props SergeyBiryukov, lancewillett. fixes #17979 #18598
git-svn-id: https://develop.svn.wordpress.org/trunk@18821 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-29 21:41:22 +00:00
Jon Cave
7c0d6373af
Allow current_theme_supports() to be used to check for specific post formats. Props ericmann. Fixes #18691 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18720 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-19 16:29:03 +00:00
Andrew Ozz
647031a087
Rename the newly added action 'after_theme_change' to 'after_switch_theme' so it matches the 'switch_theme' action, props scribu, see #17979
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18656 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-08 20:59:41 +00:00
Andrew Ozz
7b2c49d219
Make check_theme_switched() run an action so this enhancement is available to plugins and themes too, see #17979
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18655 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-08 20:07:15 +00:00
Andrew Ozz
808ea899ad
Use theme mods instead of transients for storing the previous theme's widgets config, props aaroncampbell, see #17979
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18654 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-08 19:25:20 +00:00
Jon Cave
82c0f09c09
Fix typos in documentation (wp-includes/[i-z]). See #18560 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18639 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-05 19:08:15 +00:00
Andrew Ozz
4782c3dc6f
Avoid losing widgets when switching themes - take one, props aaroncampbell, see #17979
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18630 602fd350-edb4-49c9-b593-d223f7449a82
2011-09-02 22:13:55 +00:00
Ryan Boren
b1e314fbf7
Add theme support option for turning on random default headers. fixes #17832
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18325 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-22 19:09:23 +00:00
Dion Hulse
e1af5b5cb2
Twenty Eleven trumps it's pretenders. Fixes #17841
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18322 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-20 03:07:24 +00:00
Andrew Nacin
a657a1986c
@since s/3.2/3.2.0/
...
git-svn-id: https://develop.svn.wordpress.org/trunk@18268 602fd350-edb4-49c9-b593-d223f7449a82
2011-06-11 04:40:18 +00:00
Ryan Boren
57b6c9aeda
Sanitize guid on save and display. Sanitize mime type on save. Don't allow changing mime type via edit form handlers. Protect hidden meta.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17994 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-22 23:19:42 +00:00
Andrew Nacin
6076211cc6
Code readability improvements. props niallkennedy, fixes #17166 , #17182 , #17231 , #16474 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17989 602fd350-edb4-49c9-b593-d223f7449a82
2011-05-22 22:30:05 +00:00
Ryan Boren
54822700b8
Fix hiding of header image. Fix radio selection when falling back to randomized default headers. Props lancewillett, kawauso. see #17240
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17770 602fd350-edb4-49c9-b593-d223f7449a82
2011-04-29 19:45:30 +00:00
Ryan Boren
405093f3de
Allow selecting previously uploader headers and randomly serving previously uploaded or default headers. Props lancewillett. see #17240
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17757 602fd350-edb4-49c9-b593-d223f7449a82
2011-04-28 23:02:16 +00:00
Peter Westwood
bdb4930bbe
Remove this new filter as it didn't get enough discussion prior to addition.
...
Revisit later. See #14310 .
git-svn-id: https://develop.svn.wordpress.org/trunk@17316 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-15 23:44:06 +00:00
Ryan Boren
eba71eb7c0
Bring out the shears.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17228 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-06 04:11:14 +00:00
Mark Jaquith
b50eccafb9
I bungled [17214]. Reverting the revert, so it can be reverted properly! see #14310
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17220 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-04 20:55:59 +00:00
Mark Jaquith
0f477199c3
Revert [15611] for 3.1. Needs more time for peer review and iteration. see #14310
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17214 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-04 07:23:41 +00:00
Ryan Boren
26597c2e34
Ignore unsupported post types in add_theme_support(). Props garyc40. fixes #16073
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17213 602fd350-edb4-49c9-b593-d223f7449a82
2011-01-03 23:56:42 +00:00
Andrew Nacin
1c309312a0
Revert [16915]. Don't honor the page template for the posts page. Deal with this with a better UX in 3.2. see #15513 , fixes #15945 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17123 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-23 17:05:47 +00:00
Ryan Boren
34ef8c8df9
Translations in title attributes require esc_attr().
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17102 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-21 17:17:58 +00:00
Peter Westwood
373ed6ae4e
-- bad white space part deux
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17023 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-17 08:42:37 +00:00
Peter Westwood
6853258d19
If we are previewing don't show the admin bar. See #15856
...
git-svn-id: https://develop.svn.wordpress.org/trunk@17020 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-17 08:32:53 +00:00
Andrew Nacin
a653754287
Add theme_mods option if is_admin. props MarkJaquith, fixes #14828 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@16958 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-15 17:39:00 +00:00
Andrew Nacin
8b6cf91dc9
Revert to WP_DEFAULT_THEME if a child theme is in use and no style.css is present. fixes #15712 , props greuben.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@16925 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-14 19:19:47 +00:00