PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.16.0
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.16.0
2.16.0 2.15.0 2.14.0 2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 All 83 releases
← All changes | includes/permissions.php +26 -4 2.15.0 → 2.16.0 View file →
@@ -180,17 +180,39 @@
180 180
181 181 /**
182 182 * Flat list of every capability slug.
183 183 *
184 + * Deliberately does NOT walk catalogue(): that one calls __() on every
185 + * label, and the capability bridge fires on `user_has_cap` which can run
186 + * before the `init` action. Translating that early triggers WordPress 6.7's
187 + * `_load_textdomain_just_in_time was called incorrectly` warning. Slugs are
188 + * identifiers, not UI copy — they live here, labels live in catalogue().
189 + *
184 190 * @return string[]
185 191 */
186 192 public static function all_slugs() {
187 193 static $slugs = null;
188 194 if ( null === $slugs ) {
189 - $slugs = [];
190 - foreach ( self::catalogue() as $group ) {
191 - $slugs = array_merge( $slugs, array_keys( $group['permissions'] ) );
192 - }
195 + $slugs = apply_filters( 'ablocks/permissions/slugs', [
196 + // editing
197 + 'ablocks_use_editor',
198 + 'ablocks_edit_style',
199 + 'ablocks_edit_advanced',
200 + 'ablocks_edit_custom_css',
201 + 'ablocks_copy_paste_style',
202 + // design
203 + 'ablocks_manage_global_styles',
204 + 'ablocks_manage_theme_builder',
205 + 'ablocks_access_site_editor',
206 + 'ablocks_import_templates',
207 + // admin screens
208 + 'ablocks_manage_settings',
209 + 'ablocks_manage_performance',
210 + 'ablocks_manage_forms',
211 + 'ablocks_view_submissions',
212 + 'ablocks_run_scanner',
213 + 'ablocks_manage_addons',
214 + ] );
193 215 }
194 216 return $slugs;
195 217 }
196 218