AI Verified

Name

Content Control - Debug Early Loaded Rules Source

About

Allows debugging which plugin/theme/code is causing Content Control rules to be registered too early.

Language

PHP

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

Activate, check a few pages that are having trouble applying proper rules, check the plugin settings page log viewer.

Codevault

Code-Atlantic

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://code-atlantic.com

Snippet Source:

https://contentcontrolplugin.com

History

Last modified:

20/10/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Found 0 vulnerabilities

Content Control - Debug Early Loaded Rules Source

 
                    
1add_action( 'content_control/rule_engine/register_rules', function () {
2 if ( \ContentControl\is_frontend() ) {
3 
4 // Log the stack trace.
5 $backtrace = \debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
6 $trace_string = '';
7 foreach ( $backtrace as $entry ) {
8 $trace_string .= isset( $entry['file'] ) ? $entry['file'] : '-';
9 $trace_string .= ':';
10 $trace_string .= isset( $entry['line'] ) ? $entry['line'] : '-';
11 $trace_string .= ' -> ';
12 $trace_string .= isset( $entry['function'] ) ? $entry['function'] : '-';
13 $trace_string .= PHP_EOL;
14 }
15 
16 \ContentControl\plugin( 'logging' )->log( 'RULES INITIALIZED: \r\n\r\n' . $trace_string );
17 }
18});

0

Related Snippets

Please see some snippets below related to this snippet..

General

AI Verified

0

Migrate BasePress -> BetterDocs: 3. Feedback

Added: 7 months ago

Last Updated: 7 months ago

<p>Use these to migrate data from BasePress to BetterDocs, or clone them and customize to migrate to some other structure.</p> <p>Import all 4 snippets, then run them in order. This will handle docs,...

General

AI Verified

0

Migrate BasePress -> BetterDocs: 2. Analytics

Added: 7 months ago

Last Updated: 7 months ago

<p>Use these to migrate data from BasePress to BetterDocs, or clone them and customize to migrate to some other structure.</p> <p>Import all 4 snippets, then run them in order. This will handle docs,...

General

AI Verified

0

Make Gravity Forms Available to Editor Role

Added: 7 months ago

Last Updated: 7 months ago

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

General

AI Verified

0

Migrate BasePress -> BetterDocs: 2. Analytics

Added: 7 months ago

Last Updated: 7 months ago

<p>Use these to migrate data from BasePress to BetterDocs, or clone them and customize to migrate to some other structure.</p> <p>Import all 4 snippets, then run them in order. This will handle docs,...

General

AI Verified

0

Migrate BasePress -> BetterDocs: 4. Search Logs

Added: 7 months ago

Last Updated: 7 months ago

<p>Use these to migrate data from BasePress to BetterDocs, or clone them and customize to migrate to some other structure.</p> <p>Import all 4 snippets, then run them in order. This will handle docs,...

General

AI Verified

0

Migrate BasePress -> BetterDocs: 3. Feedback

Added: 7 months ago

Last Updated: 7 months ago

<p>Use these to migrate data from BasePress to BetterDocs, or clone them and customize to migrate to some other structure.</p> <p>Import all 4 snippets, then run them in order. This will handle docs,...