Commit Graph

468 Commits

Author SHA1 Message Date
Helen Hou-Sandí 79cabf64b1 Theme starter content: Add context to all strings.
fixes #38770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-14 21:38:32 +00:00
Weston Ruter dfbcdae985 Customize: Use selective refresh for custom header changes when possible.
* Use `postMessage` transport for header image settings by default when video headers are supported, and thus `the_custom_header_markup()` will necessarily be used (and thus a selective refresh partial will be available).
* Ensure that `the_custom_header_markup()` always outputs a container element in the customizer preview even if the header is empty.
* Ensure that edit shortcut appearing for custom header does not get positioned off-screen.

Props bradyvercher, westonruter.
See #38639.
Fixes #38737.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-14 18:41:32 +00:00
Weston Ruter e5b82c250f Customize: Improve extensibility of Custom CSS.
* Add `customize_value_custom_css` filter to `WP_Customize_Custom_CSS::value()` method.
* Introduce `customize_update_custom_css_post_content_args` filter in `WP_Customize_Custom_CSS::update()` method.
* Make clear that `wp_get_custom_css()` and `wp_get_custom_css` filter are specifically for obtaining the value to render/display. Eliminate use of `wp_get_custom_css()` when getting the setting value. Use the underlying `post_value` directly when `is_previewed`.
* Move anonymous functions handing JS previewing for `custom_logo`, `custom_css`, and `background` into named functions on the `wp.customize.settingPreviewHandlers` to allow plugins to override/extend preview logic.
* Update `_custom_background_cb` to always print a `style` tag wen in the customizer preview, and update background preview logic to replace existing style element instead of appending a new style to the head so that background changes don't unexpectedly override any Custom CSS in the preview's stylesheet cascade.

Props westonruter, georgestephanis.
See #22058.
Fixes #38672.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-13 02:43:29 +00:00
Weston Ruter ad80e08c17 Customize: Split out `custom_css` query logic from `wp_get_custom_css()` into a re-usable `wp_get_custom_css_post()` function to also be used when updating.
Props georgestephanis, westonruter.
See #38672, #35395.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-09 20:43:30 +00:00
Weston Ruter 5b676af8ff Customize: Store modifying user ID with setting change written into changeset and restore current user when setting is being saved.
Restoring the current user context when saving a setting ensures filters apply as expected, such as Kses. When a user is not associated with a given setting change, continue to override `capability` to be `exist` when saving. Skip overwriting setting values in a changeset that have not changed, facilitating concurrent editing and amending a changeset by a user with fewer privileges.

See #30937.
Fixes #38705.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-09 07:03:30 +00:00
Weston Ruter 5b633c548e Customize: Prevent `post_content` and `post_name` from being modified when trashing `customize_changeset` posts.
See #30937.
Fixes #38719.

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


git-svn-id: http://core.svn.wordpress.org/trunk@39120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-09 05:45:32 +00:00
Joe McGill 5704743a78 Themes: Remove Vimeo logic from `header_video_settings()`.
Following [39148] and [39128], this removes the mime type logic for
Vimeo URLs from `get_header_video_settings()` and removes remaining
Vimeo reference from `_validate_external_header_video()` docs.

Fixes #38544.
Built from https://develop.svn.wordpress.org/trunk@39165


git-svn-id: http://core.svn.wordpress.org/trunk@39105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-08 19:20:32 +00:00
Joe McGill 60db5df85f Themes: Improve reliability of URL used in `get_header_image_tag()`.
`get_header_image_tag()` relies on the data returned by `get_custom_header()`
to build the attributes for the header `<img>` element. However,
`get_custom_header()` relies on data from the `header_image_data` theme
mod rather than the `header_image` theme mod that `get_header_image()` uses.
This can create inconsistencies when no header image is set, but a theme
supports a default header image.

This fixes the issue by making `get_custom_image_tag()` rely on the URL
returned by `get_header_image()` instead.

Props bradyvercher.
Fixes #38633.
Built from https://develop.svn.wordpress.org/trunk@39121


git-svn-id: http://core.svn.wordpress.org/trunk@39061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-04 17:09:02 +00:00
Weston Ruter 75535c596b Customize: Introduce starter content and site freshness state.
A theme can opt-in for tailored starter content to apply to the customizer when previewing the theme on a fresh install, when `fresh_site` is at its initial `1` value. Starter content is staged in the customizer and does not go live unless the changes are published. Initial starter content is added to Twenty Seventeen.

* The `fresh_site` flag is cleared when a published post or page is saved, when widgets are modified, or when the customizer state is saved.
* Starter content is registered via `starter-content` theme support, where the argument is an array containing `widgets`, `posts`, `nav_menus`, `options`, and `theme_mods`. Posts/pages in starter content are created with the `auto-draft` status, re-using the page/post stubs feature added to nav menus and the static front page controls.
* A `get_theme_starter_content` filter allows for plugins to extend a theme's starter content.
* Starter content in themes can/should re-use existing starter content items in core by using named placeholders.
* Import theme starter content into customized state when fresh site.
* Prevent original_title differences from causing refreshes if title is present.
* Ensure nav menu item url is set according to object when previewing.
* Make sure initial saved state is false if there are dirty settings without an existing changeset.
* Ensure dirty settings are cleaned upon changeset publishing.

Props helen, westonruter, ocean90.
Fixes #38114, #38533.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 02:57:35 +00:00
Joe McGill 030bc377dd Themes: Enable video in custom headers.
This adds the ability for themes to add support for videos in custom headers
by passing `'video' => true` as an argument when adding theme support for
custom headers.

Custom video headers are managed through the “Header Visuals” (i.e. “Header Image”)
panel in the Customizer where you can select a video from the media library or set a
URL to an external video (YouTube for now) for use in custom headers.

This introduces several new functions:

`has_header_video()` – Check whether a header video is set or not.
`get_header_video_url()` – Retrieve header video URL for custom header.
`the_header_video_url()` – Display header video URL.
`get_header_video_settings()` – Retrieve header video settings.
`has_custom_header()` – Check whether a custom header is set or not.
`get_custom_header_markup()` – Retrieve the markup for a custom header.
`the_custom_header_markup()` – Print the markup for a custom header.

And a new file, `wp-includes/js/wp-custom-header.js` that handles loading videos
in custom headers.

This also enables video headers in the Twenty Seventeen and Twenty Fourteen themes.

Props davidakennedy, celloexpressions, bradyvercher, laurelfulford, joemcgill.
Fixes #38172.
Built from https://develop.svn.wordpress.org/trunk@38985


git-svn-id: http://core.svn.wordpress.org/trunk@38928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 21:51:31 +00:00
Weston Ruter a86496aea4 Customize: Improve custom background properties UI.
Introduces new control for managing the background position. Adds control for setting the `background-size`.

Props cdog, celloexpressions, grapplerulrich, MikeHansenMe, FolioVision, afercia, helen, melchoyce, karmatosed, westonruter, Kelderic, sebastian.pisula.
Fixes #22058.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:52:29 +00:00
Weston Ruter 1ccd9e7a6c Customize: Introduce custom CSS for extending theme styles.
* Custom CSS is associated with a given theme and is displayed in an inline `style` element at the `wp_head` hook after the `wp_print_styles` is called so that it overrides any enqueued stylesheets.
* A `wp_get_custom_css()` function is used for accessing the CSS associated with the current theme (or another theme) and a `wp_get_custom_css` filter for manipulating it.
* CSS is managed in customizer via a new "Additional CSS" section with a single `textarea` control. 
* `WP_Customize_Section::$description_hidden` is introduced for hiding extended descriptions in customizer sections behind a help toggle as done with panels.
* CSS is stored in a `custom_css` post type with the theme (stylesheet) slug as the `post_name`.
* `WP_Customize_Custom_CSS_Setting` is introduced to handle validation of CSS, previewing, and persisting the CSS to the `custom_css` post type.
* The `custom_css` setting is tied to a new `unfiltered_css` capability which maps to `unfiltered_html` by default.
* Escaping the message in the notification template is removed to allow markup (`code` tags) to be rendered.

See https://make.wordpress.org/core/2016/10/11/feature-proposal-better-theme-customizations-via-custom-css-with-live-previews/

Props johnregan3, celloexpressions, folletto, westonruter.
Fixes #35395.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 18:15:31 +00:00
Weston Ruter f1ba1918c9 Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.

See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/

Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 20:05:31 +00:00
Weston Ruter 76681c40e3 Customize: Opt to disable IE8 support via conditional comments instead of using unreliable `Array.prototype.indexOf` feature detection.
Deprecate/remove `WP_Customize_Manager::customize_preview_html5()` and remove `document.head` polyfill, both of which were only in place for IE8 support.

Props ryankienstra, westonruter.
Fixes #38021.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-25 04:35:32 +00:00
Weston Ruter 4c4271a691 Customize: Remove IE8 access to customizer to discontinue support.
Uses feature detection for `Array.prototype.indexOf` since it is not implemented in IE8.

Props ryankienstra.
See #38021.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 04:02:31 +00:00
Scott Taylor a3ffebce30 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:31:29 +00:00
Scott Taylor 390ceba6c7 Bootstrap: after r38409 and r38410, revert r38402 which reverted r38399.
This fixes the paths in `wp-vendor/` that were including `src`. I want to drop this in so we can find out what else will break.

See #36335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 22:32:37 +00:00
Dion Hulse 0e31a46161 Bootstrap: Revert [38399] as it's broken `/build/` and subsequently core.svn.wordpress.org.
The generated classmaps reference `/src/` files and operates in the assumption that the base directory is one level above `wp-settings.php`, which it isn't after our build processes are run.

See #36335

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


git-svn-id: http://core.svn.wordpress.org/trunk@38343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 14:37:32 +00:00
Scott Taylor 6a529648cf Bootstrap: Autoload classes using a Composer-generated PHP 5.2-compatible Autoloader.
* `wp-admin` and `wp-includes` are scanned for classes to autoload
* Several 3rd-party and Ryan McCue-shaped libraries are excluded when the classmap is generated, see `composer.json`: `autoload.exclude-from-classmap`
* `wp-vendor/autoload_52.php` is included at the top of `wp-settings.php` - no changes need to be made to unit tests to include the autoloader
* An avalanche of `require()` and `require_once()` calls that loaded class files have been removed from the codebase.

The following files have been added to `svn:ignore` - they are not 5.2-compatible and fail during pre-commit:
* src/wp-vendor/autoload.php
* src/wp-vendor/composer/autoload_real.php
* src/wp-vendor/composer/autoload_static.php
* src/wp-vendor/composer/ClassLoader.php

We favor these files instead:
* src/wp-vendor/autoload_52.php
* src/wp-vendor/composer/autoload_real_52.php
* src/wp-vendor/composer/ClassLoader52.php

When new PHP classes are added to the codebase, simply run `composer install` or `composer update` from the project root to update the autoloader.

The future is now.

See #36335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-27 09:15:29 +00:00
Drew Jaynes 22adda2aa0 Hooks: Standardize naming of dynamic hooks to use interpolation vs concatenation.
Benefits gained in discoverability and self-documentation throughout core trump the negligible performance hit in using interpolation in hook names.

Props ramiy.
See #37748.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-22 18:25:31 +00:00
Sergey Biryukov 139387b7e5 Docs: Use 3-digit, x.x.x-style semantic versioning for `_doing_it_wrong()`, `_deprecated_function()`, `_deprecated_argument()`, and `_deprecated_file()` throughout core.
Props metodiew.
Fixes #36495.
Built from https://develop.svn.wordpress.org/trunk@37985


git-svn-id: http://core.svn.wordpress.org/trunk@37926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-06 12:40:29 +00:00
Jeremy Felt 6f3f00ea97 Multisite: Change `WP_Network` `id` property to an integer.
For consistency and developer sanity.

Props flixos90.
Fixes #37050.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-26 14:26: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 6d06e53dba Docs: Improve the DocBlock summary for `add_theme_support()`.
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 00:07:30 +00:00
Drew Jaynes 6e8102dae6 Docs: Add documentation for the variadic second parameter, `$args`, accepted by `add_theme_support()`.
h/t kevinwhoffman
Fixes #37067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-10 00:03:28 +00:00
Drew Jaynes 916a055361 Docs: Improve documentation for the `$feature` parameter in the DocBlock for `add_theme_support()`.
See #32246. See #37067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-06-09 20:34:55 +00:00
Drew Jaynes 9193013158 Docs: Apply inline `@see` tags to hooks referenced in DocBlocks in a variety of wp-includes/* files.
Applying these specially-crafted `@see` tags allows the Code Reference parser to recognize and link these elements as actions and filters.

Fixes #36921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-23 19:02:28 +00:00
Drew Jaynes 136296c111 Docs: Standardize filter docs in wp-includes/theme.php to use third-person singular verbs per the inline documentation standards for PHP.
See #36913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 18:18:29 +00:00
Drew Jaynes f52a8cb1fa Docs: Remove/replace invalid inline `@link` tags in DocBlocks in wp-includes/*.
Fixes #36910.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-22 17:39:28 +00:00
Drew Jaynes b1804afeaf Docs: Standardize on 'backward compatibility/compatible' nomenclature in core inline docs.
Also use 'back-compat' in some inline comments where backward compatibility is the subject and shorthand feels more natural.

Note: 'backwards compatibility/compatibile' can also be considered correct, though it's primary seen in regular use in British English.

Props ocean90.
Fixes #36835.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-05-13 18:41:31 +00:00
Rachel Baker ddbde15454 Post Thumbnails: Fix logic bug and tests from [37308] where post-thumbnails support wasn’t added if there were no previous post_types with support already.
See #22080
Built from https://develop.svn.wordpress.org/trunk@37313


git-svn-id: http://core.svn.wordpress.org/trunk@37279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-26 20:29:27 +00:00
Rachel Baker af5c5a9a25 Post Thumbnails: When using `add_theme_support( ‘post-thumbnails’, array( $post_types) )` merge the supported post_types.
Allow the adding of post-thumbnail support for one or more post_types without unsetting any previously added post_types. This matches the behavior of other uses of `add_theme_support()` and the expectations of a function with a prefix of “add”.
To unset post-thumbnail support use `remove_theme_support()` instead.

Fixes #22080

Props alexkingorg, jmichaelward, and flixos90.
Built from https://develop.svn.wordpress.org/trunk@37308


git-svn-id: http://core.svn.wordpress.org/trunk@37274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-04-26 17:05:31 +00:00
Aaron Jorbin c1d684383c Prevent PHP Warnings when using Custom Logo with no params
The parsing of defaults assumes that $args will be an array. This solves it for Custom Logo the same way it is solved for custom-header and custom-background.

Props obenland.
Fixes #36332.


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


git-svn-id: http://core.svn.wordpress.org/trunk@37059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-30 02:22:26 +00:00
Drew Jaynes cb457da489 Docs: Improve the DocBlocks for `get_header_textcolor()` and `header_textcolor()` to mention that they both retrieve color values in the HEX format.
Props theMikeD.
Fixes #36336.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-25 23:06:27 +00:00
Konstantin Obenland cbbf361c03 Customize: Bring custom-logo args closer to custom-header.
Allows themes to specify the desired width and height of logos, and whether
that is flexible or not. Has the benefit of not having to generate a logo-sized
file for every image uploaded.

Props westonruter, celloexpressions.
Fixes #36255.


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


git-svn-id: http://core.svn.wordpress.org/trunk@37044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-24 02:02:27 +00:00
Weston Ruter f3f84d2f21 Customize: Require opt-in for selective refresh of widgets.
* Introduces `customize-selective-refresh-widgets` theme support feature and adds to themes.
* Introduces `customize_selective_refresh` arg for `WP_Widget::$widget_options` and adds to all core widgets.
* Remove `selective_refresh` from being a component that can be removed via `customize_loaded_components` filter.
* Add `WP_Customize_Widgets::get_selective_refreshable_widgets()` and `WP_Customize_Widgets::is_widget_selective_refreshable()`.
* Fix default `selector` for `Partial` instances.
* Implement and improve Masronry sidebar refresh logic in Twenty Thirteen and Twenty Fourteen, including preservation of initial widget position after refresh.
* Re-initialize ME.js when refreshing `Twenty_Fourteen_Ephemera_Widget`.

See #27355.
Fixes #35855.

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


git-svn-id: http://core.svn.wordpress.org/trunk@37007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-21 21:59:29 +00:00
Aaron Jorbin 1972aa2a2a Add grunt prerelease task
An unintended consequence of improving the precommit task is that when it's time to run a release, more tasks need to get run to verify things. This adds a prerelease task to help fix that situation. grunt prerelease should include tasks that verify the code base is ready to be released to the wild and find all the tears on the mausoleum floor and help Blood stain the Colosseum doors.

See #35557

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


git-svn-id: http://core.svn.wordpress.org/trunk@36898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-10 05:37:27 +00:00
Konstantin Obenland dabfefcee2 Themes: Support second argument in theme support for custom logo.
See #33755.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-03-09 21:51:27 +00:00
Dominik Schilling 3f3fe5a7ed Themes: Use the attachment ID as the key in `get_uploaded_header_images()`.
Prevents missing header images when an image has the same name as another header image.

Props sirbrillig.
Fixes #31786.
Built from https://develop.svn.wordpress.org/trunk@36539


git-svn-id: http://core.svn.wordpress.org/trunk@36506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-16 22:12:27 +00:00
Drew Jaynes deeb5f1471 Themes: Pass information about the old theme in the form of a `WP_Theme` object when the `switch_theme` action is fired.
Props MikeHansenMe.
See #22401.

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


git-svn-id: http://core.svn.wordpress.org/trunk@36469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-02-07 08:26:25 +00:00
Pascal Birchler fa9b71e423 Docs: Document the default value for the `$validate` parameter in the `validate_current_theme` hook docs.
See #32246.
Built from https://develop.svn.wordpress.org/trunk@35976


git-svn-id: http://core.svn.wordpress.org/trunk@35941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-16 20:10:25 +00:00
Pascal Birchler 4e6e728703 Docs: Correct a parameter name for the `validate_current_theme` filter.
See #32246.
Built from https://develop.svn.wordpress.org/trunk@35972


git-svn-id: http://core.svn.wordpress.org/trunk@35937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-16 19:36:28 +00:00
Pascal Birchler f522e69a57 Docs: Fix a typo in the `stylesheet_directory` filter docs.
Props ixkaito.
Fixes #34859.
Built from https://develop.svn.wordpress.org/trunk@35799


git-svn-id: http://core.svn.wordpress.org/trunk@35763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 21:57:24 +00:00
Konstantin Kovshenin 919867b090 Docs: Remove some more dittography.
See #34885, r35793.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 21:50:25 +00:00
Scott Taylor 79a2915a9b Upgrade: New themes are not automatically installed on upgrade. This can still be explicitly asked for by defining `CORE_UPGRADE_SKIP_NEW_BUNDLED` as `false`.
In `populate_options()`, if the theme specified by `WP_DEFAULT_THEME` doesn't exist, fall back to the latest core default theme. If we can't find a core default theme, `WP_DEFAULT_THEME` is the best we can do. 

Props nacin, jeremyfelt, dd32.
See #34306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@35702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-25 21:45:25 +00:00
Andrew Ozz f34c16674a Responsive images: fix args order and streamline the srcset and sizes generation and better inline docs in `get_header_image_tag()`.
See #21389.
Built from https://develop.svn.wordpress.org/trunk@35595


git-svn-id: http://core.svn.wordpress.org/trunk@35559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-10 01:59:25 +00:00
Andrew Ozz a86cac1676 Responsive images: add template helper functions to generate the tag for a (responsive) header image that includes srcset and sizes attributes.
Props Otto42, joemcgill, DH-Shredder, azaozz.
Fixes #21389.
Built from https://develop.svn.wordpress.org/trunk@35594


git-svn-id: http://core.svn.wordpress.org/trunk@35558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-10 01:17:26 +00:00
Konstantin Obenland c69e96422b Themes: Improve document title output.
Introduces more flexibility in filtering all parts of the document title,the
separator, and a way to short-circuit title generation. Plugins can now also
check for theme support and reliably filter the entire output. See #18548.
Deprecates `wp_title()`.

Fixes #31078.


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


git-svn-id: http://core.svn.wordpress.org/trunk@35260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-20 16:21:25 +00:00
Boone Gorges 0e7c1d3b14 Use `wp_installing()` instead of `WP_INSTALLING` constant.
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.

A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available.  However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.

The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.

Props boonebgorges, jeremyfelt.
See #31130.
Built from https://develop.svn.wordpress.org/trunk@34828


git-svn-id: http://core.svn.wordpress.org/trunk@34793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-05 15:06:28 +00:00
Weston Ruter aedb4c3ee2 Customizer: Flesh out phpdoc description for `_wp_customize_include()`.
Also add brackets around single-statement inline `if` statement.

Fixes #33488.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-25 19:36:25 +00:00
Aaron Jorbin c09b0477b2 Flush rewrite rules upon theme switch
Themes can ( and do ) but shouldn't include custom rewrite rules.This can lead to hard to debug issues for theme authors. Theme changes are not a ultra common conclusion. Flushing the rewrite rules on theme switch will lead to a clean slate for each theme which helps make debugging easier.

And @nacin said we should do this 5 years ago at WordCamp Mid Atlantic.

Fixes #14849


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


git-svn-id: http://core.svn.wordpress.org/trunk@33997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 23:50:24 +00:00
Konstantin Obenland 1e9372b699 Themes: Get the correct theme when template and stylesheet were both passed as arguments.
Fixes a bug where `$new_theme` got set before the second argument was
appropriately handled, causing the `current_theme` option to later always be
updated to the parent theme's name.

Introduced in [21131].

Props obenland, wonderboymusic.
Fixes #32635.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-30 21:45:23 +00:00
Scott Taylor 32110c7f77 Switching themes: if the new theme doesn't have `nav_menu_locations` defined, but the old theme does, copy the old theme's `nav_menu_locations` into the new theme's theme mods.
cc melchoyce

Fixes #18588.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-30 03:01:21 +00:00
Scott Taylor 3d780c6a4b Clarify doc entry for `_wp_customize_include()`
Props ericlewis. 
Fixes #33488.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-21 17:45:25 +00:00
Dominik Schilling 8679a93f16 Themes: Remove legacy theme preview.
The pre-3.4 theme previewer doesn't work when using a static front page.
We kept the old theme preview for no-JS and some browsers that were less capable. But since browsers are doing a better job today we don't need to continue fixing/shipping this legacy code. Bye!

fixes #33178.
Built from https://develop.svn.wordpress.org/trunk@33492


git-svn-id: http://core.svn.wordpress.org/trunk@33459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-29 18:36:26 +00:00
Konstantin Obenland 080a4adfba Properly clean up header image data when the attachment is deleted.
Props CreativeInfusion.
Fixes #33005.


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


git-svn-id: http://core.svn.wordpress.org/trunk@33250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-15 16:28:25 +00:00
Drew Jaynes f4328b27b6 Add an extra line before the hook doc for the `editor_stylesheets` filter begins.
The parser really likes it when there's breathing room.

See [32928]. See #32891.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-07-13 22:01:24 +00:00
Konstantin Obenland 36b24b073d Provide alt text for uploaded header images.
The custom header screen will use it rather then the description,
if an alt text is set.

Props francoeurdavid, voldemortensen, valendesigns.
Fixes #27959.


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


git-svn-id: http://core.svn.wordpress.org/trunk@32969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-29 21:32:26 +00:00
Scott Taylor a0e373ef80 For doc block types, favor `bool` over the few remaining `boolean`s
See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-27 01:03:25 +00:00
Sergey Biryukov 3f448d7cd5 Add `editor_stylesheets` filter to `get_editor_stylesheets()`.
props danielbachhuber, MikeHansenMe.
fixes #31672.
Built from https://develop.svn.wordpress.org/trunk@32928


git-svn-id: http://core.svn.wordpress.org/trunk@32899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-24 13:32:32 +00:00
Weston Ruter 489db97ea3 Customizer: Allow sections and panels to be exported to JS.
Also fix param docs for `customize_dynamic_setting_class` filter, and use `require_once` for `class-wp-customize-manager.php` in bootstrap function `_wp_customize_include()`.

See #30737, #32576.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-12 22:54:25 +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
Andrew Nacin 65c382d550 Fix `return` error in get_theme_mods() from [32629].
Split a line with both an assignment and a conditional, not to mention an interpolated variable. Lots going on, easy mistake to make.

props BrianLayman.
fixes #32516.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-28 05:51:25 +00:00
Scott Taylor b4eccbd5a0 Add missing doc blocks to `theme.php`.
Correct some `@return` values.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-27 22:21:25 +00:00
Drew Jaynes 44289a8ac5 Add a missing return description for `has_header_image()`.
See [31224]. See #31888.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-04-05 17:11:28 +00:00
Dominik Schilling 2ae3dfa119 Customizer: Add title attributes to iframes.
props afercia.
fixes #31202.
Built from https://develop.svn.wordpress.org/trunk@31704


git-svn-id: http://core.svn.wordpress.org/trunk@31685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-10 21:20:26 +00:00
Scott Taylor 0ec87e4584 There are a few functions that have the ability to return `false` instead of a string, so the return value should be checked before being passed to functions that expect string.
These are trivial, but they clear out some Scrutinizer issues.

See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-09 02:11:28 +00:00
Sergey Biryukov b87b8f2bb3 Introduce has_header_image() to check whether a header image is set.
props GunGeekATX, voldemortensen.
fixes #16268.
Built from https://develop.svn.wordpress.org/trunk@31224


git-svn-id: http://core.svn.wordpress.org/trunk@31205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-17 06:34:23 +00:00
Scott Taylor eeda68bbda Fix some erroneous `@param` annotations.
See #30799.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 22:44:25 +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 fc843ce4d0 There are some random `add_action()` and `add_filter()` calls littered around some files in `wp-includes/`. These should be moved to `wp-includes/default-filters.php` with the rest of the registered hooks. It seems like this was the best practice for awhile and then we randomly stopped. This file loads way before any of the includes, so the hooks will be registered for any request that loads WordPress, even `SHORTINIT` - a lot of the hooks registered won't run anyways (that's already the case).
See #30947.

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


git-svn-id: http://core.svn.wordpress.org/trunk@31149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-12 16:40:23 +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
John Blackbourn fbb5c1f1f5 Improve the `doing_it_wrong()` text for `title-tag` theme support.
Props ocean90
Fixes #18548

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


git-svn-id: http://core.svn.wordpress.org/trunk@30777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-08 16:06:26 +00:00
Scott Taylor d097e7cf83 Improve the `@param` docs for `src/includes/theme.php` and `src/includes/update.php`.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 22:44:22 +00:00
Drew Jaynes bffe95d34c Docs Formatting: Backtick-escape inline code for all remaining dynamic hook docs in wp-includes/*.
Affects DocBlocks for the following hooks:
* `auth_post_meta_{$meta_key}`
* `term_links-$taxonomy`
* `customize_render_control_ . $this->id`
* `customize_render_panel_{$this->id}`
* `customize_render_section_{$this->id}`
* `customize_preview_{$this->id}`
* `customize_save_ . $this->id_data[ 'base' ]`
* `customize_update_ . $this->type`
* `customize_value_ . $this->id_data[ 'base' ]`
* `customize_sanitize_js_{$this->id}`
* `comment_form_field_{$name}`
* `comment_{$old_status}_to_{$new_status}`
* `comment_{$new_status}_{$comment->comment_type}`
* `extra_{$context}_headers`
* `get_template_part_{$slug}`
* `get_the_generator_{$type}`
* `get_{$adjacent}_post_join`
* `get_{$adjacent}_post_where`
* `get_{$adjacent}_post_sort`
* `{$adjacent}_post_rel_link`
* `{$adjacent}_post_link`
* `{$adjacent}_image_link`
* `blog_option_{$option}`
* `$permastructname . _rewrite_rules`
* `{$type}_template`
* `theme_mod_{$name}`
* `pre_set_theme_mod_$name`
* `current_theme_supports-{$feature}`
* `get_user_option_{$option}`
* `edit_user_{$field}`
* `pre_user_{$field}`
* `user_{$field}`

See #30552.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-30 12:10:23 +00:00
Scott Taylor 63c55ae93c Correct type in the doc block for `get_theme_support()`.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 05:18:22 +00:00
Scott Taylor 3535af5b77 Correct the return value doc block for `get_theme_support()`.
See #30224.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-11-03 05:17:23 +00:00
Drew Jaynes f8657d5890 Remove redundant and erroneous `@uses` tag from most core inline documentation.
Per our inline documentation standards, no further use of the `@uses` tag is recommended as used and used-by relationships can be derived through other means. This removes most uses of the tag in core documentation, with remaining tags to be converted to `@global` or `@see` as they apply.

Fixes #30191.

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


git-svn-id: http://core.svn.wordpress.org/trunk@30105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-30 01:05:24 +00:00
John Blackbourn 0f64edb657 Introduce a new means of outputting a `<title>` tag in the theme head. Requires a theme to add support by calling `add_theme_support( 'title-tag' )`. This is the first step in adding a more robust means of generating and outputting the title tag.
See #18548.
Props obenland, chrisbliss18, joostdevalk.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 21:12:22 +00:00
Gary Pendergast 007ec52958 Add `wp_json_encode()`, a wrapper for `json_encode()` that ensures everything is converted to UTF-8.
Change all core calls from `json_encode()` to `wp_json_encode()`.

Fixes #28786.


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


git-svn-id: http://core.svn.wordpress.org/trunk@30055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-28 18:35:19 +00:00
Sergey Biryukov ed4a827365 Don't display Standard post format twice in the meta box if the theme unnecessarily mentions it in the add_theme_support() call.
props ptahdunbar, nacin, pushplaybang, obenland.
fixes #16555.
Built from https://develop.svn.wordpress.org/trunk@30038


git-svn-id: http://core.svn.wordpress.org/trunk@30038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-27 11:26:18 +00:00
Dominik Schilling 61819a36ea Customizer: Change instances of "Theme Customizer" to just "Customizer", as the Customizer isn't necessarily theme-specific.
Also capitalize "Customizer".
See also https://make.wordpress.org/core/2014/07/08/customizer-improvements-in-4-0/.

props studionashvegas, tareq1988.
fixes #29947.
Built from https://develop.svn.wordpress.org/trunk@29903


git-svn-id: http://core.svn.wordpress.org/trunk@29658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-15 17:21:19 +00:00
Sergey Biryukov bf856e3a62 Translate some previously untranslated _doing_it_wrong() messages.
props georgestephanis.
fixes #25614.
Built from https://develop.svn.wordpress.org/trunk@29840


git-svn-id: http://core.svn.wordpress.org/trunk@29604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-05 21:06:15 +00:00
Drew Jaynes e329b34f37 Fix a typo in the PHPDoc for `get_stylesheet()`.
Props lgedeon.
Fixes #28985.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-23 05:11:16 +00:00
Scott Taylor 021b07a161 Call `untrailingslashit()` when adding a theme directory in `register_theme_directory()`. This prevents double-slashing in generated URLs. Don't add a directory if it is already present.
Adds unit tests.
Props obenland, wonderboymusic.
Fixes #28662.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-19 23:07:15 +00:00
Scott Taylor 89d9bbd7f6 Make audio and video URLs/embed handlers work in `<iframe>`-sandbox'd MCE views.
Introduce:
`get_editor_stylesheets()`
`wp_media_mce_styles()`.

See #28905.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-15 21:51:15 +00:00
Drew Jaynes c5a59037f1 Inline documentation cleanup for 4.0 audit.
Various improvements:
* Adds `@see` reference for `wp_list_comments()` in 'wp_list_comments_args' filter docs, added in [28285]
* Various phpDoc tweaks for the 'run_wptexturize' filter docs, added in [28715]
* Sentence and wrapping changes for `is_https_url()`, added in [28894]
* Documents the `$args` parameter for `wp_dropdown_languages()`, added in [29007]
* Adds a period to the parameter description for `_update_posts_count_on_delete()`, added in [28835]
* Documents a global in `is_customize_preview()`, added in [28999]
* phpDoc tweaks, adds an access modifier for `wpdb::esc_like()`, added in [28711]

See #28885.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-14 01:02:15 +00:00
Scott Taylor ef436cb6e0 Revert [28563]. See #18298.
Built from https://develop.svn.wordpress.org/trunk@29044


git-svn-id: http://core.svn.wordpress.org/trunk@28832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-09 18:07:16 +00:00
Helen Hou-Sandí b6d3c0841e Prompt the user before leaving the Customizer if they have unsaved changes. props westonruter. fixes #25439.
Built from https://develop.svn.wordpress.org/trunk@29025


git-svn-id: http://core.svn.wordpress.org/trunk@28813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-08 17:04:15 +00:00
Sergey Biryukov 7197468003 Add is_customize_preview(), a conditional function to check if the site is being previewed in the Customizer.
props sammybeats, mattwiebe.
fixes #23509.
Built from https://develop.svn.wordpress.org/trunk@28999


git-svn-id: http://core.svn.wordpress.org/trunk@28787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-07-04 16:17:15 +00:00
Scott Taylor b75c79500b Replaces all uses of `TEMPLATEPATH` and `STYLESHEETPATH` in core with `get_template_directory()` and `get_stylesheet_directory()`.
Add `@deprecated` annotations to `TEMPLATEPATH` and `STYLESHEETPATH` definitions.

Props obenland, aaroncampbell. 
Fixes #18298.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-23 20:12:15 +00:00
Scott Taylor 49251efc74 In `wp-includes/theme.php`, `break` is unreachable after `return`.
See #27882.

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


git-svn-id: http://core.svn.wordpress.org/trunk@28165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-05-07 03:50:14 +00:00
Andrew Nacin 6b579e0d59 Customizer: Properly handle widget settings when activating a previewed theme.
props westonruter, ocean90, gcorne.
fixes #27767.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-04-14 22:46:16 +00:00
Drew Jaynes f13d04e5cf Clarify inline documentation for the 'html5' case and PHPDoc return in `add_theme_support()`.
Props jond3r.
Fixes #27278.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-31 22:20:16 +00:00
Andrew Nacin 7d3b9ccb22 Encode spaces in get_template_directory_uri() and get_stylesheet_directory_uri().
props SergeyBiryukov.
fixes #21969.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 13:07:14 +00:00
Andrew Nacin a1c08b7660 Custom backgrounds: Do not print the default background color when it has been saved to the DB.
props obenland.
fixes #22030.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-25 11:53:14 +00:00
Andrew Nacin e451a2def5 Clarify that unregister_default_headers() returns void in some situations. fixes #21876.
Built from https://develop.svn.wordpress.org/trunk@27575


git-svn-id: http://core.svn.wordpress.org/trunk@27418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-18 00:12:15 +00:00
John Blackbourn 944c629ace Use `wp_get_attachment_url()` instead of the GUID when getting header image URLs. Fixes #27222. Props Kopepasah.
Built from https://develop.svn.wordpress.org/trunk@27434


git-svn-id: http://core.svn.wordpress.org/trunk@27281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-06 15:55:15 +00:00
Andrew Nacin affd41046b In set_theme_mod() account for when there is no old value.
fixes #14721. see [27393].

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


git-svn-id: http://core.svn.wordpress.org/trunk@27249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-05 01:13:14 +00:00
Andrew Nacin 4c7c24ecbf Add a pre_set_theme_mod_$name filter to set_theme_mod().
This is modeled after pre_update_option_$option in update_option() and pre_set_transient_$transient in set_transient().

props obenland.
fixes #14721.

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


git-svn-id: http://core.svn.wordpress.org/trunk@27241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-03-04 07:02:13 +00:00