Skip to content

Implement basic settings for View Transitions plugin #2025

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 2, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Implement basic settings for View Transitions plugin.
  • Loading branch information
felixarntz committed May 28, 2025

Verified

This commit was signed with the committer’s verified signature.
felixarntz Felix Arntz
commit 79fd9c07f7286b3f1343dbadd6b17cb017f8d550
10 changes: 9 additions & 1 deletion plugins/view-transitions/hooks.php
Original file line number Diff line number Diff line change
@@ -26,8 +26,16 @@
add_action( 'wp_head', 'plvt_render_generator' );

/**
* Filters related to the View Transitions functionality.
* Hooks related to the key View Transitions functionality.
*/
add_action( 'after_setup_theme', 'plvt_polyfill_theme_support', PHP_INT_MAX );
add_action( 'init', 'plvt_sanitize_view_transitions_theme_support', 1 );
add_action( 'wp_enqueue_scripts', 'plvt_load_view_transitions' );

/**
* Hooks related to the View Transitions settings.
*/
add_action( 'init', 'plvt_register_setting' );
add_action( 'init', 'plvt_apply_settings_to_theme_support' );
add_action( 'load-options-reading.php', 'plvt_add_setting_ui' );
add_filter( 'plugin_action_links_' . plugin_basename( VIEW_TRANSITIONS_MAIN_FILE ), 'plvt_add_settings_action_link' );

Check warning on line 41 in plugins/view-transitions/hooks.php

Codecov / codecov/patch

plugins/view-transitions/hooks.php#L38-L41

Added lines #L38 - L41 were not covered by tests
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@
* @since 1.0.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Class representing a view transition animation registry.
*
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@
* @since 1.0.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Class representing a view transition animation.
*
6 changes: 6 additions & 0 deletions plugins/view-transitions/includes/functions.php
Original file line number Diff line number Diff line change
@@ -6,6 +6,12 @@
* @since 1.0.0
*/

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
* Gets the path to a script or stylesheet.
*
Loading