Constants

BUTTON_CLICKED_IDENTIFIER

BUTTON_CLICKED_IDENTIFIER ='unblock'

SET_VISUAL_PARENT_IF_CLASS_OF_PARENT

SET_VISUAL_PARENT_IF_CLASS_OF_PARENT =array('et_pb_video_box' => 1, 'ast-oembed-container' => 1, 'wpb_video_wrapper' => 1)

If a given class of the `parentElement` is given, set the visual parent. This is needed for some page builder and theme compatibilities. This is only used on client-side (see `findVisualParent`).

DEPENDANT_VISIBILITY_CONTAINERS

DEPENDANT_VISIBILITY_CONTAINERS =array('[role="tabpanel"]', '.eael-tab-content-item', '.wpcs_content_inner', '.op3-contenttoggleitem-content', '.pum-overlay', '[data-elementor-type="popup"]', '.wp-block-ub-content-toggle-accordion-content-wrap', '.w-popup-wrap', '.oxy-lightbox_inner[data-inner-content=true]', '.oxy-pro-accordion_body', '.oxy-tab-content', '.kt-accordion-panel', '.vc_tta-panel-body')

Before trying to create a visual content blocker, check if the node is inside a given container and if it is, wait until this container is visible. For example, you are providing a sidebar with blocked content, you need to pass the selector for this sidebar.

OB_START_PLUGINS_LOADED_PRIORITY

OB_START_PLUGINS_LOADED_PRIORITY =(PHP_INT_MAX - 1) * -1

FORCE_TIME_COMMENT_QUERY_ARG

FORCE_TIME_COMMENT_QUERY_ARG ='rcb-calc-time'

Force to output the needed computing time at the end of the page for debug purposes.

Properties

$processedOutputBufferHtmlHashes

$processedOutputBufferHtmlHashes :

A list of MD5 hashes of HTML strings which got successfully processed. This allows you to run `registerOutputBuffer` multiple times.

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

Get the prefix of this plugin so composer packages can dynamically build other constant values on it.

Returns

string

getHeadlessContentBlocker()

getHeadlessContentBlocker()

Get `HeadlessContentBlocker` instance.

localize()

localize()

Localize available content blockers for frontend.

registerOutputBuffer()

registerOutputBuffer()

Apply the content blocker attributes to the output buffer when it is enabled.

You can start this output buffer multiple times as it is safe to avoid execution of same strings multiple times for the headless content blocker (e.g. multiple WordPress hook lifecycle).

closeOutputBuffer()

closeOutputBuffer()

Close a output buffer. This is not necessarily needed as PHP automatically closes them, but in some cases it is needed to make the modified content available to previously read output buffers in e.g.

earlier WordPress hook lifecycle.

ob_start()

ob_start(string  $response)

Event for ob_start.

Parameters

string $response

replace()

replace(string  $html)

Apply content blockers to a given HTML. It also supports JSON output.

If you want to use this functionality in your plugin, please use the filter Consent/Block/HTML instead!

Parameters

string $html

autoptimize_filter_css_exclude()

autoptimize_filter_css_exclude(string  $exclusions)

Exclude blocked styles from autoptimize inline aggregation.

Parameters

string $exclusions

modifyUrlToSkipContentBlocker()

modifyUrlToSkipContentBlocker(string  $url)

Modify any URL and add a query argument to skip the content blocker mechanism.

Parameters

string $url

modifyOEmbedHtmlToKeepOriginalUrl()

modifyOEmbedHtmlToKeepOriginalUrl(string  $html,string  $url)

Modify the HTML of an oEmbed HTML and keep the original pasted URL as attribute so our headless content blocker can generate an image preview from the original URL.

Parameters

string $html
string $url

instance()

instance()

New instance.

isEnabled()

isEnabled()

Check if content blocker is enabled on the current request.

isCurrentRequestException()

isCurrentRequestException()

Check if the current request should not load any blocking mechanism depending on a special condition.

isAdminAjaxAction()

isAdminAjaxAction()

Allows to modify content within a `admin-ajax.php` action.

__construct()

__construct()

C'tor.