Scott Taylor
5acc6bdb58
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31188 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-16 01:05:52 +00:00
Scott Taylor
865185903b
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@31168 602fd350-edb4-49c9-b593-d223f7449a82
2015-01-12 16:39:39 +00:00
Scott Taylor
218dd4fd6b
For clarity, initialize some arrays that previously were only assigned via short circuit in loops.
...
See #30799 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30982 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-20 22:46:53 +00:00
John Blackbourn
28f8566630
Improve the doing_it_wrong()
text for title-tag
theme support.
...
Props ocean90
Fixes #18548
git-svn-id: https://develop.svn.wordpress.org/trunk@30787 602fd350-edb4-49c9-b593-d223f7449a82
2014-12-08 16:05:34 +00:00
Scott Taylor
6bb2a4ce36
Improve the @param
docs for src/includes/theme.php
and src/includes/update.php
.
...
See #30224 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30672 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-30 22:43:27 +00:00
Drew Jaynes (DrewAPicture)
e587324180
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30656 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-30 12:09:56 +00:00
Scott Taylor
30e637cd93
Correct type in the doc block for get_theme_support()
.
...
See #30224 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30189 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-03 05:17:05 +00:00
Scott Taylor
cd8f6b881c
Correct the return value doc block for get_theme_support()
.
...
See #30224 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30188 602fd350-edb4-49c9-b593-d223f7449a82
2014-11-03 05:16:33 +00:00
Drew Jaynes (DrewAPicture)
3cc10d77a0
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30105 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-30 01:04:55 +00:00
John Blackbourn
efb9cd0cc5
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@30074 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-28 21:11:11 +00:00
Gary Pendergast
0e68ecc0b6
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30055 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-28 18:34:16 +00:00
Sergey Biryukov
bb5aedf3d9
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@30038 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-27 11:25:31 +00:00
Dominik Schilling (ocean90)
ab128698ad
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29903 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-15 17:20:34 +00:00
Sergey Biryukov
937d5cdd11
Translate some previously untranslated _doing_it_wrong() messages.
...
props georgestephanis.
fixes #25614 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29840 602fd350-edb4-49c9-b593-d223f7449a82
2014-10-05 21:05:54 +00:00
Drew Jaynes (DrewAPicture)
1e2fa2ddd3
Fix a typo in the PHPDoc for get_stylesheet()
.
...
Props lgedeon.
Fixes #28985 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29275 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-23 05:10:44 +00:00
Scott Taylor
a1aa518788
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29249 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-19 23:06:54 +00:00
Scott Taylor
bbfdf38a5b
Make audio and video URLs/embed handlers work in <iframe>
-sandbox'd MCE views.
...
Introduce:
`get_editor_stylesheets()`
`wp_media_mce_styles()`.
See #28905 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29176 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-15 21:50:41 +00:00
Drew Jaynes (DrewAPicture)
551f829c55
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@29163 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-14 01:01:22 +00:00
Scott Taylor
3cda5caafd
Revert [28563]. See #18298 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@29044 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-09 18:06:54 +00:00
Helen Hou-Sandi
0298f71032
Prompt the user before leaving the Customizer if they have unsaved changes. props westonruter. fixes #25439 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@29025 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-08 17:03:48 +00:00
Sergey Biryukov
fbda6f7c0a
Add is_customize_preview(), a conditional function to check if the site is being previewed in the Customizer.
...
props sammybeats, mattwiebe.
fixes #23509 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28999 602fd350-edb4-49c9-b593-d223f7449a82
2014-07-04 16:16:46 +00:00
Scott Taylor
70f735669a
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28563 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 20:11:08 +00:00
Scott Taylor
f945487f45
In wp-includes/theme.php
, break
is unreachable after return
.
...
See #27882 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28337 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-07 03:49:19 +00:00
Andrew Nacin
a8efcb993f
Customizer: Properly handle widget settings when activating a previewed theme.
...
props westonruter, ocean90, gcorne.
fixes #27767 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28124 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-14 22:45:40 +00:00
Drew Jaynes (DrewAPicture)
1bd14badd5
Clarify inline documentation for the 'html5' case and PHPDoc return in add_theme_support()
.
...
Props jond3r.
Fixes #27278 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27879 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-31 22:20:01 +00:00
Andrew Nacin
c9531d6d67
Encode spaces in get_template_directory_uri() and get_stylesheet_directory_uri().
...
props SergeyBiryukov.
fixes #21969 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27710 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 13:06:21 +00:00
Andrew Nacin
5653356188
Custom backgrounds: Do not print the default background color when it has been saved to the DB.
...
props obenland.
fixes #22030 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27703 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 11:52:56 +00:00
Andrew Nacin
9d5ce494e4
Clarify that unregister_default_headers() returns void in some situations. fixes #21876 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27575 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-18 00:11:39 +00:00
John Blackbourn
745f24b2d4
Use wp_get_attachment_url()
instead of the GUID when getting header image URLs. Fixes #27222 . Props Kopepasah.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27434 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-06 15:54:17 +00:00
Andrew Nacin
6afe83e3ca
In set_theme_mod() account for when there is no old value.
...
fixes #14721 . see [27393].
git-svn-id: https://develop.svn.wordpress.org/trunk@27402 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-05 01:12:39 +00:00
Andrew Nacin
3d45eff577
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27393 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 07:01:45 +00:00
Sergey Biryukov
0ccc5db0dd
Add boolean return values to require_if_theme_supports().
...
props jeffsebring, DrewAPicture.
fixes #26716 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27217 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-20 22:10:32 +00:00
Drew Jaynes
bd39e26032
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26868 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-24 18:56:05 +00:00
Andrew Nacin
fdc32636fa
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26594 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-03 21:35:26 +00:00
Drew Jaynes
f7850268df
Inline documentation for hooks in wp-includes/theme.php.
...
Props ShinichiN.
Fixes #25588 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26501 602fd350-edb4-49c9-b593-d223f7449a82
2013-12-01 17:23:05 +00:00
Jon Cave
0584f8690e
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 .
git-svn-id: https://develop.svn.wordpress.org/trunk@26352 602fd350-edb4-49c9-b593-d223f7449a82
2013-11-24 14:04:50 +00:00
Dion Hulse
9095e4b866
Upgrader: Make clearing the Plugin and Theme update caches optional during install and upgrade proceedures. See #22704
...
git-svn-id: https://develop.svn.wordpress.org/trunk@25272 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-06 01:32:09 +00:00
Andrew Nacin
db5f9800d4
add_theme_support( 'html5' ) now defaults to comment-list, comment-form, and search-form.
...
This was the implicit case in 3.6.0, modified in [25193].
see #24932 .
git-svn-id: https://develop.svn.wordpress.org/trunk@25235 602fd350-edb4-49c9-b593-d223f7449a82
2013-09-04 17:43:29 +00:00
Andrew Nacin
afe7f94304
Fix 'html5' theme support.
...
* Require it to have a second argument when adding.
* Merge, rather than replace, on second add.
* Make current_theme_supports() work when two arguments are passed.
Adds unit tests.
props nathanrice for initial patch.
see #24932 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@25193 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-31 01:29:08 +00:00
Dion Hulse
b971127bac
Remove the usage of @$_GET and @$_POST and just check to see if the indicies are set. Fixes #22429
...
git-svn-id: https://develop.svn.wordpress.org/trunk@25025 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-15 06:05:54 +00:00
Andrew Nacin
b43712e0f7
New develop.svn.wordpress.org repository based on the old core.svn repository.
...
* All WordPress files move to a src/ directory.
* New task runner (Grunt), configured to copy a built WordPress to build/.
* svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
* Remove Akismet external from develop.svn. Still exists in core.svn.
* Drop minified files from src/. The build process will now generate these.
props koop.
see #24976 .
and see http://wp.me/p2AvED-1AI .
git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
2013-08-07 05:25:25 +00:00