我正在构建WordPress选项面板。
在我的选项面板中,我添加了以下内容,这将创建一个是/否下拉菜单,询问用户是否要显示面包屑-I want to be able to hide (or simply not call) the breadcrumbs when a user selects no:
array( "name" => "Display breadcrumbs on post pages?",
"desc" => "Choose whether or not to display breadcrumbs, that is, the post trail.",
"id" => $shortname."_breadcrumbs",
"type" => "select",
"options" => array("Yes", "No"),
"std" => "Yes"),
通常,我会使用类似这样的方式调用上述函数:
<?php echo get_option(\'to_breadcrumbs\'); ?>
但是面包屑有自己的功能,我这样称呼它们:
<?php if (function_exists(\'dimox_breadcrumbs\')) dimox_breadcrumbs(); ?>
One possible solution that could be applied in other uses would be to add a div class with the hide property around the function I am calling when "No" is selected. Any help?