我在拉JSON数据并创建我的页面WordPress的 - 从网页发送变量主题功能
我的问题是如何从通过RID =值使用简码的主题函数文件中的函数使用短代码 [json_employees]并将RID发送回函数的页面?
function foobar2_func($atts){
ob_start();
$url = 'https://jdublu.com/api/wrsc/json_employee.php?RID=17965';
$data = file_get_contents($url);
$items = str_replace('<p></p>', '', $items);
$items = json_decode($data, true);
?>
add_shortcode('json_employees', 'foobar2_func');
你有没有试着用'shortcode_atts'? – vel