[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwentyone/inc/ -> template-functions.php (summary)

Functions which enhance the theme by hooking into WordPress

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

Defines 17 functions

  twenty_twenty_one_body_classes()
  twenty_twenty_one_post_classes()
  twenty_twenty_one_pingback_header()
  twenty_twenty_one_supports_js()
  twenty_twenty_one_comment_form_defaults()
  twenty_twenty_one_can_show_post_thumbnail()
  twenty_twenty_one_get_avatar_size()
  twenty_twenty_one_continue_reading_text()
  twenty_twenty_one_continue_reading_link_excerpt()
  twenty_twenty_one_continue_reading_link()
  twenty_twenty_one_post_title()
  twenty_twenty_one_get_icon_svg()
  twenty_twenty_one_change_calendar_nav_arrows()
  twenty_twenty_one_get_non_latin_css()
  twenty_twenty_one_print_first_instance_of_block()
  twenty_twenty_one_password_form()
  twenty_twenty_one_get_attachment_image_attributes()

Functions
Functions that are not part of a class:

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

param: array $classes Classes for the body element.
return: array
since: Twenty Twenty-One 1.0

twenty_twenty_one_post_classes( $classes )   X-Ref
Adds custom class to the array of posts classes.

param: array $classes An array of CSS classes.
return: array
since: Twenty Twenty-One 1.0

twenty_twenty_one_pingback_header()   X-Ref
Add a pingback url auto-discovery header for single posts, pages, or attachments.

return: void
since: Twenty Twenty-One 1.0

twenty_twenty_one_supports_js()   X-Ref
Remove the `no-js` class from body if JS is supported.

return: void
since: Twenty Twenty-One 1.0

twenty_twenty_one_comment_form_defaults( $defaults )   X-Ref
Changes comment form default fields.

param: array $defaults The form defaults.
return: array
since: Twenty Twenty-One 1.0

twenty_twenty_one_can_show_post_thumbnail()   X-Ref
Determines if post thumbnail can be displayed.

return: bool
since: Twenty Twenty-One 1.0

twenty_twenty_one_get_avatar_size()   X-Ref
Returns the size for avatars used in the theme.

return: int
since: Twenty Twenty-One 1.0

twenty_twenty_one_continue_reading_text()   X-Ref
Creates continue reading text.

since: Twenty Twenty-One 1.0

twenty_twenty_one_continue_reading_link_excerpt()   X-Ref
Creates the continue reading link for excerpt.

since: Twenty Twenty-One 1.0

twenty_twenty_one_continue_reading_link()   X-Ref
Creates the continue reading link.

since: Twenty Twenty-One 1.0

twenty_twenty_one_post_title( $title )   X-Ref
Adds a title to posts and pages that are missing titles.

param: string $title The title.
return: string
since: Twenty Twenty-One 1.0

twenty_twenty_one_get_icon_svg( $group, $icon, $size = 24 )   X-Ref
Gets the SVG code for a given icon.

param: string $group The icon group.
param: string $icon  The icon.
param: int    $size  The icon size in pixels.
return: string
since: Twenty Twenty-One 1.0

twenty_twenty_one_change_calendar_nav_arrows( $calendar_output )   X-Ref
Changes the default navigation arrows to svg icons

param: string $calendar_output The generated HTML of the calendar.
return: string
since: Twenty Twenty-One 1.0

twenty_twenty_one_get_non_latin_css( $type = 'front-end' )   X-Ref
Get custom CSS.

Return CSS for non-latin language, if available, or null

param: string $type Whether to return CSS for the "front-end", "block-editor", or "classic-editor".
return: string
since: Twenty Twenty-One 1.0

twenty_twenty_one_print_first_instance_of_block( $block_name, $content = null, $instances = 1 )   X-Ref
Print the first instance of a block in the content, and then break away.

param: string      $block_name The full block type name, or a partial match.
param: string|null $content    The content to search in. Use null for get_the_content().
param: int         $instances  How many instances of the block will be printed (max). Default  1.
return: bool Returns true if a block was located & printed, otherwise false.
since: Twenty Twenty-One 1.0

twenty_twenty_one_password_form( $output, $post = 0 )   X-Ref
Retrieve protected post password form content.

param: string      $output The password form HTML output.
param: int|WP_Post $post   Optional. Post ID or WP_Post object. Default is global $post.
return: string HTML content for password form for password protected post.
since: Twenty Twenty-One 1.0
since: Twenty Twenty-One 1.4 Corrected parameter name for `$output`,

twenty_twenty_one_get_attachment_image_attributes( $attr, $attachment, $size )   X-Ref
Filters the list of attachment image attributes.

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



Generated: Fri Oct 4 01:00:02 2024 Cross-referenced by PHPXref 0.7.1