@@ -45,7 +45,7 @@ function plvt_get_view_transition_animation_labels(): array {
45
45
* @since 1.0.0
46
46
* @see plvt_sanitize_view_transitions_theme_support()
47
47
*
48
- * @return array{ default_transition_animation: non-empty-string, header_selector: non-empty-string, main_selector: non-empty-string, post_title_selector: non-empty-string, post_thumbnail_selector: non-empty-string, post_content_selector: non-empty-string, admin_transition_animation : bool } {
48
+ * @return array{ default_transition_animation: non-empty-string, header_selector: non-empty-string, main_selector: non-empty-string, post_title_selector: non-empty-string, post_thumbnail_selector: non-empty-string, post_content_selector: non-empty-string, enable_admin_transitions : bool } {
49
49
* Default setting value.
50
50
*
51
51
* @type string $default_transition_animation Default view transition animation.
@@ -54,7 +54,7 @@ function plvt_get_view_transition_animation_labels(): array {
54
54
* @type string $post_title_selector CSS selector for the post title element.
55
55
* @type string $post_thumbnail_selector CSS selector for the post thumbnail element.
56
56
* @type string $post_content_selector CSS selector for the post content element.
57
- * @type bool $admin_transition_animation Whether to use view transitions in the admin area.
57
+ * @type bool $enable_admin_transitions Whether to use view transitions in the admin area.
58
58
* }
59
59
*/
60
60
function plvt_get_setting_default (): array {
@@ -65,7 +65,7 @@ function plvt_get_setting_default(): array {
65
65
'post_title_selector ' => '.wp-block-post-title, .entry-title ' ,
66
66
'post_thumbnail_selector ' => '.wp-post-image ' ,
67
67
'post_content_selector ' => '.wp-block-post-content, .entry-content ' ,
68
- 'admin_transition_animation ' => false ,
68
+ 'enable_admin_transitions ' => false ,
69
69
);
70
70
}
71
71
@@ -74,7 +74,7 @@ function plvt_get_setting_default(): array {
74
74
*
75
75
* @since 1.0.0
76
76
*
77
- * @return array{ default_transition_animation: non-empty-string, header_selector: non-empty-string, main_selector: non-empty-string, post_title_selector: non-empty-string, post_thumbnail_selector: non-empty-string, post_content_selector: non-empty-string, admin_transition_animation : bool|non-empty-string } {
77
+ * @return array{ default_transition_animation: non-empty-string, header_selector: non-empty-string, main_selector: non-empty-string, post_title_selector: non-empty-string, post_thumbnail_selector: non-empty-string, post_content_selector: non-empty-string, enable_admin_transitions : bool|non-empty-string } {
78
78
* Stored setting value.
79
79
*
80
80
* @type string $default_transition_animation Default view transition animation.
@@ -83,7 +83,7 @@ function plvt_get_setting_default(): array {
83
83
* @type string $post_title_selector CSS selector for the post title element.
84
84
* @type string $post_thumbnail_selector CSS selector for the post thumbnail element.
85
85
* @type string $post_content_selector CSS selector for the post content element.
86
- * @type bool $admin_transition_animation Whether to use view transitions in the admin area.
86
+ * @type bool $enable_admin_transitions Whether to use view transitions in the admin area.
87
87
* }
88
88
*/
89
89
function plvt_get_stored_setting_value (): array {
@@ -96,7 +96,7 @@ function plvt_get_stored_setting_value(): array {
96
96
* @since 1.0.0
97
97
*
98
98
* @param mixed $input Setting to sanitize.
99
- * @return array{ default_transition_animation: non-empty-string, header_selector: non-empty-string, main_selector: non-empty-string, post_title_selector: non-empty-string, post_thumbnail_selector: non-empty-string, post_content_selector: non-empty-string, admin_transition_animation : bool|non-empty-string } {
99
+ * @return array{ default_transition_animation: non-empty-string, header_selector: non-empty-string, main_selector: non-empty-string, post_title_selector: non-empty-string, post_thumbnail_selector: non-empty-string, post_content_selector: non-empty-string, enable_admin_transitions : bool|non-empty-string } {
100
100
* Sanitized setting.
101
101
*
102
102
* @type string $default_transition_animation Default view transition animation.
@@ -105,7 +105,7 @@ function plvt_get_stored_setting_value(): array {
105
105
* @type string $post_title_selector CSS selector for the post title element.
106
106
* @type string $post_thumbnail_selector CSS selector for the post thumbnail element.
107
107
* @type string $post_content_selector CSS selector for the post content element.
108
- * @type bool $admin_transition_animation Whether to use view transitions in the admin area.
108
+ * @type bool $enable_admin_transitions Whether to use view transitions in the admin area.
109
109
* }
110
110
*/
111
111
function plvt_sanitize_setting ( $ input ): array {
@@ -140,9 +140,9 @@ function plvt_sanitize_setting( $input ): array {
140
140
}
141
141
}
142
142
143
- // Sanitize "admin_transition_animation " as a boolean.
144
- if ( isset ( $ input ['admin_transition_animation ' ] ) ) {
145
- $ value ['admin_transition_animation ' ] = (bool ) $ input ['admin_transition_animation ' ];
143
+ // Sanitize "enable_admin_transitions " as a boolean.
144
+ if ( isset ( $ input ['enable_admin_transitions ' ] ) ) {
145
+ $ value ['enable_admin_transitions ' ] = (bool ) $ input ['enable_admin_transitions ' ];
146
146
}
147
147
148
148
return $ value ;
@@ -279,7 +279,7 @@ static function (): void {
279
279
'title ' => __ ( 'Post Content Selector ' , 'view-transitions ' ),
280
280
'description ' => __ ( 'Provide the CSS selector to detect the post content element. ' , 'view-transitions ' ),
281
281
),
282
- 'admin_transition_animation ' => array (
282
+ 'enable_admin_transitions ' => array (
283
283
'title ' => __ ( 'Use transition in WP Admin ' , 'view-transitions ' ),
284
284
'description ' => __ ( 'Enable view transitions in the WordPress admin area. ' , 'view-transitions ' ),
285
285
),
@@ -291,7 +291,7 @@ static function (): void {
291
291
);
292
292
293
293
// Remove 'label_for' for checkbox field to avoid duplicate label association.
294
- if ( 'admin_transition_animation ' === $ slug ) {
294
+ if ( 'enable_admin_transitions ' === $ slug ) {
295
295
unset( $ additional_args ['label_for ' ] );
296
296
}
297
297
@@ -332,7 +332,7 @@ function plvt_render_settings_field( array $args ): void {
332
332
$ type = 'select ' ;
333
333
$ choices = plvt_get_view_transition_animation_labels ();
334
334
break ;
335
- case 'admin_transition_animation ' :
335
+ case 'enable_admin_transitions ' :
336
336
$ type = 'checkbox ' ;
337
337
$ choices = array (); // Defined just for consistency.
338
338
break ;
0 commit comments