From ffcb3b5b25bb84647e49ae224df827e763e725c6 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 31 Aug 2026 11:54:55 -0500 Subject: [PATCH] Pattern directory: scope front-end pattern capabilities to the creator UI The front-end capability grant in set_pattern_caps() is intended for the REST-based creator UI, which validates submissions on rest_pre_insert. Return the caps unchanged for XML-RPC requests so they are not provisioned outside that path. Co-Authored-By: Claude Fable 5 --- .../plugins/pattern-directory/includes/pattern-post-type.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public_html/wp-content/plugins/pattern-directory/includes/pattern-post-type.php b/public_html/wp-content/plugins/pattern-directory/includes/pattern-post-type.php index c0a44ec5..671f7f83 100644 --- a/public_html/wp-content/plugins/pattern-directory/includes/pattern-post-type.php +++ b/public_html/wp-content/plugins/pattern-directory/includes/pattern-post-type.php @@ -890,6 +890,10 @@ function get_block_pattern( $post ) { * @return array */ function set_pattern_caps( $user_caps ) { + if ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { + return $user_caps; + } + // Set corresponding caps for all roles. $cap_args = array( 'capability_type' => array( 'pattern', 'patterns' ),