wordpress/wp-content/themes/basic/themify/themify-builder/classes/class-builder-data-manager.php
/**
	 * Init background process the static content updater.
	 */
Init background process the static content updater.
Init background process the static content updater .
public static function init_static_content_updater() {
		if ( ! empty( $_GET['do_update_themify_builder_static_content'] ) ) {
			global $wpdb;
			$post_types = array();
			foreach( themify_post_types() as $type ) {
				$post_types[] = "'" . $type . "'";
			}
			$last_id = 0;
 			self::$static_content_process = new Themify_Builder_Static_Content_Updater();
			do {
				$sql = "SELECT $wpdb->posts.ID 
					FROM $wpdb->posts, $wpdb->postmeta 
					WHERE $wpdb->posts.ID > ". $last_id ."
					AND $wpdb->posts.ID = $wpdb->postmeta.post_id 
					AND $wpdb->postmeta.meta_key = '" . self::$meta_key . "' 
					AND $wpdb->posts.post_status = 'publish' 
					AND post_type IN (" . implode( ',', $post_types ) .") 
					ORDER BY ID ASC 
					LIMIT 10";
				$posts = $wpdb->get_results( $sql );
				foreach ( $posts as $post ) {
					self::$static_content_process->push_to_queue( $post->ID );
					$last_id = $post->ID;
				}
			} while ( ! empty( $posts ) );
			self::$static_content_process->save()->dispatch();
		}
	}
public static function init_static_content_updater ( ) { if ( ! empty ( $ _GET [ 'do_update_themify_builder_static_content' ] ) ) { global $ wpdb ; $ post_types = array ( ) ; foreach ( themify_post_types ( ) as $ type ) { $ post_types [ ] = " ' " . $ type . " ' " ; } $ last_id = 0 ; self :: $ static_content_process = new Themify_Builder_Static_Content_Updater ( ) ; do { $ sql = " SELECT  $ wpdb -> posts .ID 
					FROM  $ wpdb -> posts ,  $ wpdb -> postmeta  
					WHERE  $ wpdb -> posts .ID >  " . $ last_id . " 
					AND  $ wpdb -> posts .ID =  $ wpdb -> postmeta .post_id 
					AND  $ wpdb -> postmeta .meta_key = ' " . self :: $ meta_key . " ' 
					AND  $ wpdb -> posts .post_status = 'publish' 
					AND post_type IN ( " . implode ( ',' , $ post_types ) . " ) 
					ORDER BY ID ASC 
					LIMIT 10 " ; $ posts = $ wpdb -> get_results ( $ sql ) ; foreach ( $ posts as $ post ) { self :: $ static_content_process -> push_to_queue ( $ post -> ID ) ; $ last_id = $ post -> ID ; } } while ( ! empty ( $ posts ) ) ; self :: $ static_content_process -> save ( ) -> dispatch ( ) ; } }
Init background process the static content updater.
Init background process the static content updater .
// get all posts // Do it until we have no more records