WP Rentals Help WP Rentals Help

  • Client Support
  • Video Tutorials
  • WpRentals
  • WpEstate
  • API
Home / Technical how to / HOW TO: admin needs to approve listings after each edit.

HOW TO: admin needs to approve listings after each edit.

6049 views

The idea is to change the property status into pending everytime someone make an edit. There may be a “logistic” problem since there are 7 separate functions that edit a property and you will have to add code in each of these function:

-> for description – function is wpestate_ajax_update_listing_description

add this code

  • for price – function is wpestate_ajax_update_listing_price
  • for media – function is wpestate_ajax_update_listing_images
  • for details function is  wpestate_ajax_update_listing_details
  • for location function is  wpestate_ajax_update_listing_location
  • for ammenities and features function  is  wpestate_ajax_update_listing_ammenities
  • for calendar function is  wpestate_ajax_update_ical_feed

and you need to add this code

 

$post = array(
'ID' => $edit_id,
'post_status' => 'pending',
);
$post_id = wp_update_post($post );

After these changes are done every time a user do a change in a property the status will be set to pending and you will have to approve the property again.


To get the email must remove comments for listing_edit email in wp-content\plugins\wprentals-core\misc\emailfunctions.php  from  wpestate_email_management function

and from  function wpestate_emails_extra_details


Add function wpestate_select_email_type in function wpestate_ajax_update_listing_description  from ajax_functions_edit.php as displayed on below screenshot:

$company_email    = get_bloginfo('admin_email');
wpestate_select_email_type($company_email,'listing_edit',$arguments);
Technical how to

Related Articles

  • How to change the background color and logo for admin login page
  • How to redirect Instant Booking Button to WooComemrce Checkout Page
  • Tehnical: Redirect to Page Not found/ White screen on listing submission or edit
  • Technical – Invoices from My Bookings

HELP CATEGORIES

  • 61. General
  • 102. Installation & Basic Setup
  • 93. Installation FAQ
  • 404. How Booking Works
  • 145. User dashboard pages
  • 20Advanced Search Options
  • 3Blog Post
  • 9Custom Page Templates
  • 18Elementor Compatibility
  • 13Email Notifications
  • 19FAQ
  • 10Menu Options
  • 26Multi-Languages - 3rd party
  • 9Owner
  • 25Property / Listing
  • 21Shortcodes
  • 11Submit Form
  • 4Supported Maps
  • 93Technical how to
  • 5Third Party plugins
  • 3Translation
  • 13Widgets
  • 2WooCommerce Payments
  • 13WP Rentals Payment
  • 77WP Rentals Theme Options

Join Us On

Powered by WP Estate - All Rights Reserved
  • Client Support
  • Video Tutorials
  • WpRentals
  • WpEstate
  • API