A brand-new shortcode or hook registered in one snippet silently fails to work – no PHP error, no fatal, it just never fires – while a completely unrelated “Run Everywhere” snippet happens to be active elsewhere on the site.
A WPCode “Run Everywhere” Snippet Can Silently Block Another Snippet’s Shortcode Registration
⚡ Quick Fix (TL;DR)
The Culprit: Confirmed directly by WPCode's own support team as a real platform-level bug: certain "Run Everywhere" PHP snippets can interfere with the combined execution of other snippets, preventing later-registered hooks like add_shortcode() from ever firing. This was the actual cause of a months-long, previously unresolved "reactivating a fully-fixed file still breaks the site" mystery on this exact site – found only after extensive bisection eventually pointed at snippet interference itself, not any single snippet's own code.
The Fix: Two working fixes. Quick workaround: set the affected snippet's priority to 1 in WPCode's own settings. The permanent fix: convert the snippet to a standalone WordPress plugin file (a simple zip with a proper plugin header) instead of running it through WPCode at all – this removed the interference entirely once tested.
<?php
/**
* Plugin Name: Your Snippet Name
* Description: Converted from a WPCode snippet to sidestep
* Run-Everywhere execution-order interference with other snippets.
* Version: 1.0
*/
// paste the snippet's existing code below, unchangedTagged in :