【发布时间】:2011-08-24 11:26:04
【问题描述】:
我正在尝试编写一个简单的自定义小部件,允许用户注册特别优惠。因此,对于我的表单的“操作”,我希望它读取 action=" bloginfo('template_directory') . '/theme/php/handler.php'" 但每次我引用 bloginfo 标记时,输出都会被抛出<li> 用于小部件。
示例位于http://shineaz.com - 底部右侧边栏。
这是我的函数小部件():
function widget($args, $instance) {
// outputs the content of the widget
extract( $args, EXTR_SKIP);
$args['title'] = isset($instance['title']) ? $instance['title'] : 'Sign up for Special Offers';
echo $before_widget;
echo $before_title . $args['title'] . $after_title;
echo '<form id="special_offers" method="post" action="' . bloginfo('template_directory') . '/custom/php/special-offer-handler.php">
</form>';
echo $after_widget;
}
谢谢
【问题讨论】:
标签: wordpress