HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dwauav0tm6jp/hosted/joshcross_me/wp-content/plugins/top-10/includes/modules/exclusions.php
<?php
/**
 * Exclusion modules
 *
 * @package Top_Ten
 */

/**
 * Function to filter exclude post IDs.
 *
 * @since   2.2.0
 *
 * @param   array $exclude_post_ids   Original excluded post IDs.
 * @return  array   Updated excluded post ID
 */
function tptn_exclude_post_ids( $exclude_post_ids ) {
	global $wpdb;

	$exclude_post_ids = (array) $exclude_post_ids;

	$tptn_post_metas = $wpdb->get_results( "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE `meta_key` = 'tptn_post_meta'", ARRAY_A ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared

	foreach ( $tptn_post_metas as $tptn_post_meta ) {
		$meta_value = maybe_unserialize( $tptn_post_meta['meta_value'] );

		if ( $meta_value['exclude_this_post'] ) {
			$exclude_post_ids[] = $tptn_post_meta['post_id'];
		}
	}
	return $exclude_post_ids;

}
add_filter( 'tptn_exclude_post_ids', 'tptn_exclude_post_ids' );