[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Twenty Seventeen functions and definitions

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

Defines 17 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()

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.


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

since: Twenty Seventeen 1.0
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.

since: Twenty Seventeen 1.0
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.

since: Twenty Seventeen 1.0

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.

since: Twenty Seventeen 1.8

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

since: Twenty Seventeen 1.0
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.

since: Twenty Seventeen 1.0
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.

since: Twenty Seventeen 1.0
param: array $attr       Attributes for the image markup.
param: int   $attachment Image attachment ID.
param: array $size       Registered image size or flat array of height and width dimensions.
return: array 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.

since: Twenty Seventeen 1.0
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.

since: Twenty Seventeen 1.4
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.

since: Twenty Seventeen 2.0
param: string $prefix Prefix for the returned ID.
return: string Unique ID.



Generated: Wed Jan 20 01:00:03 2021 Cross-referenced by PHPXref 0.7.1