• Resolved msephton

    (@msephton)


    I know this is not the typical use of the plugin, but…

    in my list of 432 links some entries do not have URLs. That is, I have entries in the list that are awaiting URLs. This helps my editors focus on what needs to be done.

    However, links without a URL are still rendered as an anchor tag. Which means they look like valid links.

    Can the plugin render links without URLs as plain text rather than an anchor tag?

    I’ve even tried using # as a link but this isn’t a good workaround.

    Any help appreciated.

Viewing 1 replies (of 1 total)
  • Thread Starter msephton

    (@msephton)

    OK, so I found a way around this myself using a filter. Thanks for the docs!

    Hopefully this is useful for somebody else.

    // output plain text for links with no URL (or just # as URL)
    add_filter( 'simple_links_shortcode_link_output', 'sl_change_link_output', 1, 4);
    function sl_change_link_output( $link_output, $meta, $link, $image ){
      if (trim($meta[web_address][0]) == '' || trim($meta[web_address][0]) == '#') {
        return $link->post_title;
      } else {
        return $link_output;
      }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Links with no URL still output as links’ is closed to new replies.