| Server IP : 104.21.28.229 / Your IP : 216.73.216.142 Web Server : Apache/2 System : Linux hosting8537.lvs 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : mienphi ( 1014) PHP Version : 8.2.14 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/mienphi/domains/mienphi.org/public_html/wp-content/plugins/wp-consent-api/ |
Upload File : |
<?php // phpcs:ignore -- Ignore the missing class- prefix from file & "\r\n" notice for some machines.
// Check that the file is not accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
die( 'We\'re sorry, but you can not directly access this file.' );
}
if ( ! class_exists( 'WP_CONSENT_API_CONFIG' ) ) {
/**
* WP_CONSENT_API_CONFIG definition.
*
* @since 1.0.0
*/
class WP_CONSENT_API_CONFIG {
/**
* Instance.
*
* @since 1.0.0
*
* @var WP_CONSENT_API_CONFIG|null
*/
private static $instance;
/**
* Constructor.
*
* @since 1.0.0
*
* @return void
*/
public function __construct() {
if ( isset( self::$instance ) ) {
// translators: %s the name of the PHP Class used.
wp_die( esc_html( sprintf( __( '%s is a singleton class and you cannot create a second instance.', 'wp-consent-api' ), get_class( $this ) ) ) );
}
self::$instance = $this;
}
/**
* Get default filterable list of active consent types.
*
* @since 1.0.0
*
* @return array
*/
public function consent_types() {
return apply_filters(
'wp_consent_types',
array(
'optin',
'optout',
)
);
}
/**
* Get default filterable cookie prefix.
*
* @since 1.0.2
*
* @return string
*/
public function consent_cookie_prefix() {
return apply_filters(
'wp_consent_cookie_prefix',
'wp_consent'
);
}
/**
* Get default filterable list of active consent categories.
*
* @since 1.0.0
*
* @return array
*/
public function consent_categories() {
return apply_filters(
'wp_consent_categories',
array(
'functional',
'preferences',
'statistics',
'statistics-anonymous',
'marketing',
)
);
}
/**
* Get default filterable list of possible consent values.
*
* @since 1.0.0
*
* @return array $consent_values
*/
public function consent_values() {
return apply_filters(
'wp_consent_values',
array(
'allow',
'deny',
)
);
}
/**
* Get default filterable cookie expiration.
*
* @since 1.0.0
*
* @return int Cookie expiration in days.
*/
public function cookie_expiration_days() {
return apply_filters( 'wp_cookie_expiration', 30 ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- This is intended for Core.
}
}
}