Skip to content

Instantly share code, notes, and snippets.

@runezero
Created July 20, 2022 14:19
Show Gist options
  • Select an option

  • Save runezero/b7a40ebb74aeeb7dff74adc46386bbe3 to your computer and use it in GitHub Desktop.

Select an option

Save runezero/b7a40ebb74aeeb7dff74adc46386bbe3 to your computer and use it in GitHub Desktop.
[Shortcode sample] A default WP shortcode reference #wordpress
add_shortcode( 'bartag', 'wpdocs_bartag_func' );
function wpdocs_bartag_func( $atts ) {
$atts = shortcode_atts( array(
'foo' => 'no foo',
'baz' => 'default baz'
), $atts, 'bartag' );
return "foo = {$atts['foo']}";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment