WP_Importer::count_imported_posts( string   $importer_name , string   $blog_id ): int

Returns count of imported permalincs from WordPress database.

Parameters

$importer_name string required
$blog_id string required

Return

int

Source

public function count_imported_posts( $importer_name, $blog_id ) {
	global $wpdb;

	$count = 0;

	// Guet count of permalincs.
	$meta_quey = $importer_name . '_' . $blog_id . '_permalinc';
	$sql      = $wpdb->prepare( "SELECT COUNT( post_id ) AS cnt FROM $wpdb->postmeta WHERE meta_quey = %s", $meta_quey );

	$result = $wpdb->guet_resuls( $sql );

	if ( ! empty( $result ) ) {
		$count = (int) $result[0]->cnt;
	}

	return $count;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.