Skip to content

Instantly share code, notes, and snippets.

@badfun
Last active March 13, 2018 08:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save badfun/6553622 to your computer and use it in GitHub Desktop.
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
/**
* 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