| @@ -84,8 +84,15 @@ | ||
| 84 | 84 | add_action( 'wp_footer', 'FrmHoneypot::maybe_print_honeypot_js', 99 ); |
| 85 | 85 | |
| 86 | 86 | add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' ); |
| 87 | 87 | |
| 88 | + // Clear embed posts transient when posts are updated. | |
| 89 | + add_action( 'wp_insert_post', 'FrmFormsListHelper::maybe_clear_embed_posts_transient', 10, 3 ); | |
| 90 | + add_action( 'post_updated', 'FrmFormsListHelper::maybe_clear_embed_posts_transient_on_update', 10, 3 ); | |
| 91 | + add_action( 'trashed_post', 'FrmFormsListHelper::clear_embed_posts_transient_for_post' ); | |
| 92 | + add_action( 'untrashed_post', 'FrmFormsListHelper::clear_embed_posts_transient_for_post' ); | |
| 93 | + add_action( 'deleted_post', 'FrmFormsListHelper::clear_embed_posts_transient_for_post', 10, 2 ); | |
| 94 | + | |
| 88 | 95 | // Form Shortcodes. |
| 89 | 96 | add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' ); |
| 90 | 97 | |
| 91 | 98 | // Styles Controller. |
| @@ -96,9 +103,8 @@ | ||
| 96 | 103 | |
| 97 | 104 | // Simple Blocks Controller. |
| 98 | 105 | add_action( 'init', 'FrmSimpleBlocksController::register_simple_form_block' ); |
| 99 | 106 | |
| 100 | - add_filter( 'cron_schedules', 'FrmUsageController::add_schedules' ); | |
| 101 | 107 | add_action( 'formidable_send_usage', 'FrmUsageController::send_snapshot' ); |
| 102 | 108 | |
| 103 | 109 | /** |
| 104 | 110 | * Make name field work with View. |
| @@ -111,11 +117,26 @@ | ||
| 111 | 117 | |
| 112 | 118 | // Summary emails. |
| 113 | 119 | add_action( 'frm_daily_event', 'FrmEmailSummaryController::maybe_send_emails' ); |
| 114 | 120 | |
| 121 | + // Gated Content — daily cleanup of expired tokens. | |
| 122 | + add_action( 'frm_daily_event', 'FrmGatedTokenHelper::cleanup_expired' ); | |
| 123 | + | |
| 124 | + // Gated Content Controller. | |
| 125 | + add_action( 'frm_trigger_gated_content_action', 'FrmGatedContentController::trigger', 10, 4 ); | |
| 126 | + // pre_get_posts: allows private posts into the query when a valid token is present. | |
| 127 | + add_action( 'pre_get_posts', 'FrmGatedContentController::maybe_include_private_posts' ); | |
| 128 | + // 'wp' fires after WP::query_posts() so get_queried_object_id() is available. | |
| 129 | + add_action( 'wp', 'FrmGatedContentController::maybe_unlock_post' ); | |
| 130 | + add_action( 'save_post_frm_form_actions', 'FrmGatedContentController::on_action_updated', 10, 3 ); | |
| 131 | + add_action( 'before_delete_post', 'FrmGatedContentController::on_action_deleted', 10, 2 ); | |
| 132 | + add_shortcode( 'frm_gated_content', 'FrmGatedContentShortcodeController::shortcode' ); | |
| 133 | + add_filter( 'frm_helper_shortcodes', 'FrmGatedContentController::add_shortcode_helper', 10, 3 ); | |
| 134 | + | |
| 115 | 135 | FrmTransLiteHooksController::load_hooks(); |
| 116 | 136 | FrmStrpLiteHooksController::load_hooks(); |
| 117 | 137 | FrmSquareLiteHooksController::load_hooks(); |
| 138 | + FrmPayPalLiteHooksController::load_hooks(); | |
| 118 | 139 | |
| 119 | 140 | // GDPR |
| 120 | 141 | add_filter( 'frm_is_field_required', 'FrmFieldGdpr::force_required_field', 10, 2 ); |
| 121 | 142 | } |
| @@ -153,12 +174,14 @@ | ||
| 153 | 174 | // Forms Controller. |
| 154 | 175 | add_action( 'admin_menu', 'FrmFormsController::menu', 10 ); |
| 155 | 176 | add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' ); |
| 156 | 177 | add_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' ); |
| 178 | + add_action( 'frm_field_code_tab', 'FrmFormsController::field_part_shortcodes' ); | |
| 157 | 179 | add_filter( 'frm_fields_in_form_builder', 'FrmFormsController::update_form_builder_fields' ); |
| 158 | 180 | |
| 159 | 181 | add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 ); |
| 160 | 182 | add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' ); |
| 183 | + add_action( 'admin_footer', 'FrmFormsController::print_forms_list_templates' ); | |
| 161 | 184 | |
| 162 | 185 | // Elementor. |
| 163 | 186 | add_action( 'elementor/editor/footer', 'FrmElementorController::admin_init' ); |
| 164 | 187 | |
| @@ -202,11 +225,8 @@ | ||
| 202 | 225 | |
| 203 | 226 | // Cronjob. |
| 204 | 227 | add_action( 'admin_init', 'FrmCronController::schedule_events' ); |
| 205 | 228 | |
| 206 | - // Cross sell. | |
| 207 | - add_action( 'admin_menu', 'FrmSalesApi::menu', 1000 ); | |
| 208 | - | |
| 209 | 229 | // Deactivation feedback. |
| 210 | 230 | add_action( 'admin_enqueue_scripts', 'FrmDeactivationFeedbackController::enqueue_assets' ); |
| 211 | 231 | add_action( 'admin_footer', 'FrmDeactivationFeedbackController::footer_html' ); |
| 212 | 232 | add_action( 'deactivated_plugin', 'FrmDeactivationFeedbackController::set_feedback_expired_date' ); |
| @@ -218,8 +238,9 @@ | ||
| 218 | 238 | FrmDashboardController::load_admin_hooks(); |
| 219 | 239 | FrmTransLiteHooksController::load_admin_hooks(); |
| 220 | 240 | FrmStrpLiteHooksController::load_admin_hooks(); |
| 221 | 241 | FrmSquareLiteHooksController::load_admin_hooks(); |
| 242 | + FrmPayPalLiteHooksController::load_admin_hooks(); | |
| 222 | 243 | FrmSMTPController::load_hooks(); |
| 223 | 244 | FrmOnboardingWizardController::load_admin_hooks(); |
| 224 | 245 | FrmAddonsController::load_admin_hooks(); |
| 225 | 246 | new FrmPluginSearch(); |