Commit Graph

363 Commits

Author SHA1 Message Date
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
Sergey Biryukov bb9114f554 Add boolean return values to require_if_theme_supports().
props jeffsebring, DrewAPicture.
fixes #26716.
Built from https://develop.svn.wordpress.org/trunk@27217


git-svn-id: http://core.svn.wordpress.org/trunk@27074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-02-20 22:11:14 +00:00
Drew Jaynes cd8cedc40d First there were two, and now there are three -- in the @since versions that came before and that shall be. And so it will be, says nacin.
Props JustinSainton, SergeyBiryukov, DrewAPicture.
Fixes #26713.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-24 18:57:12 +00:00
Andrew Nacin 9be4bd5720 Rename the new custom-background arguments passed to add_theme_support().
* background-position becomes default-position-x
 * background-attachment becomes default-attachment
 * background-repeat becomes default-repeat

These are in line with existing default-image and default-color arguments, and also makes the position argument unambiguous and forwards compatible.

fixes #20816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-03 21:36:10 +00:00
Drew Jaynes 27edadb0fd Inline documentation for hooks in wp-includes/theme.php.
Props ShinichiN.
Fixes #25588.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-12-01 17:24:11 +00:00
Jon Cave fd14a5df71 Allow customisation of theme mod defaults via custom-background theme support.
Give the power to theme authors to select defaults when registering
custom-background support.

Props obenland. Fixes #20816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@26253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2013-11-24 14:05:10 +00:00