我正在学习如何创建短代码。我有以下插件:
<?php
/**
* @package Foobar
* @version 1.0
*/
/*
Plugin Name: Foobar
Plugin URI: www.example.com
Description: Shortcode something something
Author: Me
Version: 1.0
Author URI: www.example.com
*/
//[foobar]
function foobar_func( $atts ){
return "foo and bar";
}
add_shortcode( \'foobar\', \'foobar_func\' );
?>
插件已激活:

短代码在帖子中:

我想
[foobar]
替换为“foo和bar”。相反,帖子显示为:

我错过了什么?为什么不替换短代码标记?