ap_count_users_temp_media( integer $user_id )

Description #

Count temporary attachments of a user.

Parameters #

  • $user_id
    integer (Required) User ID.

Source #

File: includes/upload.php

function ap_count_users_temp_media( $user_id ) {
	global $wpdb;

	$count = $wpdb->get_var( $wpdb->prepare( "SELECT count(*) FROM $wpdb->posts WHERE post_title = '_ap_temp_media' AND post_author=%d AND post_type='attachment'", $user_id ) ); // phpcs:ignore WordPress.DB

	return (int) $count;
}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment