Skip to content

Functions Path Helpers

alex_prokopenko edited this page Jan 19, 2018 · 1 revision

Path helper functions helps you to make templates code more clean, when using theme paths.

<?php
/**
 * Alias for get_stylesheet_directory_uri() . /assets/ . $path
 *
 * @param string  $path path to be appended to the theme uri.
 * @param boolean $echo print or return.
 *
 * @return string
 */
function assets( $path, $echo = true );

/**
 * Alias for get_template_directory_uri() . /assets/ . $path
 *
 * @param string  $path path to be appended to the parent theme uri.
 * @param boolean $echo print or return.
 *
 * @return string
 */
function parent_assets( $path, $echo = true );

/**
 * Alias for plugins_url with pre-defined second parameter
 * Mostly used to set paths for assets
 *
 * @param string $path asset or callback path
 *
 * @return string
 */
function jtf_plugin_url( $path );