wordpress/wp-content/themes/basic/themify/themify-import-functions.php
/**
	 * Determine if a post exists based on title, content, and date
	 *
	 * @global wpdb $wpdb WordPress database abstraction object.
	 *
	 * @param array $args array of database parameters to check
	 * @return int Post ID if post exists, 0 otherwise.
	 */
Determine if a post exists based on title, content, and date
@global wpdb $wpdb WordPress database abstraction object.

@param array $args array of database parameters to check
@return int Post ID if post exists, 0 otherwise.
Determine if a post exists based on title content and date @global wpdb $wpdb WordPress database abstraction object . @param array $args array of database parameters to check @return int Post ID if post exists 0 otherwise .
public static function post_exists( $args = array() ) {
		global $wpdb;
		$query = "SELECT ID FROM $wpdb->posts WHERE 1=1";
		$db_args = array();
		foreach ( $args as $key => $value ) {
			$value = wp_unslash( sanitize_post_field( $key, $value, 0, 'db' ) );
			if( ! empty( $value ) ) {
				$query .= ' AND ' . $key . ' = %s';
				$db_args[] = $value;
			}
		}
		if ( !empty ( $args ) )
			return (int) $wpdb->get_var( $wpdb->prepare($query, $args) );
		return 0;
	}
public static function post_exists ( $ args = array ( ) ) { global $ wpdb ; $ query = " SELECT ID FROM  $ wpdb -> posts  WHERE 1=1 " ; $ db_args = array ( ) ; foreach ( $ args as $ key => $ value ) { $ value = wp_unslash ( sanitize_post_field ( $ key , $ value , 0 , 'db' ) ) ; if ( ! empty ( $ value ) ) { $ query .= ' AND ' . $ key . ' = %s' ; $ db_args [ ] = $ value ; } } if ( ! empty ( $ args ) ) return ( int ) $ wpdb -> get_var ( $ wpdb -> prepare ( $ query , $ args ) ) ; return 0 ; }
Determine if a post exists based on title, content, and date
 @global wpdb $wpdb WordPress database abstraction object.
Determine if a post exists based on title content and date @global wpdb $wpdb WordPress database abstraction object .