Advertisement
geminilabs

[site-reviews] fix post_id value in Thrive Lightbox

May 31st, 2025 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. /**
  2.  * Get the real Post ID from a Thrive Lightbox.
  3.  *
  4.  * Fixes the assigned_posts="post_id" option when used inside a Thrive Lightbox.
  5.  */
  6. add_filter('site-reviews/assigned_posts/post_id', function ($postId) {
  7.     global $tcb_main_post_lightbox;
  8.     if (!empty($tcb_main_post_lightbox)) {
  9.         return $tcb_main_post_lightbox->ID ?? 0;
  10.     }
  11.     return $postId;
  12. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement