Join our new community forum for support & discussion

Join Now

Home Support Extensions Reviews filter review view block

filter review view block

  • Author
    Posts
  • frshminds

    i need to add markup to the listing reviews on the front end.

    this does not work:

    apply_filters(‘hivepress/v1/templates/review_view_block’, array($this, ‘review_template’), 1000);

    i am using this filter which works:

    add_filter(‘hivepress/v1/templates/listing_view_block’, array($this, ‘listing_view_block’), 1000);

    yevhen developer

    If you mean adding some custom HTML before or after the reviews you can try the listing_view_page filter, to override each review please use the review_view_block one.

    frshminds

    i am talking about inside the review markup itself, between the summary and the review text content. if there is not a filter to override this, i suppose i can do it another way. maybe the hooks don’t quite work the same when you are dealing w/ extensions?

    frshminds

    i would most likely want to insert markup between the ‘review_header’ and the ‘review_content’ blocks in the Review_View_Block Template.

    frshminds

    i was going by this reference here:

    https://hivepress.github.io/hook-reference/hivepress_v1_templates_%257Btemplate_name%257D.html

    it looks like i really need to filter the template rather than override one of the template parts, as the template parts don’t include the outer wrappers.

    frshminds

    looking back, it appears you say above that i can use the “review_view_block one”. i tried that initially w/ no result. i tried:

    ‘hivepress/v1/templates/review_view_block’

    as the hook name.

    in the reference link above, it shows 2 params, w/ $template being the 2nd.
    in uses i’ve seen and in some of my own uses there is only 1 param which is $template.
    so i’m not sure what the discrepancy is.

    frshminds

    nevermind. i figured it out. i had a typo.

Viewing 7 posts - 1 through 7 (of 7 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.