Support » Plugin: Post Content Shortcodes » How to add 'active' class to 'listed-post' li output

  • Hi,

    thanks for a great plugin

    I am trying to highlight the current post being viewed in a posts list

    I wanted to use the

    ‘post-content-shortcodes-open-item’ filter that you provide on line 490 of class-post-content-shortcodes.php

    but you don’t provide a parameter allowing to do that

    So I think I cannot use this filter to add a class based on a comparison between global $post->ID and the item being listed

    It would be quite useful to add the $p parameter to all apply_filters call

    like so

    $output .= apply_filters( 'post-content-shortcodes-open-item', '<li class="listed-post">', $p);

    but maybe this is not necessary

    Hope you can help

    and let me know if the plugin is on github, for instance, so I can make a pull request

    Thank you


Viewing 1 replies (of 1 total)
  • Plugin Author Curtiss Grymala


    I should be releasing a new version today that will include “current-post-item” on the <li> tag for the active post item. I also am adding the post ID and the shortcode attributes to the parameters that are usable through that filter (just in case there’s something else you want to do with it). Thanks for the suggestion.

Viewing 1 replies (of 1 total)
  • The topic ‘How to add 'active' class to 'listed-post' li output’ is closed to new replies.