Open tomusborne opened 7 years ago
can you add a filter to disable all links? Image, title and abstract? Maybe assign attributes to the filter filter_removelinks(image, title, abstract)
This gets a little weird as the link is within the_title()
function.
Instead, we can just turn the title off, and then add in a link-less title:
add_action( 'wpsp_before_header', 'tu_add_linkless_title' );
function tu_add_linkless_title( $settings ) {
if ( 10 == $settings['list_id'] ) {
the_title();
}
}
If you want to disable ALL links within a wp-show-posts list, I've come up with this: https://gist.github.com/addisonhall/a9d6756de4835018e6ac80a2531e754a
It's far from perfect, but it gets the job done until we have a checkbox. ;-)
UPDATE: I've fixed the link. Sorry about that.
As of 1.1, you'll be able to do this:
add_filter( 'wpsp_disable_image_link', 'tu_disable_links', 10, 2 );
add_filter( 'wpsp_disable_title_link', 'tu_disable_links', 10, 2 );
function tu_disable_links( $output, $settings ) {
if ( 177 === $settings['list_id'] ) {
return true;
}
return $output;
}
177 being the ID of the list we're targeting.
You can grab beta.1 here: https://tomusborne.com/dev/temp/wp-show-posts.zip
Hoping to get it released tomorrow, so any quick testing is appreciated! :)
FYI, the new disable link filters work for me!
Make it so you can disable the title link with a filter.