• Resolved wizy80

    (@wizy80)


    How can I hide the title (no title) from untitled reviews?
    Currently I can either hide all titles from reviews, or always list the titles.
    But it’s not nice to show reviews with “no-title” written on them.
    Is there a way to ensure that when the title is not there it is not shown on the screen?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wizy80

    (@wizy80)

    any solution?

    Plugin Author Gemini Labs

    (@geminilabs)

    A better solution might be to set the title field as required in the settings so that you don’t end up with empty review titles. Either that, or use the hide option to hide the title field in the shortcodes/blocks/etc.

    Otherwise, this code snippet should do the trick:

    add_filter('site-reviews/review/value/title', function ($value, $tag) {
        if ('' === $tag->review->title) {
            return '';
        }
        return $value;
    }, 10, 2);
    Thread Starter wizy80

    (@wizy80)

    @geminilabs

    perfect thanks! it was what I was looking for

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I hide the title (no title) from untitled reviews?’ is closed to new replies.