Repository navigation
fix: enforce Allow Template Switching setting on the server - #2157
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
🔨 Build Complete - Ready for Testing!📦 Download Build Artifact (Recommended)Download the zip build, upload to WordPress and test:
🌐 Test in WordPress Playground (Very Experimental)Click the link below to instantly test this PR in your browser - no installation needed! Login credentials: |
Summary
Files
Verification
Notes
Merged via PR #2157 to main. |
Summary
class-site-actions-element.php), so a customer who opened the Template Switching page or called thewu_switch_templatehandler directly could overwrite their site with a template while switching was disabled network-wide.Template_Switching_Element::switch_template()now returns atemplate_switching_disabledJSON error when the setting is off.Template_Switching_Admin_Page::page_loaded()now ends with a 403wp_die()when the setting is off.Files
inc/ui/class-template-switching-element.phpinc/admin-pages/customer-panel/class-template-switching-admin-page.phpVerification
php -lon both files: no syntax errors.vendor/bin/phpcson both files: clean.?page=wu-template-switchingreturns 403 and that POSTingwu-ajaxwu_switch_templatereturns the error. Re-enable the setting and confirm switching still works.Notes
true, matching the existing check in Site Actions.MODE_ASSIGN_TEMPLATEhiding in Site Actions is not enforced here. That is a separate behaviour and is out of scope for this fix.Summary by CodeRabbit