WP PHP Получите номер строк от MySQL

function get_number_of_db_rows($table_name)
{
    global $wpdb;
    $count_query = "select count(*) from $table_name";
    $num = $wpdb->get_var($count_query);
    return $num;
}
ahmad-ali14