• Resolved mbrailer

    (@mbrailer)


    My website uses a function to add buttons for thumbs up/down rating by inserting the button HTML with this filter:

    add_filter('the_content', 'thumbs_rating_print')

    This filter is also adding the rating HTML to the AP Extra Fields items, after the content. It looks like this in the ActivityPub Blog Profile panel:

    https://cutetropolis.com/wp-content/uploads/2025/12/Screenshot-from-2025-12-19-18-37-45.jpg

    I need to modify the thumbs_rating_print function to detect if the post is an Extra Fields item and prevent the buttons from being inserted. I noticed that the post type of Extra Fields items is ap_extrafield_blog but I don’t know how to use this information. Does anyone know what I should do?

    The page I need help with: [log in to see the link]

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

    (@mbrailer)

    Hello, I solved my problem. I added a condition that the button HTML should only be inserted where the condition $post_type == 'post'. This excludes the AP extra field items, which have the different post type.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.