Advertisement
geminilabs

Untitled

Nov 16th, 2022 (edited)
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. /**
  2.  * Paste this in your active theme's functions.php file.
  3.  * @param \GeminiLabs\SiteReviews\Request $request
  4.  * @return void
  5.  */
  6. add_action('site-reviews/review/request', function ($request) {
  7.     // This assumes that "surcharge" is the field name of the custom field.
  8.     if ('Yes' === $request->get('surcharge')) {
  9.         $request->set('assigned_posts', '13'); // Site Reviews category ID
  10.     }
  11.     if ('No' === $request->get('surcharge')) {
  12.         $request->set('assigned_posts', '14'); // Site Reviews category ID
  13.     }
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement