-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteractions.php
More file actions
137 lines (121 loc) · 7.64 KB
/
interactions.php
File metadata and controls
137 lines (121 loc) · 7.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
/**
* Plugin Name: Interactions
* Plugin URI: https://wpinteractions.com/
* Description: Add animations and interactivity to your blocks. Choose from ready-made effects like scroll & hover in the Interactions Library, or build your own.
* Author: Gambit Technologies, Inc
* Author URI: http://gambit.ph
* License: GPLv2 or later
* Text Domain: interactions
* Version: 1.3.2
*
* @fs_premium_only /freemius.php, /freemius/
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
defined( 'INTERACT_BUILD' ) || define( 'INTERACT_BUILD', 'free' );
defined( 'INTERACT_VERSION' ) || define( 'INTERACT_VERSION', '1.3.2' );
defined( 'INTERACT_FILE' ) || define( 'INTERACT_FILE', __FILE__ );
/**
* Plugin activation hook — handles version check and migration
*/
if ( ! function_exists( 'interact_on_activation' ) ) {
function interact_on_activation() {
$saved_version = get_option( 'interact_plugin_version' );
// Run migration if version not set or outdated
if ( ! $saved_version || version_compare( $saved_version, INTERACT_VERSION, '<' ) ) {
do_action( 'interact/on_plugin_update', $saved_version, INTERACT_VERSION );
}
update_option( 'interact_plugin_version', INTERACT_VERSION );
}
}
register_activation_hook( __FILE__, 'interact_on_activation' );
if ( INTERACT_BUILD === 'premium' ) {
/**
* Premium initialize code.
*/
if ( file_exists( plugin_dir_path( __FILE__ ) . 'pro__premium_only/index.php' ) ) {
require_once( plugin_dir_path( __FILE__ ) . 'pro__premium_only/index.php' );
}
}
require_once( plugin_dir_path( __FILE__ ) . 'src/class-interactions.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/class-interaction.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/class-action.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/class-frontend-screen.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/security.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/abstract-location.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-misc-all.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post-type.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post-archive.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post-status.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post-format.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post-template.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-post-taxonomy.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-page.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-page-template.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-page-parent.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/locations/class-location-block-template.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/admin/manage-interactions.php' );
if ( ! is_admin() ) {
require_once( plugin_dir_path( __FILE__ ) . 'src/frontend/frontend.php' );
}
if ( is_admin() ) {
require_once( plugin_dir_path( __FILE__ ) . 'src/admin/admin.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/editor/editor.php' );
}
/**
* Load the interaction and action types. We split this off into a function so
* it can only be called when needed.
*
* - editor.php calls this for the editor
* - frontend.php calls this if there are interactions in the page.
*
* @return void
*/
if ( ! function_exists( 'interact_require_types' ) ) {
function interact_require_types() {
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/abstract-action-type.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-display.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-visibility.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-opacity.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-move.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-rotate.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-scale.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-skew.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-text-color.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-confetti.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-css-rule.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-background-color.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-toggle-class.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-update-attribute.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-focus.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-redirect-to-url.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/action-types/class-action-type-toggle-video.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/abstract-interaction-type.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-click.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-toggle.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-hover.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-mouse-hovering.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-mouse-press.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-enter-viewport.php' );
// require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-keypress.php' );
// require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-input-change.php' );
// require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-page-create.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-page-load.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-page-scrolling.php' );
// require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-mouse-move.php' );
// require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-form-submitted.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/interaction-types/class-interaction-type-element-scrolling.php' );
do_action( 'interact/require_types' );
}
}
// This is placed after the definition of interact_require_types() since these depend on it.
require_once( plugin_dir_path( __FILE__ ) . 'src/rest-api/class-rest-editor.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/rest-api/class-rest-location-rules.php' );
require_once( plugin_dir_path( __FILE__ ) . 'src/editor/interaction-library/index.php' );