[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Twenty Sixteen functions and definitions Set up the theme and provides some helper functions, which are used in the theme as custom template tags. Others are attached to action and filter hooks in WordPress to change core functionality.

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

Defines 13 functions

  twentysixteen_setup()
  twentysixteen_content_width()
  twentysixteen_resource_hints()
  twentysixteen_widgets_init()
  twentysixteen_fonts_url()
  twentysixteen_javascript_detection()
  twentysixteen_scripts()
  twentysixteen_block_editor_styles()
  twentysixteen_body_classes()
  twentysixteen_hex2rgb()
  twentysixteen_content_image_sizes_attr()
  twentysixteen_post_thumbnail_sizes_attr()
  twentysixteen_widget_tag_cloud_args()

Functions
Functions that are not part of a class:

twentysixteen_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.

Create your own twentysixteen_setup() function to override in a child theme.

since: Twenty Sixteen 1.0

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

Priority 0 to make it available to lower priority callbacks.

since: Twenty Sixteen 1.0

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

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

twentysixteen_widgets_init()   X-Ref
Registers a widget area.

since: Twenty Sixteen 1.0

twentysixteen_fonts_url()   X-Ref
Register Google fonts for Twenty Sixteen.

Create your own twentysixteen_fonts_url() function to override in a child theme.

return: string Google fonts URL for the theme.
since: Twenty Sixteen 1.0

twentysixteen_javascript_detection()   X-Ref
Handles JavaScript detection.

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

since: Twenty Sixteen 1.0

twentysixteen_scripts()   X-Ref
Enqueues scripts and styles.

since: Twenty Sixteen 1.0

twentysixteen_block_editor_styles()   X-Ref
Enqueue styles for the block-based editor.

since: Twenty Sixteen 1.6

twentysixteen_body_classes( $classes )   X-Ref
Adds custom classes to the array of body classes.

return: array (Maybe) filtered body classes.
param: array $classes Classes for the body element.
since: Twenty Sixteen 1.0

twentysixteen_hex2rgb( $color )   X-Ref
Converts a HEX value to RGB.

return: array Array containing RGB (red, green, and blue) values for the given
param: string $color The original color, in 3- or 6-digit hexadecimal form.
since: Twenty Sixteen 1.0

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

return: string A source size value for use in a content image 'sizes' attribute.
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
since: Twenty Sixteen 1.0

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

return: string[] The filtered attributes for the image markup.
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
since: Twenty Sixteen 1.0

twentysixteen_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.

return: array The filtered arguments for tag cloud widget.
param: array $args Arguments for tag cloud widget.
since: Twenty Sixteen 1.1



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1