Ali_W
Forum Replies Created
Viewing 5 replies - 1 through 5 (of 5 total)
-
Forum: Plugins
In reply to: [The Events Calendar] Jump *main* calendar to first month with eventHi Barry,
Thanks
Anyone have any suggestions??
Ali
Didn’t see you reply 🙂
OK sorted it…
adding this to themes function.php
add_filter('wpel_external_link_attrs', 'wpel_custom_title', 10, 3); function wpel_custom_title($attrs, $original_attrs, $label) { if (isset($attrs['title'])) { $title = $attrs['title']; $attrs['title'] = $title . ' (opens in a new window)'; } else if (empty($attrs['title']) && isset($attrs['href'])) { $protocol = array("http://", "https://"); $href = htmlspecialchars(str_replace ( $protocol, '', $attrs[ 'href' ] ), ENT_QUOTES); $attrs['title'] = $href . ' (opens in a new window)'; } return $attrs; }And setting title-attribute in the plugin settings to the default %title%
Thanks
It only works if I empty the title-attribute in the plugin settings…
Sorry that code doesn’t work – the title doesn’t get updated with the href so we are left with “[space](opens in a new window)”
I have [re]added my code into includes/class-wp-external-links.php around line 445
$protocol = array("http://", "https://"); $href = str_replace ( $protocol, '', $attrs[ 'href' ] ); if ($title == '' ? $attrs[ 'title' ] = str_replace( '%title%', $href, $title_format ) : $attrs[ 'title' ] = str_replace( '%title%', $title, $title_format ) );
Viewing 5 replies - 1 through 5 (of 5 total)