Blocker
in package
implements
IOverrideBlocker
Uses
UtilsProvider, Blocker
Register content blocker custom post type.
Table of Contents
Interfaces
Constants
- CPT_NAME = 'rcb-blocker'
- META_KEYS = [\DevOwl\RealCookieBanner\settings\Blocker::META_NAME_RULES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_CRITERIA, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_VENDORS, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_PURPOSES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SERVICES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_MEDIA_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_CONTENT_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL_DARK_MODE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_BLUR, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_DOWNLOAD_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_HERO_BUTTON_TEXT, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_PRESET_ID]
- META_NAME_CRITERIA = 'criteria'
- META_NAME_IS_VISUAL = 'isVisual'
- META_NAME_IS_VISUAL_DARK_MODE = 'isVisualDarkMode'
- META_NAME_PRESET_ID = 'presetId'
- META_NAME_PRESET_VERSION = 'presetVersion'
- META_NAME_RULES = 'rules'
- META_NAME_SERVICES = 'services'
- META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL = 'shouldForceToShowVisual'
- META_NAME_TCF_PURPOSES = 'tcfPurposes'
- META_NAME_TCF_VENDORS = 'tcfVendors'
- META_NAME_VISUAL_BLUR = 'visualBlur'
- META_NAME_VISUAL_CONTENT_TYPE = 'visualContentType'
- META_NAME_VISUAL_DOWNLOAD_THUMBNAIL = 'visualDownloadThumbnail'
- META_NAME_VISUAL_HERO_BUTTON_TEXT = 'visualHeroButtonText'
- META_NAME_VISUAL_MEDIA_THUMBNAIL = 'visualMediaThumbnail'
- META_NAME_VISUAL_TYPE = 'visualType'
- SYNC_OPTIONS = ['meta' => ['copy' => \DevOwl\RealCookieBanner\settings\Blocker::SYNC_OPTIONS_COPY, 'copy-once' => \DevOwl\RealCookieBanner\settings\Blocker::SYNC_OPTIONS_COPY_ONCE]]
- SYNC_OPTIONS_COPY = [\DevOwl\RealCookieBanner\settings\Blocker::META_NAME_RULES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_CRITERIA, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_VENDORS, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_PURPOSES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SERVICES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_MEDIA_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_CONTENT_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL_DARK_MODE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_BLUR, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_DOWNLOAD_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_PRESET_ID, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_PRESET_VERSION]
- SYNC_OPTIONS_COPY_ONCE = [\DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_HERO_BUTTON_TEXT]
Properties
- $cacheGetOrdered : mixed
- $me : Blocker
- Singleton instance.
Methods
- deleted_post() : mixed
- A cookie got deleted, also delete all associations from content blocker.
- getAllCount() : int
- Get a total count of all blockers.
- getInstance() : mixed
- Get singleton instance.
- getOrdered() : array<string|int, WP_Post>|WP_Error
- Get all available content blocker ordered.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- overrideGetOrderedCastMeta() : mixed
- Documented in IOverrideBlocker.
- register() : mixed
- Register custom post type.
- save_post() : mixed
- A blocker was saved.
- toJson() : mixed
- Localize available content blockers for frontend.
- __construct() : mixed
- C'tor.
Constants
CPT_NAME
public
mixed
CPT_NAME
= 'rcb-blocker'
META_KEYS
public
mixed
META_KEYS
= [\DevOwl\RealCookieBanner\settings\Blocker::META_NAME_RULES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_CRITERIA, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_VENDORS, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_PURPOSES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SERVICES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_MEDIA_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_CONTENT_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL_DARK_MODE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_BLUR, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_DOWNLOAD_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_HERO_BUTTON_TEXT, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_PRESET_ID]
META_NAME_CRITERIA
public
mixed
META_NAME_CRITERIA
= 'criteria'
META_NAME_IS_VISUAL
public
mixed
META_NAME_IS_VISUAL
= 'isVisual'
META_NAME_IS_VISUAL_DARK_MODE
public
mixed
META_NAME_IS_VISUAL_DARK_MODE
= 'isVisualDarkMode'
META_NAME_PRESET_ID
public
mixed
META_NAME_PRESET_ID
= 'presetId'
META_NAME_PRESET_VERSION
public
mixed
META_NAME_PRESET_VERSION
= 'presetVersion'
META_NAME_RULES
public
mixed
META_NAME_RULES
= 'rules'
META_NAME_SERVICES
public
mixed
META_NAME_SERVICES
= 'services'
META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL
public
mixed
META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL
= 'shouldForceToShowVisual'
META_NAME_TCF_PURPOSES
public
mixed
META_NAME_TCF_PURPOSES
= 'tcfPurposes'
META_NAME_TCF_VENDORS
public
mixed
META_NAME_TCF_VENDORS
= 'tcfVendors'
META_NAME_VISUAL_BLUR
public
mixed
META_NAME_VISUAL_BLUR
= 'visualBlur'
META_NAME_VISUAL_CONTENT_TYPE
public
mixed
META_NAME_VISUAL_CONTENT_TYPE
= 'visualContentType'
META_NAME_VISUAL_DOWNLOAD_THUMBNAIL
public
mixed
META_NAME_VISUAL_DOWNLOAD_THUMBNAIL
= 'visualDownloadThumbnail'
META_NAME_VISUAL_HERO_BUTTON_TEXT
public
mixed
META_NAME_VISUAL_HERO_BUTTON_TEXT
= 'visualHeroButtonText'
META_NAME_VISUAL_MEDIA_THUMBNAIL
public
mixed
META_NAME_VISUAL_MEDIA_THUMBNAIL
= 'visualMediaThumbnail'
META_NAME_VISUAL_TYPE
public
mixed
META_NAME_VISUAL_TYPE
= 'visualType'
SYNC_OPTIONS
public
mixed
SYNC_OPTIONS
= ['meta' => ['copy' => \DevOwl\RealCookieBanner\settings\Blocker::SYNC_OPTIONS_COPY, 'copy-once' => \DevOwl\RealCookieBanner\settings\Blocker::SYNC_OPTIONS_COPY_ONCE]]
SYNC_OPTIONS_COPY
public
mixed
SYNC_OPTIONS_COPY
= [\DevOwl\RealCookieBanner\settings\Blocker::META_NAME_RULES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_CRITERIA, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_VENDORS, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_TCF_PURPOSES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SERVICES, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_MEDIA_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_CONTENT_TYPE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_IS_VISUAL_DARK_MODE, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_BLUR, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_DOWNLOAD_THUMBNAIL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_SHOULD_FORCE_TO_SHOW_VISUAL, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_PRESET_ID, \DevOwl\RealCookieBanner\settings\Blocker::META_NAME_PRESET_VERSION]
SYNC_OPTIONS_COPY_ONCE
public
mixed
SYNC_OPTIONS_COPY_ONCE
= [\DevOwl\RealCookieBanner\settings\Blocker::META_NAME_VISUAL_HERO_BUTTON_TEXT]
Properties
$cacheGetOrdered
private
mixed
$cacheGetOrdered
= []
$me
Singleton instance.
private
static Blocker
$me
= null
Methods
deleted_post()
A cookie got deleted, also delete all associations from content blocker.
public
deleted_post(int $postId) : mixed
Parameters
- $postId : int
getAllCount()
Get a total count of all blockers.
public
getAllCount() : int
Return values
intgetInstance()
Get singleton instance.
public
static getInstance() : mixed
Tags
getOrdered()
Get all available content blocker ordered.
public
getOrdered([bool $force = false ][, array<string|int, WP_Post> $usePosts = null ]) : array<string|int, WP_Post>|WP_Error
Parameters
- $force : bool = false
- $usePosts : array<string|int, WP_Post> = null
-
If set, only meta is applied to the passed posts
Return values
array<string|int, WP_Post>|WP_ErrorgetPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringoverrideGetOrderedCastMeta()
Documented in IOverrideBlocker.
public
overrideGetOrderedCastMeta(WP_Post $post, array<string|int, mixed> &$meta) : mixed
Parameters
- $post : WP_Post
- $meta : array<string|int, mixed>
register()
Register custom post type.
public
register() : mixed
save_post()
A blocker was saved.
public
save_post(int $post_ID, WP_Post $post, bool $update) : mixed
Parameters
- $post_ID : int
- $post : WP_Post
- $update : bool
toJson()
Localize available content blockers for frontend.
public
toJson() : mixed
__construct()
C'tor.
private
__construct() : mixed