Advertisement
geminilabs

[review_form_url post_id=""]

Oct 2nd, 2023
1,486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.28 KB | None | 0 0
  1. /**
  2.  * Registers the [review_form_url post_id=""] shortcode
  3.  */
  4. add_shortcode('review_form_url', function ($atts) {
  5.     $atts = shortcode_atts(['post_id' => 0], $atts);
  6.     $postId = (int) $atts['post_id'];
  7.     return add_query_arg('assigned_post', get_the_ID(), get_permalink($postId));
  8. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement