[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwenty/inc/ -> template-tags.php (summary)

Custom template tags for this theme.

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

Defines 15 functions

  twentytwenty_site_logo()
  twentytwenty_site_description()
  twentytwenty_is_comment_by_post_author()
  twentytwenty_filter_comment_reply_link()
  twentytwenty_the_post_meta()
  twentytwenty_edit_post_link()
  twentytwenty_get_post_meta()
  twentytwenty_filter_wp_list_pages_item_classes()
  twentytwenty_add_sub_toggles_to_main_menu()
  twentytwenty_nav_menu_social_icons()
  twentytwenty_no_js_class()
  twentytwenty_body_classes()
  twentytwenty_get_the_archive_title()
  twentytwenty_toggle_duration()
  twentytwenty_unique_id()

Functions
Functions that are not part of a class:

twentytwenty_site_logo( $args = array()   X-Ref
Displays the site logo, either text or image.

return: string $html Compiled HTML based on our arguments.
param: array   $args Arguments for displaying the site logo either as an image or text.
param: boolean $echo Echo or return the HTML.

twentytwenty_site_description( $echo = true )   X-Ref
Displays the site description.

return: string $html The HTML to display.
param: boolean $echo Echo or return the html.

twentytwenty_is_comment_by_post_author( $comment = null )   X-Ref
Check if the specified comment is written by the author of the post commented on.

return: bool
param: object $comment Comment data.

twentytwenty_filter_comment_reply_link( $link )   X-Ref
Filter comment reply link to not JS scroll.
Filter the comment reply link to add a class indicating it should not use JS slow-scroll, as it
makes it scroll to the wrong position on the page.

return: string $link Link to the top of the page.
param: string $link Link to the top of the page.

twentytwenty_the_post_meta( $post_id = null, $location = 'single-top' )   X-Ref
Get and Output Post Meta.
If it's a single post, output the post meta values specified in the Customizer settings.

param: int    $post_id The ID of the post for which the post meta should be output.
param: string $location Which post meta location to output – single or preview.

twentytwenty_edit_post_link( $link, $post_id, $text )   X-Ref
Filters the edit post link to add an icon and use the post meta structure.

param: string $link    Anchor tag for the edit link.
param: int    $post_id Post ID.
param: string $text    Anchor text.

twentytwenty_get_post_meta( $post_id = null, $location = 'single-top' )   X-Ref
Get the post meta.

param: int    $post_id The ID of the post.
param: string $location The location where the meta is shown.

twentytwenty_filter_wp_list_pages_item_classes( $css_class, $item, $depth, $args, $current_page )   X-Ref
Filter Classes of wp_list_pages items to match menu items.
Filter the class applied to wp_list_pages() items with children to match the menu class, to simplify.
styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set.

return: array $css_class CSS Class names.
param: array  $css_class CSS Class names.
param: string $item Comment.
param: int    $depth Depth of the current comment.
param: array  $args An array of arguments.
param: string $current_page Whether or not the item is the current item.

twentytwenty_add_sub_toggles_to_main_menu( $args, $item, $depth )   X-Ref
Add a Sub Nav Toggle to the Expanded Menu and Mobile Menu.

return: stdClass $args An object of wp_nav_menu() arguments.
param: stdClass $args An array of arguments.
param: string   $item Menu item.
param: int      $depth Depth of the current menu item.

twentytwenty_nav_menu_social_icons( $item_output, $item, $depth, $args )   X-Ref
Display SVG icons in social links menu.

return: string  $item_output The menu item output with social icon.
param: string  $item_output The menu item output.
param: WP_Post $item        Menu item object.
param: int     $depth       Depth of the menu.
param: array   $args        wp_nav_menu() arguments.

twentytwenty_no_js_class()   X-Ref
Add No-JS Class.
If we're missing JavaScript support, the HTML element will have a no-js class.


twentytwenty_body_classes( $classes )   X-Ref
Add conditional body classes.

return: array $classes Classes added to the body tag.
param: array $classes Classes added to the body tag.

twentytwenty_get_the_archive_title( $title )   X-Ref
Filters the archive title and styles the word before the first colon.

return: string $title Current archive title.
param: string $title Current archive title.

twentytwenty_toggle_duration()   X-Ref
Toggle animation duration in milliseconds.

return: integer Duration in milliseconds

twentytwenty_unique_id( $prefix = '' )   X-Ref
Get 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.

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



Generated: Wed Dec 11 01:00:03 2019 Cross-referenced by PHPXref 0.7.1