• When building a child theme, it’s confusing to call get_stylesheet_directory_uri() when you want to get the child template directory uri.

    What I’m proposing is that an alias of get_stylesheet_directory_uri() be created and called get_child_template_directory_uri().

    The functionality can remain the same, but a new alias will bring clarity to developers learning WordPress.

    I often see developers call get_template_directory_uri() and not realize that it only works with the parent theme, not the currently active theme. Once it’s explained, it makes sense, but get_stylesheet_directory_uri() still doesn’t give a good indication of what the outcome is, especially when get_template_directory_uri() only works for the parent theme, but get_stylesheet_directory_uri() works for the child theme.

    When the function names are clear, the developers are happier. ??

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Create an alias of get_stylesheet_directory_uri for child themes.’ is closed to new replies.