Last active
March 13, 2018 08:22
-
-
Save badfun/6553622 to your computer and use it in GitHub Desktop.
[template_directory] shortcode allows use of get_template_directory_uri() function in TinyMCE editor WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Shortcode for WP function get_template_directory_uri(); | |
*/ | |
// Add Shortcode | |
function bfp_get_template_directory() { | |
$directory = get_template_directory_uri(); | |
// Code | |
return $directory; | |
} | |
add_shortcode( 'template_directory', 'bfp_get_template_directory' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment