Make WordPress Core


Ignore:
Timestamp:
02/08/2020 12:59:44 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Twenty Nineteen: Improve code organization in template-functions.php by moving helper functions into their own file.

These functions are moved to inc/helper-functions.php:

  • twentynineteen_can_show_post_thumbnail()
  • twentynineteen_image_filters_enabled()
  • twentynineteen_get_avatar_size()
  • twentynineteen_is_comment_by_post_author()
  • twentynineteen_get_discussion_data()
  • twentynineteen_hsl_hex()

Additionally, twentynineteen_add_dropdown_icons() is moved to inc/icon-functions.php to join twentynineteen_nav_menu_social_icons().

Props akshayar, allancole, grapplerulrich.
Fixes #45984.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentynineteen/functions.php

    r46827 r47214  
    306306
    307307/**
     308 * Common theme functions.
     309 */
     310require get_template_directory() . '/inc/helper-functions.php';
     311
     312/**
     313 * SVG Icons related functions.
     314 */
     315require get_template_directory() . '/inc/icon-functions.php';
     316
     317/**
    308318 * Enhance the theme by hooking into WordPress.
    309319 */
     
    311321
    312322/**
    313  * SVG Icons related functions.
    314  */
    315 require get_template_directory() . '/inc/icon-functions.php';
    316 
    317 /**
    318323 * Custom template tags for the theme.
    319324 */
Note: See TracChangeset for help on using the changeset viewer.