Skip to content

Instantly share code, notes, and snippets.

@solepixel
Created April 27, 2016 20:29
Show Gist options
  • Save solepixel/116b8ceefb87248ebbae2211601b4861 to your computer and use it in GitHub Desktop.
Save solepixel/116b8ceefb87248ebbae2211601b4861 to your computer and use it in GitHub Desktop.
<?php
public function sync_active() {
if( get_transient( 'rets_data_sync_active' ) )
return;
set_transient( 'rets_data_sync_active', 'PAUSE', HOUR_IN_SECONDS * 4 );
global $rets_sync_db;
$rets_sync_db->add_filter( 'field_L_Status', 'Active' );
$listings = $rets_sync_db->get_listings();
$counter = 0;
foreach ( $listings as $listing ) {
wp_queue( new RETS_Sync_Listing_Job( $listing->id ) );
$counter++;
}
$this->processor->dispatch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment