HEX
Server: Apache
System: Linux nc-ph-4101.simplemoneygoals.com 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64
User: dailygoldindex (1004)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: /home/dailygoldindex/public_html/wp-content/themes/jnews/class/Customizer/sections/global_cpt.php
<?php

$options = [];

$post_types = JNews\Util\Cache::get_exclude_post_type();

unset( $post_types['post'] );
unset( $post_types['page'] );

if ( ! empty( $post_types ) && is_array( $post_types ) ) {

	foreach ( $post_types as $key => $label ) {

		$options[] = [
			'id'          => 'jnews_enable_cpt_' . $key . ']',
			'transport'   => 'postMessage',
			'default'     => true,
			'type'        => 'jnews-toggle',
			'label'       => sprintf( esc_html__( 'Enable %s Post Type', 'jnews' ), $label ),
			'description' => sprintf( esc_html__( 'Enable %s post type and their custom taxonomy as content filter.', 'jnews' ), strtolower( $label ) ),
		];
	}

} else {
	$options[] = [
		'id'          => 'jnews_enable_post_type_alert',
		'type'        => 'jeg-alert',
		'default'     => 'info',
		'label'       => esc_html__( 'Notice', 'jnews' ),
		'description' => esc_html__( 'There\'s no custom post type found.', 'jnews' ),
	];
}

return $options;