Created
March 31, 2022 19:22
-
-
Save zackkatz/1fd83bb4c43f2fd9f8abf75dbe4d07c6 to your computer and use it in GitHub Desktop.
Adds a shortcode to return the WordPress site's URL
This file contains 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
<?php | |
// Shortcode for Site URL - Use [site_url] for Shortcode | |
add_action( 'init', function() { | |
add_shortcode( 'site_url', function( $atts = null, $content = null ) { | |
return site_url(); | |
} ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment