\DevOwl\RealCookieBanner\scannerOnChangeDetection

Automatically detect changes to pages and posts, or CPT's and scan them again.

Summary

Methods
Properties
Constants
getPluginConstantPrefix()
__construct()
save_post()
post_updated()
delete_post()
wp_trash_post()
No public properties found
USE_PREVIEW_LINK_FOR_POST_TYPE
SKIP_POST_TYPE
fromPost()
getPermalink()
addUrlToScanner()
No protected properties found
N/A
No private methods found
$scanner
N/A

Constants

USE_PREVIEW_LINK_FOR_POST_TYPE

USE_PREVIEW_LINK_FOR_POST_TYPE =array('seedprod')

In some cases, custom post types are used in "Draft"-always state or private, so let's use the preview URL (`?preview=true`) instead of the permalink URL.

SKIP_POST_TYPE

SKIP_POST_TYPE =array()

In some cases it does not make sense to scan viewable post types as they act e.g. as "template" posts which are reused in publicly available posts and pages.

E.g. elementor_library still needs to be scanned as the post type is resused in Elementor pages and they do not get automatically scanned. In a perfect world, when elementor_library got changed, it needs to add all URLs of the posts which uses it.

Properties

$scanner

$scanner :

Type

Methods

getPluginConstantPrefix()

getPluginConstantPrefix(): string

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

Returns

string

save_post()

save_post(integer  $post_id,\WP_Post  $post)

A post got updated or created, add it to our queue.

Parameters

integer $post_id
\WP_Post $post

post_updated()

post_updated(integer  $post_id,\WP_Post  $post_after,\WP_Post  $post_before)

The `post_updated` hook is fired before `save_post` so we can identify if the slug has been changed (parent or slug).

Parameters

integer $post_id
\WP_Post $post_after
\WP_Post $post_before

delete_post()

delete_post(integer  $post_id)

A post got deleted. Remove the URL from the scan results.

Parameters

integer $post_id

wp_trash_post()

wp_trash_post(integer  $post_id)

A post got moved to the trash. Remove the URL from the scan results.

Parameters

integer $post_id

fromPost()

fromPost(\WP_Post  $post)

Check if the post can be queried publicly and add it to our queue.

Parameters

\WP_Post $post

getPermalink()

getPermalink(\WP_Post  $post)

Get permalink to a given post which can be inserted to the scanner.

Parameters

\WP_Post $post

addUrlToScanner()

addUrlToScanner(string  $url)

Add a changed permalink URL to the scanner queue. It also respects multilingual websites and adds all language translations to the scanner queue (e.g. `/de/my-post` and `/en/my-post`).

Parameters

string $url