所有大括号都已关闭,但我仍然收到有关额外括号的错误消息。怎么可能呢?
我已经检查过有关此错误的先前问题,但未能找到令人满意的解决方案。
function mepr_cancel_questionnaire($atts,$content=null) {
$mepr_options = MeprOptions::fetch();
if($sub = new MeprSubscription((int)$_REQUEST['sub'])) {
$usr = $sub->user();
$prd = $sub->product();
if (is_numeric($usr->ID) && ($usr->ID == get_current_user_id())) :
$output.='<a href="' . $mepr_options-
>account_page_url('action=cancel&sub='.$sub->ID) . '">Cancel
Subscription</a>';
return $output;
endif;
}
}
add_shortcode("customcancellink", "mepr_cancel_questionnaire");
add_action('mepr_custom_cancel_link', 'custom_cancel_link', 10, 2);
function custom_cancel_link($html, $sub) {
ob_start();
?>
<a href="<?php echo site_url(); ?>/cancel?sub=<?php echo $sub->ID; ?
>">Cancel</a>
<?php
return ob_get_clean();
}