📜  wordpress 做简码 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.347000             🧑  作者: Mango

代码示例6
function wp_demo_shortcode() { 

//Turn on output buffering
ob_start();
$code = 'Hello World';
ob_get_clean();

 // Output needs to be return
return $code;
} 

// register shortcode
add_shortcode('helloworld', 'wp_demo_shortcode');