Creating a Shortcode

Creating a Shortcode

The PHP snippet below provides an example to use [my_shortcode] to output text string of 「short code example」:

add_shortcode( 'my_shortcode', function() {
ob_start();
// Start your PHP below

echo 'short code example';

// End your PHP above
return ob_get_clean();
} );

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注