Created
July 20, 2022 14:19
-
-
Save runezero/b7a40ebb74aeeb7dff74adc46386bbe3 to your computer and use it in GitHub Desktop.
[Shortcode sample] A default WP shortcode reference #wordpress
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
| 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