??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/mayshine.co.uk/wp-includes/block-supports/auto-register.php
⬅ Kembali
<?php
/**
* Auto-register block support.
*
* @package WordPress
* @since 7.0.0
*/
/**
* Marks user-defined attributes for auto-generated inspector controls.
*
* This filter runs during block type registration, before the WP_Block_Type
* is instantiated. Block supports add their attributes AFTER the block type
* is created (via {@see WP_Block_Supports::register_attributes()}), so any attributes
* present at this stage are user-defined.
*
* The marker tells generateFieldsFromAttributes() which attributes should
* get auto-generated inspector controls. Attributes are excluded if they:
* - Have a 'source' (HTML-derived, edited inline not via inspector)
* - Have role 'local' (internal state, not user-configurable)
* - Have an unsupported type (only 'string', 'number', 'integer', 'boolean' are supported)
* - Were added by block supports (added after this filter runs)
*
* @since 7.0.0
* @access private
*
* @param array<string, mixed> $args Array of arguments for registering a block type.
* @return array<string, mixed> Modified block type arguments.
*/
function wp_mark_auto_generate_control_attributes( array $args ): array {
if ( empty( $args['attributes'] ) || ! is_array( $args['attributes'] ) ) {
return $args;
}
$has_auto_register = ! empty( $args['supports']['autoRegister'] );
if ( ! $has_auto_register ) {
return $args;
}
foreach ( $args['attributes'] as $attr_key => $attr_schema ) {
// Skip HTML-derived attributes (edited inline, not via inspector).
if ( ! empty( $attr_schema['source'] ) ) {
continue;
}
// Skip internal attributes (not user-configurable).
if ( isset( $attr_schema['role'] ) && 'local' === $attr_schema['role'] ) {
continue;
}
// Skip unsupported types (only 'string', 'number', 'integer', 'boolean' are supported).
$type = $attr_schema['type'] ?? null;
if ( ! in_array( $type, array( 'string', 'number', 'integer', 'boolean' ), true ) ) {
continue;
}
$args['attributes'][ $attr_key ]['autoGenerateControl'] = true;
}
return $args;
}
// Priority 5 to mark original attributes before other filters (priority 10+) might add their own.
add_filter( 'register_block_type_args', 'wp_mark_auto_generate_control_attributes', 5 );
Nama
Tipe
Ukuran
Diubah
Aksi
📄 .htaccess
htaccess
237 B
2026-06-23 08:04
🐘 align.php
php
1.7 KB
2023-08-10 20:48
🐘 anchor.php
php
1.5 KB
2026-05-21 21:28
🐘 aria-label.php
php
1.7 KB
2026-05-21 21:28
🐘 auto-register-statement.php
php
1002 B
2026-05-21 21:28
🐘 auto-register.php
php
2.2 KB
2026-05-21 21:28
🐘 background.php
php
4 KB
2025-12-04 03:46
🐘 block-style-variations.php
php
9.3 KB
2026-05-21 21:28
🐘 block-visibility.php
php
5.2 KB
2026-05-21 21:28
🐘 border.php
php
6.1 KB
2026-05-21 21:28
🐘 colors.php
php
5.4 KB
2026-05-21 21:28
🐘 custom-classname.php
php
1.6 KB
2023-08-10 20:48
🐘 custom-css.php
php
9.4 KB
2026-05-21 21:28
🐘 dimensions.php
php
5.2 KB
2026-05-21 21:28
🐘 duotone.php
php
2.7 KB
2024-06-04 05:48
🐘 elements.php
php
8.2 KB
2026-05-21 21:28
📄 error_log
file
35.9 KB
2026-06-17 02:32
🐘 generated-classname.php
php
1.7 KB
2023-08-10 20:48
🐘 layout.php
php
42.3 KB
2026-05-21 21:28
🐘 position.php
php
4 KB
2026-05-21 21:28
🐘 settings.php
php
4.4 KB
2026-05-21 21:28
🐘 shadow.php
php
2 KB
2024-06-04 03:36
🐘 spacing.php
php
2.7 KB
2026-05-21 21:28
🐘 typography.php
php
27.7 KB
2026-05-21 21:28
🐘 utils.php
php
1011 B
2023-08-18 21:29