wp_set_template_globals()wp-includes/template.php | Set up the globals used for template loading.
|
get_block_asset_url()wp-includes/blocks.php | Gets the URL to a block asset.
|
wp_theme_has_theme_json()wp-includes/global-styles-and-settings.php | Checks whether a theme or its parent has a theme.json file.
|
WP_Theme_JSON_Resolver::get_style_variations()wp-includes/class-wp-theme-json-resolver.php | Returns the style variations defined by the theme.
|
wp_generate_block_templates_export_file()wp-includes/block-template-utils.php | Creates an export of the current templates and template parts from the site editor at the specified path in a ZIP file.
|
_get_block_template_file()wp-includes/block-template-utils.php | Retrieves the template file from the theme for a given slug.
|
_get_block_templates_files()wp-includes/block-template-utils.php | Retrieves the template files from the theme.
|
WP_Theme_JSON_Resolver::get_file_path_from_theme()wp-includes/class-wp-theme-json-resolver.php | Builds the path to the given file and checks that it is readable.
|
locate_block_template()wp-includes/block-template.php | Finds a block template with equal or higher specificity than a given PHP template file.
|
resolve_block_template()wp-includes/block-template.php | Returns the correct ‘wp_template’ to render for the request template type.
|
WP_Debug_Data::debug_data()wp-admin/includes/class-wp-debug-data.php | Static function for generating site debug data when required.
|
WP_Customize_Manager::prepare_starter_content_attachments()wp-includes/class-wp-customize-manager.php | Prepares starter content attachments.
|
get_theme_file_path()wp-includes/link-template.php | Retrieves the path of a file in the theme.
|
get_theme_file_uri()wp-includes/link-template.php | Retrieves the URL of a file in the theme.
|
_load_textdomain_just_in_time()wp-includes/l10n.php | Loads plugin and theme text domains just-in-time.
|
get_editor_stylesheets()wp-includes/theme.php | Retrieves any registered editor stylesheet URLs.
|
validate_current_theme()wp-includes/theme.php | Checks that the active theme has the required files.
|
get_locale_stylesheet_uri()wp-includes/theme.php | Retrieves the localized stylesheet URI.
|
load_child_theme_textdomain()wp-includes/l10n.php | Loads the child theme’s translated strings.
|
wp_templating_constants()wp-includes/default-constants.php | Defines templating-related WordPress constants.
|
Basic Example
Include a PHP file
You can also use the constant “STYLESHEETPATH” in replacement of get_stylesheet_directory()
get_stylesheet_directory()
retrieves the child-theme’s directory.If you want to retrieve the parent-theme’s directory use
get_template_directory()
instead or even betterloacate_template()
– This way WordPress automatically uses your child themes directory to look for your resource – if there is a child-theme-file present it will use this one instead. No need for enqueuing anything.