Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionI'm looking for a way to remove the title attribute from links. There is a old plugin but it breaks the site.
The title I would like to remove is in the sidebar widget. Thats the code of the widget part:
// 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
}
}
Closed. This question is off-topic. It is not currently accepting answers.
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 6 years ago.
Improve this questionI'm looking for a way to remove the title attribute from links. There is a old plugin but it breaks the site.
The title I would like to remove is in the sidebar widget. Thats the code of the widget part:
// 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
}
}
You could provide some more details, like what title attributes you are trying to remove. In the navigation, content, etc. Anyway, you could try adding this to your theme or child theme's functions.php file, I have yet to test it though.
function remove_title_attributes($input) {
return preg_replace('/\s*title\s*=\s*(["\']).*?\1/', '', $input);
}
add_filter('wp_list_pages', 'remove_title_attributes');
title=
shows irritating content. Therefore I need to remove it. Also for SEO Reason. – joloshop Commented Nov 27, 2018 at 21:39title
attributes and links are, you might get a better answer. Right now the assumption is that you want them removed from links inside post content, or, the super old links table functionality – Tom J Nowell ♦ Commented Nov 27, 2018 at 21:42