- Timestamp:
- 06/20/2020 11:16:12 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwenty/inc/template-tags.php
r47799 r48102 22 22 * Logo & Description 23 23 */ 24 24 25 /** 25 26 * Displays the site logo, either text or image. … … 27 28 * @param array $args Arguments for displaying the site logo either as an image or text. 28 29 * @param boolean $echo Echo or return the HTML. 29 * 30 * @return string $html Compiled HTML based on our arguments. 30 * @return string Compiled HTML based on our arguments. 31 31 */ 32 32 function twentytwenty_site_logo( $args = array(), $echo = true ) { … … 90 90 * 91 91 * @param boolean $echo Echo or return the html. 92 * 93 * @return string $html The HTML to display. 92 * @return string The HTML to display. 94 93 */ 95 94 function twentytwenty_site_description( $echo = true ) { … … 125 124 * Comments 126 125 */ 127 /** 128 * Check if the specified comment is written by the author of the post commented on. 126 127 /** 128 * Checks if the specified comment is written by the author of the post commented on. 129 129 * 130 130 * @param object $comment Comment data. 131 *132 131 * @return bool 133 132 */ … … 150 149 151 150 /** 152 * Filter comment reply link to not JS scroll. 151 * Filters comment reply link to not JS scroll. 152 * 153 153 * Filter the comment reply link to add a class indicating it should not use JS slow-scroll, as it 154 154 * makes it scroll to the wrong position on the page. 155 155 * 156 156 * @param string $link Link to the top of the page. 157 * 158 * @return string $link Link to the top of the page. 157 * @return string Link to the top of the page. 159 158 */ 160 159 function twentytwenty_filter_comment_reply_link( $link ) { … … 170 169 * Post Meta 171 170 */ 172 /** 173 * Get and Output Post Meta. 174 * If it's a single post, output the post meta values specified in the Customizer settings. 175 * 176 * @param int $post_id The ID of the post for which the post meta should be output. 171 172 /** 173 * Retrieves and displays the post meta. 174 * 175 * If it's a single post, outputs the post meta values specified in the Customizer settings. 176 * 177 * @param int $post_id The ID of the post for which the post meta should be output. 177 178 * @param string $location Which post meta location to output – single or preview. 178 179 */ … … 221 222 222 223 /** 223 * Getthe post meta.224 * Retrieves the post meta. 224 225 * 225 226 * @param int $post_id The ID of the post. … … 234 235 235 236 /** 236 * Filters post types array 237 * 238 * This filter can be used to hide post meta information of post, page or custom post type registerd by child themes or plugins 237 * Filters post types array. 238 * 239 * This filter can be used to hide post meta information of post, page or custom post type 240 * registered by child themes or plugins. 239 241 * 240 242 * @since Twenty Twenty 1.0 … … 243 245 */ 244 246 $disallowed_post_types = apply_filters( 'twentytwenty_disallowed_post_types_for_meta_output', array( 'page' ) ); 247 245 248 // Check whether the post type is allowed to output post meta. 246 249 if ( in_array( get_post_type( $post_id ), $disallowed_post_types, true ) ) { … … 254 257 if ( 'single-top' === $location ) { 255 258 /** 256 * Filters post meta info visibility257 *258 * Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status259 *260 * @since Twenty Twenty 1.0261 *262 * @param array $args {263 * @type string 'author'264 * @type string 'post-date'265 * @type string 'comments'266 * @type string 'sticky'267 * }268 */259 * Filters post meta info visibility. 260 * 261 * Use this filter to hide post meta information like Author, Post date, Comments, Is sticky status. 262 * 263 * @since Twenty Twenty 1.0 264 * 265 * @param array $args { 266 * @type string 'author' 267 * @type string 'post-date' 268 * @type string 'comments' 269 * @type string 'sticky' 270 * } 271 */ 269 272 $post_meta = apply_filters( 270 273 'twentytwenty_post_meta_location_single_top', … … 282 285 283 286 /** 284 * Filters post tags visibility285 *286 * Use this filter to hide post tags287 *288 * @since Twenty Twenty 1.0289 *290 * @param array $args {291 * @type string 'tags'292 * }293 */287 * Filters post tags visibility. 288 * 289 * Use this filter to hide post tags. 290 * 291 * @since Twenty Twenty 1.0 292 * 293 * @param array $args { 294 * @type string 'tags' 295 * } 296 */ 294 297 $post_meta = apply_filters( 295 298 'twentytwenty_post_meta_location_single_bottom', … … 490 493 * Menus 491 494 */ 492 /** 493 * Filter Classes of wp_list_pages items to match menu items. 495 496 /** 497 * Filters classes of wp_list_pages items to match menu items. 498 * 494 499 * Filter the class applied to wp_list_pages() items with children to match the menu class, to simplify. 495 500 * styling of sub levels in the fallback. Only applied if the match_menu_classes argument is set. … … 500 505 * @param array $args An array of arguments. 501 506 * @param string $current_page Whether or not the item is the current item. 502 *503 507 * @return array $css_class CSS Class names. 504 508 */ … … 529 533 530 534 /** 531 * Add a Sub Nav Toggle to the Expanded Menu and Mobile Menu.535 * Adds a Sub Nav Toggle to the Expanded Menu and Mobile Menu. 532 536 * 533 537 * @param stdClass $args An array of arguments. 534 538 * @param string $item Menu item. 535 539 * @param int $depth Depth of the current menu item. 536 *537 540 * @return stdClass $args An object of wp_nav_menu() arguments. 538 541 */ … … 576 579 577 580 /** 578 * Display SVG icons in social links menu.581 * Displays SVG icons in social links menu. 579 582 * 580 583 * @param string $item_output The menu item output. … … 602 605 * Classes 603 606 */ 604 /** 605 * Add No-JS Class. 606 * If we're missing JavaScript support, the HTML element will have a no-js class. 607 608 /** 609 * Adds 'no-js' class. 610 * 611 * If we're missing JavaScript support, the HTML element will have a 'no-js' class. 607 612 */ 608 613 function twentytwenty_no_js_class() { … … 617 622 618 623 /** 619 * Add conditional body classes.624 * Adds conditional body classes. 620 625 * 621 626 * @param array $classes Classes added to the body tag. 622 * 623 * @return array $classes Classes added to the body tag. 627 * @return array Classes added to the body tag. 624 628 */ 625 629 function twentytwenty_body_classes( $classes ) { … … 717 721 * Archives 718 722 */ 723 719 724 /** 720 725 * Filters the archive title and styles the word before the first colon. 721 726 * 722 727 * @param string $title Current archive title. 723 * 724 * @return string $title Current archive title. 728 * @return string Current archive title. 725 729 */ 726 730 function twentytwenty_get_the_archive_title( $title ) { … … 749 753 * Miscellaneous 750 754 */ 751 /** 752 * Toggle animation duration in milliseconds. 753 * 754 * @return integer Duration in milliseconds 755 756 /** 757 * Toggles animation duration in milliseconds. 758 * 759 * @return int Duration in milliseconds 755 760 */ 756 761 function twentytwenty_toggle_duration() { … … 760 765 * @since Twenty Twenty 1.0 761 766 * 762 * @param int eger$duration Duration in milliseconds.767 * @param int $duration Duration in milliseconds. 763 768 */ 764 769 $duration = apply_filters( 'twentytwenty_toggle_duration', 250 ); … … 768 773 769 774 /** 770 * Get unique ID.775 * Gets unique ID. 771 776 * 772 777 * This is a PHP implementation of Underscore's uniqueId method. A static variable
Note: See TracChangeset
for help on using the changeset viewer.