[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentyseventeen/ -> functions.php (summary)

Twenty Seventeen functions and definitions

File Size: 748 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 20 functions

  twentyseventeen_setup()
  twentyseventeen_content_width()
  twentyseventeen_fonts_url()
  twentyseventeen_resource_hints()
  twentyseventeen_widgets_init()
  twentyseventeen_excerpt_more()
  twentyseventeen_javascript_detection()
  twentyseventeen_pingback_header()
  twentyseventeen_colors_css_wrap()
  twentyseventeen_scripts()
  twentyseventeen_block_editor_styles()
  twentyseventeen_content_image_sizes_attr()
  twentyseventeen_header_image_tag()
  twentyseventeen_post_thumbnail_sizes_attr()
  twentyseventeen_front_page_template()
  twentyseventeen_widget_tag_cloud_args()
  twentyseventeen_unique_id()
  wp_get_list_item_separator()
  twentyseventeen_should_show_featured_image()
  twentyseventeen_register_block_patterns()

Functions
Functions that are not part of a class:

twentyseventeen_setup()   X-Ref
Sets up theme defaults and registers support for various WordPress features.

Note that this function is hooked into the after_setup_theme hook, which
runs before the init hook. The init hook is too late for some features, such
as indicating support for post thumbnails.

twentyseventeen_content_width()   X-Ref
Set the content width in pixels, based on the theme's design and stylesheet.

Priority 0 to make it available to lower priority callbacks.


twentyseventeen_fonts_url()   X-Ref
Register custom fonts.

return: string Fonts URL for the theme.

twentyseventeen_resource_hints( $urls, $relation_type )   X-Ref
Add preconnect for Google Fonts.

param: array  $urls          URLs to print for resource hints.
param: string $relation_type The relation type the URLs are printed.
return: array URLs to print for resource hints.

twentyseventeen_widgets_init()   X-Ref
Register widget area.


twentyseventeen_excerpt_more( $link )   X-Ref
Replaces "[...]" (appended to automatically generated excerpts) with ... and
a 'Continue reading' link.

param: string $link Link to single post/page.
return: string 'Continue reading' link prepended with an ellipsis.

twentyseventeen_javascript_detection()   X-Ref
Handles JavaScript detection.

Adds a `js` class to the root `<html>` element when JavaScript is detected.


twentyseventeen_pingback_header()   X-Ref
Add a pingback url auto-discovery header for singularly identifiable articles.


twentyseventeen_colors_css_wrap()   X-Ref
Display custom color CSS.


twentyseventeen_scripts()   X-Ref
Enqueues scripts and styles.


twentyseventeen_block_editor_styles()   X-Ref
Enqueues styles for the block-based editor.


twentyseventeen_content_image_sizes_attr( $sizes, $size )   X-Ref
Add custom image sizes attribute to enhance responsive image functionality
for content images.

param: string $sizes A source size value for use in a 'sizes' attribute.
param: array  $size  Image size. Accepts an array of width and height
return: string A source size value for use in a content image 'sizes' attribute.

twentyseventeen_header_image_tag( $html, $header, $attr )   X-Ref
Filters the `sizes` value in the header image markup.

param: string $html   The HTML image tag markup being filtered.
param: object $header The custom header object returned by 'get_custom_header()'.
param: array  $attr   Array of the attributes for the image tag.
return: string The filtered header image HTML.

twentyseventeen_post_thumbnail_sizes_attr( $attr, $attachment, $size )   X-Ref
Add custom image sizes attribute to enhance responsive image functionality
for post thumbnails.

param: string[]     $attr       Array of attribute values for the image markup, keyed by attribute name.
param: WP_Post      $attachment Image attachment post.
param: string|int[] $size       Requested image size. Can be any registered image size name, or
return: string[] The filtered attributes for the image markup.

twentyseventeen_front_page_template( $template )   X-Ref
Use front-page.php when Front page displays is set to a static page.

param: string $template front-page.php.
return: string The template to be used: blank if is_home() is true (defaults to index.php),

twentyseventeen_widget_tag_cloud_args( $args )   X-Ref
Modifies tag cloud widget arguments to display all tags in the same font size
and use list format for better accessibility.

param: array $args Arguments for tag cloud widget.
return: array The filtered arguments for tag cloud widget.

twentyseventeen_unique_id( $prefix = '' )   X-Ref
Gets unique ID.

This is a PHP implementation of Underscore's uniqueId method. A static variable
contains an integer that is incremented with each call. This number is returned
with the optional prefix. As such the returned value is not universally unique,
but it is unique across the life of the PHP process.

param: string $prefix Prefix for the returned ID.
return: string Unique ID.

wp_get_list_item_separator()   X-Ref
Retrieves the list item separator based on the locale.

Added for backward compatibility to support pre-6.0.0 WordPress versions.


twentyseventeen_should_show_featured_image()   X-Ref
Show the featured image below the header on single posts and pages, unless the
page is the front page.

Use the filter `twentyseventeen_should_show_featured_image` in a child theme or
plugin to change when the image is shown. This example prevents the image
from showing:

add_filter(
'twentyseventeen_should_show_featured_image',
'__return_false'
);

return: bool Whether the post thumbnail should be shown.

twentyseventeen_register_block_patterns()   X-Ref
Register block patterns and pattern categories.




Generated : Thu Nov 21 08:20:01 2024 Cross-referenced by PHPXref