我正在寻找一种从链接中删除title属性的方法。有一个old plugin 但它破坏了网站。
我想删除的标题位于侧栏小部件中。这是小部件部分的代码:
// Coupon Catetories Widget
class CLPR_Widget_Coupon_Categories extends WP_Widget {
function __construct() {
$widget_ops = array( \'description\' => __( \'Display the coupon categories.\', APP_TD ), \'classname\' => \'widget-coupon-cats\' );
parent::__construct( \'coupon-cats\', __( \'Clipper Coupon Categories\', APP_TD ), $widget_ops );
}
function widget($args, $instance) {
global $wpdb;
extract( $args );
$title = apply_filters(\'widget_title\', empty($instance[\'title\']) ? __( \'Coupon Categories\', APP_TD ) : $instance[\'title\']);
if (strpos($before_widget, \'customclass\') !== false)
$before_widget = str_replace(\'customclass\', \'cut\', $before_widget);
else
$before_widget = str_replace(\'customclass\', \'\', $before_widget);
echo $before_widget;
if ( $title ) echo $before_title . $title . $after_title;
$tax_name = APP_TAX_CAT;
echo \'<div class="coupon-cats-widget"><ul class="list">\';
wp_list_categories("orderby=name&order=asc&hierarchical=1&show_count=0&pad_counts=0&app_pad_counts=1&hide_empty=0&depth=1&number=&title_li=&taxonomy=$tax_name");
echo \'</ul></div>\';
echo $after_widget;
}
function update($new_instance, $old_instance) {
return $new_instance;
}
function form($instance) {
$instance = wp_parse_args( (array) $instance, array( \'title\' => \'\' ) );
$title = esc_attr($instance[\'title\']);
?>
<p><label for="<?php echo $this->get_field_id(\'title\'); ?>"><?php _e( \'Title:\', APP_TD ); ?> <input class="widefat" id="<?php echo $this->get_field_id(\'title\'); ?>" name="<?php echo $this->get_field_name(\'title\'); ?>" type="text" value="<?php echo $title; ?>" /></label></p>
<?php
}
}