This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.
This commit also includes:
* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
* `wp-admin/admin-header.php`
* `wp-admin/admin-footer.php`
* `wp-includes/version.php`
Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes#48082.
Built from https://develop.svn.wordpress.org/trunk@47198
git-svn-id: http://core.svn.wordpress.org/trunk@46998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These keys are used in `{$type}_template_hierarchy` and `{$type}_template` filters.
Previously, `front_page` and `privacy_policy` were passed, but `get_query_template()` stripped the underscores before passing the values to the filters.
Props rinatkhaziev, tmatsuur, johnbillion.
Fixes#21213, #46958.
Built from https://develop.svn.wordpress.org/trunk@45231
git-svn-id: http://core.svn.wordpress.org/trunk@45040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
* `get_index_template()`
* `get_404_template()`
* `get_author_template()`
* `get_category_template()`
* `get_tag_template()`
* `get_taxonomy_template()`
* `get_date_template()`
* `get_home_template()`
* `get_front_page_template()`
* `get_page_template()`
* `get_search_template()`
* `get_single_template()`
* `get_embed_template()`
* `get_singular_template()`
* `get_attachment_template()`
As mentioned when these dynamic hook references were originally fixed in [33274], we can't link to non-existent hooks inline because the Code Reference auto-linker won't pick up on the dynamic-ness of the hook, it'll just try to link to a hook reference that doesn't exist. In these cases, we need to be generic and provide context for the value of `$type`.
See [38418] for where the original fix was reversed. See this changeset for reversing the reversal.
Props donutz, milana_cap.
Fixes#41198.
Built from https://develop.svn.wordpress.org/trunk@40964
git-svn-id: http://core.svn.wordpress.org/trunk@40814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
WordPress has supported custom page templates for over 12 years, allowing developers to create various layouts for specific pages.
While this feature is very helpful, it has always been limited to the 'page' post type and not was not available to other post types.
By opening up the page template functionality to all post types, we continue to improve the template hierarchy's flexibility.
In addition to the `Template Name` file header, the post types supported by a template can be specified using `Template Post Type: post, foo, bar`.
When at least one template exists for a post type, the 'Post Attributes' meta box will be displayed in the back end, without the need to add post type support for `'page-attributes'`. 'Post Attributes' can be customized per post type using the `'attributes'` label when registering a post type.
Props johnbillion, Mte90, dipesh.kakadiya, swissspidy.
Fixes#18375.
Built from https://develop.svn.wordpress.org/trunk@38951
git-svn-id: http://core.svn.wordpress.org/trunk@38894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The position of this template within the hierarchy is of so little use that zero themes in the WordPress.org theme directory make use of it. It's second only to `index.php` in the hierarchy, meaning that any archive template such as `category.php` or `archive.php` will be chosen before it.
Fixes#38162
Props ryankienstra for initial patch
Built from https://develop.svn.wordpress.org/trunk@38755
git-svn-id: http://core.svn.wordpress.org/trunk@38698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This introduces a `{$type}_template_hierarchy` filter that allows the hierarchy of candidate template filenames for a given template type to be filtered.
This allows the hierarchy to be added to or altered completely without resorting to re-building the hierarchy from scratch within the `template_include` filter, which is common and prone to conflicts between plugins and prone to getting out of sync with core's hierarchy.
Fixes#14310
Built from https://develop.svn.wordpress.org/trunk@38385
git-svn-id: http://core.svn.wordpress.org/trunk@38326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This allows themes to directly override the default template. The order in which the template is retrieved is as follows: `embed-$post_type-$post_format.php` -> `embed-$post_type.php` -> `embed.php`.
The `embed_template` filter gets replaced by the dynamic `{$type}_template` filter in `get_query_template()`.
Props ChriCo, swissspidy.
See #34561. Fixes#34278.
Built from https://develop.svn.wordpress.org/trunk@36876
git-svn-id: http://core.svn.wordpress.org/trunk@36843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Splits wp-includes/embed-template.php, introduced in 4.4, into five new templates that can be individually overridden by themes:
* embed.php
* embed-404.php
* embed-content.php
* header-embed.php
* footer-embed.php
Also introduces a new template tag for outputting the site title, `the_embed_site_title()`.
The five new templates live in theme-compat, allowing for graceful fallbacks should themes prefer not to override any or all of them.
Props swissspidy, imath, ocean90, DrewAPicture.
See #34561.
Built from https://develop.svn.wordpress.org/trunk@36693
git-svn-id: http://core.svn.wordpress.org/trunk@36660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Twelve years later, after no fewer than three themes have intentionally implemented popup comments in their functionality, before being abandoned for at least the last six years, we've reached a time where we can put this era behind us. A time when we can remove comment popup functionality from WordPress.
If this breaks the internet, I'll eat my hat.
Fixes#28617
Built from https://develop.svn.wordpress.org/trunk@35848
git-svn-id: http://core.svn.wordpress.org/trunk@35812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
It's important to reference the actual dynamic hook name instead of an alias for purposes of auto-linking in the Code Reference.
Affects the docs for:
* `get_index_template()`
* `get_404_template()`
* `get_archive_template()`
* `get_post_type_archive_template()`
* `get_author_template()`
* `get_category_template()`
* `get_tag_template()`
* `get_taxonomy_template()`
* `get_date_template()`
* `get_home_template()`
* `get_page_template()`
* `get_paged_template()`
* `get_search_template()`
* `get_single_template()`
* `get_singular_template()`
* `get_attachment_template()`
See #32246.
Built from https://develop.svn.wordpress.org/trunk@33274
git-svn-id: http://core.svn.wordpress.org/trunk@33246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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