Skip to content

Instantly share code, notes, and snippets.

@wpscholar
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpscholar/9124824 to your computer and use it in GitHub Desktop.
Save wpscholar/9124824 to your computer and use it in GitHub Desktop.
Example of how to implement a shortcode
<?php
/**
* Custom shortcode callback function
*
* @param array $atts
* @param string $content
* @return string
*/
function my_shortcode_callback( $atts = array(), $content = '' ) {
$defaults = array();
$settings = shortcode_atts( $defaults, wp_parse_args( $atts ) );
// Do Stuff
return '';
}
add_shortcode( 'my_shortcode', 'my_shortcode_callback' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment