da_r_get_contents_by_reaction

Location:

DaReactions\Data::getContentsByReaction

Filters the result of retrieving content items for a specific reaction.

Parameters:

  • $result  (array): The content data.
  • $item_type  (string): The type of the items (e.g., 'post', 'comment').
  • $reaction_id  (int|string): The ID of the reaction.
  • $limit  (int): The maximum number of results.

Example:

add_filter('da_r_get_contents_by_reaction', function($result, $item_type, $reaction_id, $limit) {
    return array_filter($result, function($item) use ($item_type) {
        return $item['type'] === $item_type;
    });
}, 10, 4);

Use Case:

Customize or limit the content returned based on reaction.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us