Skip to content

fix: tighten snippet capability checks - #621

Merged
sheabunge merged 3 commits into
core-betafrom
fix/snippet-capability-checks/core
Nov 2, 2026
Merged

sheabunge merged 3 commits into
core-betafrom
fix/snippet-capability-checks/core

Conversation

@lightbulbman

@lightbulbman lightbulbman commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Tightens capability checks on the snippet import routes for multisite network imports.
  • Tightens capability checks on the snippet source shortcodes.
  • Adds a code_snippets/shortcode_can_render_source filter.
  • Adds changelog entries crediting Artus KG and Het Kalariya.

Testing

  • New and updated PHPUnit tests for the import routes and shortcodes, run on single site and multisite.
  • npm run test:php and npm run lint:php show no new failures.

@lightbulbman lightbulbman changed the title fix: enforce snippet capabilities on import routes and source shortcodes fix: tighten snippet capability checks Oct 29, 2026
@lightbulbman lightbulbman added the run-tests Trigger automated tests label Oct 29, 2026
}

if ( is_string( $network ) ) {
return ! in_array( strtolower( $network ), [ '0', 'false', 'no', '' ], true );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use filter_var( $network, FILTER_VALIDATE_BOOLEAN ) here for something a little more idiomatic.

@sheabunge
sheabunge merged commit 30ccde6 into core-beta Nov 2, 2026
34 checks passed
@sheabunge
sheabunge deleted the fix/snippet-capability-checks/core branch November 2, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants