Page Links To
Links with ampersands don't open in new window in the loop. (1 post)

  1. brobison
    Posted 4 years ago #

    The plugin works great for me until I try to use it inside the loop and the link has an ampersand in it. I noticed this first trying to open some links to YouTube in a new window.

    I spent some time troubleshooting this issue and narrowed it down an issue with the jQuery filter that adds the new window code. For some reason, the conversion to HTML entities was tripping up the filter.

    I'm not exactly sure how to fix the underlying issue, but I came up with a temporary workaround by using html_decode_entities() both in the plugin and my template:

    Plugin (line 291):
    Old Code:

    function id_to_url_callback( &$val, $key ) {
    		$val = get_permalink( $val );

    New Code:

    function id_to_url_callback( &$val, $key ) {
    		$val = html_entity_decode( get_permalink( $val ) );

    My Template:

    <h2 class="entry-title"><a href="<?php echo html_entity_decode( get_permalink() ); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'skeleton' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Page Links To
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic