Created
September 10, 2014 16:29
-
-
Save jlittlejohn/bb4a4512fe746b59f79a to your computer and use it in GitHub Desktop.
WP: Create Shortcode
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
// Example | |
function shortcode_name( $atts, $content = null ){ | |
$a = shortcode_atts( array( | |
'example' => '' | |
), $atts ); | |
return '<a id="example" data-example="' . $a['example'] . '">' . $content . '</a>'; | |
} | |
add_shortcode( 'name', 'shortcode_name' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment