Created
January 14, 2020 19:10
-
-
Save w33zy/21e99b8fc1110a702adadfdae8746e64 to your computer and use it in GitHub Desktop.
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
<?php | |
function callout_shortcode( $atts ) { | |
$out = ''; | |
$atts = shortcode_atts( | |
array( | |
'callout_h4' => 'This is a header', | |
'callout_p' => 'This is the paragraph below it', | |
), | |
$atts | |
); | |
$out .= '<div class="callout">'; | |
$out .= '<h4>' . esc_html( $atts['callout_h4'] ) . '</h4>'; | |
$out .= '<p>' . esc_html( $atts['callout_p'] ) . '</p>'; | |
$out .= '</div>'; | |
return $out; | |
} | |
add_shortcode( 'callout', 'callout_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment