Noptin_Background_Sync::get_unsynced_user()

Fetches an unsynced WordPress User.


Return Return

(int;)


Top ↑

Source Source

File: includes/class-noptin-background-sync.php

	public function get_unsynced_user() {

		// For buddypress and co, do not sync inactive users.
		add_action( 'pre_user_query', array( $this, 'filter_user_query' ) );

		$user = get_users(
			array(
				'meta_key'	    => 'noptin_subscriber_id',
				'meta_compare'  => 'NOT EXISTS',
				'number'        => 1,
				'fields'        => 'ID',
			)
		);

		// For buddypress and co, do not sync inactive users.
		remove_action( 'pre_user_query', array( $this, 'filter_user_query' ) );

		if( empty( $user ) ) {
			return 0;
		}

		return $user[0];

	}


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation