Created
April 23, 2024 21:14
-
-
Save alanef/80a4f477afb2498e88912efc676478ef to your computer and use it in GitHub Desktop.
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 | |
/* | |
use like [myshortcode type=feedback] | |
*/ | |
add_shortcode( 'myshortcode', function ( $atts ) { | |
$atts = shortcode_atts( array( 'type' => '' ) ); | |
return apply_filter( 'myshortcode_' . $atts['type'], '' ); | |
} ); | |
add_filter( 'myshortcode_ad', function () { | |
return 'Hello World!'; | |
} ); | |
add_filter( 'myshortcode_feedback', function () { | |
return 'Hello World!'; | |
} ); | |
add_filter( 'myshortcode_thanks', function () { | |
return 'thanks'; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment