File tree Expand file tree Collapse file tree 3 files changed +36
-22
lines changed Expand file tree Collapse file tree 3 files changed +36
-22
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Admin related functions for View Transitions.
4
+ *
5
+ * @package view-transitions
6
+ * @since 1.0.0
7
+ */
8
+
9
+ // @codeCoverageIgnoreStart
10
+ if ( ! defined ( 'ABSPATH ' ) ) {
11
+ exit ; // Exit if accessed directly.
12
+ }
13
+ // @codeCoverageIgnoreEnd
14
+
15
+ /**
16
+ * Outputs the necessary CSS styles for view transitions.
17
+ *
18
+ * This function is responsible for printing the required inline styles
19
+ * to enable or enhance view transitions within the theme or plugin.
20
+ * It should be hooked to an appropriate action to ensure the styles
21
+ * are included in the page output.
22
+ *
23
+ * @since n.e.x.t
24
+ */
25
+ function plvt_print_view_transitions_admin_style (): void {
26
+ $ options = plvt_get_stored_setting_value ();
27
+ if ( ! isset ( $ options ['enable_admin_transitions ' ] ) || true !== $ options ['enable_admin_transitions ' ] ) {
28
+ return ;
29
+ }
30
+ ?>
31
+ <style>
32
+ @view-transition { navigation: auto; }
33
+ </style>
34
+ <?php
35
+ }
Original file line number Diff line number Diff line change @@ -355,25 +355,3 @@ function plvt_load_view_transitions(): void {
355
355
wp_add_inline_script ( 'plvt-view-transitions ' , $ init_script );
356
356
wp_enqueue_script ( 'plvt-view-transitions ' );
357
357
}
358
-
359
- /**
360
- * Outputs the necessary CSS styles for view transitions.
361
- *
362
- * This function is responsible for printing the required inline styles
363
- * to enable or enhance view transitions within the theme or plugin.
364
- * It should be hooked to an appropriate action to ensure the styles
365
- * are included in the page output.
366
- *
367
- * @since n.e.x.t
368
- */
369
- function plvt_print_view_transitions_admin_style (): void {
370
- $ options = plvt_get_stored_setting_value ();
371
- if ( ! isset ( $ options ['enable_admin_transitions ' ] ) || true !== $ options ['enable_admin_transitions ' ] ) {
372
- return ;
373
- }
374
- ?>
375
- <style>
376
- @view-transition { navigation: auto; }
377
- </style>
378
- <?php
379
- }
Original file line number Diff line number Diff line change 28
28
define ( 'VIEW_TRANSITIONS_VERSION ' , '1.0.1 ' );
29
29
define ( 'VIEW_TRANSITIONS_MAIN_FILE ' , __FILE__ );
30
30
31
+ require_once __DIR__ . '/includes/admin.php ' ;
31
32
require_once __DIR__ . '/includes/class-plvt-view-transition-animation.php ' ;
32
33
require_once __DIR__ . '/includes/class-plvt-view-transition-animation-registry.php ' ;
33
34
require_once __DIR__ . '/includes/functions.php ' ;
You can’t perform that action at this time.
0 commit comments