Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Set the assigned_posts value from an URL parameter (?assigned_post=)
- *
- * Example URL:
- * https://domain.com?assigned_post=4
- *
- * Example Shortcode Usage:
- * [site_reviews assigned_posts="post_id"]
- * [site_reviews_form assigned_posts="post_id"]
- * [site_reviews_summary assigned_posts="post_id"]
- *
- * @return int
- */
- add_filter('site-reviews/assigned_posts/post_id', function (int $postId) {
- if ($overridePostId = filter_input(INPUT_GET, 'assigned_post', FILTER_VALIDATE_INT)) {
- return $overridePostId;
- }
- return $postId;
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement