-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Labels
supportGeneral question or request for helpGeneral question or request for help
Description
Current behavior
Trashing a network snippet in Multisite activates it regardless of its previous state. The Trash functions as a hidden 'enabled snippets' list, which is counterintuitive and potentially dangerous.
Steps to reproduce
- Open this WordPress Playground with Multisite: WordPress Playground
- Add the following test code:
add_action('wp_footer', 'snippet_active_banner'); add_action('admin_footer', 'snippet_active_banner'); function snippet_active_banner() { echo '<div style="position:fixed;bottom:0;left:0;right:0;background:#4caf50;color:#fff;text-align:center;padding:10px;font-weight:600;z-index:999999;">✓ This Code Snippet is active!</div>'; }
- Click Save and Activate, navigate back to All Snippets → green banner appears
- Deactivate the snippet → green banner disappears
- Trash the deactivated snippet
Bug
- Green banner reappears → trashing has activated the snippet
- Trashing an inactive snippet → becomes active until deleted from Trash
- Trashing an active snippet → remains active until deleted from Trash
Observations
- Expected: Trashing should deactivate a snippet. Trashed snippets should never execute.
- Actual: Trashing activates the snippet. All trashed snippets execute their code.
Additional context
- This exact snippet breaks the site with:
Fatal error: Cannot redeclare snippet_active_banner()when tested on multisite and with file-based execution enabled. - The trash to activate behavioral glitch is not present with file-based execution enabled.
- Expected:
- Snippet to work normally with and without file-based execution
- Trashing a snippet must not reactivate it in any scenario
- Confirmed, but present only on multisite
Reference
Metadata
Metadata
Assignees
Labels
supportGeneral question or request for helpGeneral question or request for help