* Specify default background colors for the bundled themes.
* Change the default custom background callback to only operate on saved values, rather than default values.
* Prevent an unsaved default value from overriding a manually modified style.css file.
Props nacin, kobenland
fixes#20448
git-svn-id: http://core.svn.wordpress.org/trunk@20973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Removes script queue check for 'customize-loader' from wp_customize_support_script(), because we may want to check for customize-support on a page without the loader.
git-svn-id: http://core.svn.wordpress.org/trunk@20918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If the custom background default wp-head-callback (_custom_background_cb) is used, we use postMessage for all custom background properties. Otherwise, we use full refreshes.
When using postMessage, the preview recalculates the custom background CSS block, allowing it to omit CSS values when they are not present and fall back on the original CSS.
git-svn-id: http://core.svn.wordpress.org/trunk@20908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
If there is a default color registered, show a 'Default' action rather than a 'Clear' action, as clearing the value would simply return to the default.
Make current_theme_supports() accept a second argument for 'custom-background' requests, the same as get_theme_support(). Missed in earlier changes, see #20249.
fixes#20734, fixes#18041.
git-svn-id: http://core.svn.wordpress.org/trunk@20901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add wp_customize_support_script(), to quickly alter the body class based on whether customize is supported.
git-svn-id: http://core.svn.wordpress.org/trunk@20893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Rename WP_Customize to WP_Customize_Manager.
* Move customize-controls.php to wp-admin/customize.php.
* Make customize.php the formal entry point, rather than admin.php?customize=on.
* Rename is_current_theme_active() to is_theme_active().
* Add getters for the theme, settings, controls, and sections properties.
* Allow customize.php (no ?theme=) to load the active theme. Not used yet.
see #20736.
git-svn-id: http://core.svn.wordpress.org/trunk@20852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Causes the Manage Themes page to refresh if the customizer is closed after the active theme is switched.
* Changes the text of the 'Save and Activate' button once the theme has been activated.
* Improves the naming of the customize control settings.
* Add events to customize.Loader and make callbacks more flexible.
* Makes the customize-loader l10n compatible with non-admin settings.
* Adds WP_Customize->is_current_theme_active().
* Minor style corrections, including jQuery.attr/prop changes.
git-svn-id: http://core.svn.wordpress.org/trunk@20802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Combine the setup_theme() and customize_previewing() methods. Remove the set_template() and set_stylesheet() methods. Add set_theme() method to WP_Customize to store the working WP_Theme object. We will use this for the stylesheet and template.
Use the WP_Theme display() method when preparing headers for display, not get() or the deprecate properties.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Move the 'Return to Manage Themes' and 'Collapse Sidebar' actions from themes.php to customize-controls.php.
* Create a postMessage connection between themes.php and customize-controls.php.
* Allow the theme customizer to be accessed directly (independent of themes.php and the customize loader).
* Add wp_customize_href() and wp_customize_url().
* Remove wp_customize_loader(). To include the loader, use wp_enqueue_script( 'customize-loader' ).
* The theme customizer now requires postMessage browser support.
* Add .hide-if-customize and .hide-if-no-customize CSS classes.
* Clean up customize-preview.js.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* Use theme customizer in theme install/update screens.
* Separate the customize loader from the customizer. Use wp_customize_loader() to include the loader script and markup.
* Deprecated: wp-admin/js/theme-preview.js is now no longer used by core.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Custom header: Use add_theme_support('custom-header', $args) instead of add_custom_image_header(). Deprecates all use of constants.
* HEADER_TEXTCOLOR is now (string) 'default-text-color'.
* NO_HEADER_TEXT is nowi ! (bool) 'header-text'.
* HEADER_IMAGE_WIDTH (and _HEIGHT) are now (int) 'width' and 'height'.
* HEADER_IMAGE is now (string) 'default-image'.
* The 3.4 arguments 'suggested-width' and 'suggested-height' are now just 'width' and 'height' (they are "suggested" when flex-width and flex-height are set).
* Callback arguments for add_custom_image_header() can now be passed to add_theme_support().
Custom background: Use add_theme_support('custom-background, $args) instead of add_custom_background(). Deprecates all use of constants.
* BACKGROUND_COLOR is now (string) 'default-color'.
* BACKGROUND_IMAGE is now (string) 'default-image'.
* Callback arguments for add_custom_background() can now be passed to add_theme_support().
Inheritance: add_theme_support() arguments for custom headers and custom backgrounds is a first-one-wins situation. This is not an unusual paradigm for theming as a child theme (which is included first) overrides a parent theme.
* Once an argument is explicitly set, it cannot be overridden. You must hook in earlier and set it first.
* Any argument that is not explicitly set before WP is loaded will inherit the default value for that argument.
* It is therefore possible for a child theme to pass minimal arguments as long as the parent theme specifies others that may be necessary.
* Allows for a child theme to alter callbacks for <head> and preview (previously, calling add_custom_image_header more than once broke things).
* The just-in-time bits ensure that arguments fall back to default values, that the values of all constants are considered (such as one defined after an old add_custom_image_header call), and that all constants are defined (so as to be backwards compatible).
get_theme_support(): Introduce new second argument, which headers and backgrounds leverage to return an argument. current_theme_supports() already supported checking the truthiness of the argument.
* For example, get_theme_support( 'custom-header', 'width' ) will return the width specified during registration.
* If you had wanted the default image, use get_theme_support( 'custom-header', 'default-image' ) instead of HEADER_IMAGE.
Deprecate remove_custom_image_header(), remove_custom_background(). Use remove_theme_support('custom-header'), 'custom-background'.
Deprecate short-lived custom-header-uploads internal support; this is now (bool) 'uploads' for add_theme_support().
New 3.4 functions renamed or removed: Rename get_current_header_data() to get_custom_header(). Remove get_header_image_width() and _height() in favor of get_custom_header()->width and height.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* ['Template Files'] and ['Stylesheet Files'] need to return files from the parent theme as well.
* Don't strip links from the Author header. Some themes rely on the previous behavior, such as to link multiple authors (Sandbox, for example.) Don't restore links to the Name, that's just a bad idea.
* Ensure we are always passing around arrays in get_files/scandir.
* Better inline doc for wp_get_themes() arguments.
* Introduce a 'force' flag for search_theme_directories() to re-scan, rather than return the cache. We will use this to re-build the theme_roots transient in get_theme_roots(), but it is more helpful for unit tests. Since search_theme_directories() is cached, don't cache again in wp_get_themes(). (Again benefits testing.)
* Handle duplicate theme names in the old get_themes() when two themes match (and neither are a default theme, which is already handled). wp_get_themes() will consider both names to be the same; this is just for back compat since get_themes() is keyed by name.
* Include an old array key in wp_broken_themes().
git-svn-id: http://svn.automattic.com/wordpress/trunk@20193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since search_theme_directories() now generates this and leverages this as a cache, convert absolute to relative on cache storage, and relative to absolute on cache retrieval.
git-svn-id: http://svn.automattic.com/wordpress/trunk@20118 1a063a9b-81f0-0310-95a4-ce76da25c4cd