Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Enable the Custom Fields metabox for reviews
- * @return void
- */
- add_action('admin_init', function () {
- add_post_type_support('site-review', 'custom-fields');
- });
- /**
- * Save the terms value to the review as meta data
- * @param \GeminiLabs\SiteReviews\Review $review
- * @param \GeminiLabs\SiteReviews\Commands\CreateReview $command
- * @return void
- */
- add_action('site-reviews/review/created', function ($review, $command) {
- if (wp_validate_boolean($command->request->terms)) {
- update_post_meta($review->ID, 'terms_accepted', true);
- }
- }, 10, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement