Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Created January 8, 2020 10:44
Show Gist options
  • Save sidouglas/ba3b24906a8a9b2b87990439b0b36424 to your computer and use it in GitHub Desktop.
Save sidouglas/ba3b24906a8a9b2b87990439b0b36424 to your computer and use it in GitHub Desktop.
Add Shortcode WordPress
<?php
add_shortcode( "[tag]", "your_shortcode" );
function your_shortcode( $atts, $content = null ){
extract( shortcode_atts([
'foo' => 'something',
'bar' => 'something else',
], $atts ) );
return 'something';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment