| @@ -85,9 +85,13 @@ | ||
| 85 | 85 | |
| 86 | 86 | add_action( 'wp_scheduled_delete', 'FrmForm::scheduled_delete' ); |
| 87 | 87 | |
| 88 | 88 | // Clear embed posts transient when posts are updated. |
| 89 | - add_action( 'wp_insert_post', 'FrmFormsListHelper::maybe_clear_embed_posts_transient', 10, 2 ); | |
| 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 ); | |
| 90 | 94 | |
| 91 | 95 | // Form Shortcodes. |
| 92 | 96 | add_shortcode( 'formidable', 'FrmFormsController::get_form_shortcode' ); |
| 93 | 97 | |
| @@ -99,9 +103,8 @@ | ||
| 99 | 103 | |
| 100 | 104 | // Simple Blocks Controller. |
| 101 | 105 | add_action( 'init', 'FrmSimpleBlocksController::register_simple_form_block' ); |
| 102 | 106 | |
| 103 | - add_filter( 'cron_schedules', 'FrmUsageController::add_schedules' ); | |
| 104 | 107 | add_action( 'formidable_send_usage', 'FrmUsageController::send_snapshot' ); |
| 105 | 108 | |
| 106 | 109 | /** |
| 107 | 110 | * Make name field work with View. |
| @@ -114,8 +117,22 @@ | ||
| 114 | 117 | |
| 115 | 118 | // Summary emails. |
| 116 | 119 | add_action( 'frm_daily_event', 'FrmEmailSummaryController::maybe_send_emails' ); |
| 117 | 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 | + | |
| 118 | 135 | FrmTransLiteHooksController::load_hooks(); |
| 119 | 136 | FrmStrpLiteHooksController::load_hooks(); |
| 120 | 137 | FrmSquareLiteHooksController::load_hooks(); |
| 121 | 138 | FrmPayPalLiteHooksController::load_hooks(); |
| @@ -157,8 +174,9 @@ | ||
| 157 | 174 | // Forms Controller. |
| 158 | 175 | add_action( 'admin_menu', 'FrmFormsController::menu', 10 ); |
| 159 | 176 | add_action( 'admin_head-toplevel_page_formidable', 'FrmFormsController::head' ); |
| 160 | 177 | add_action( 'frm_after_field_options', 'FrmFormsController::logic_tip' ); |
| 178 | + add_action( 'frm_field_code_tab', 'FrmFormsController::field_part_shortcodes' ); | |
| 161 | 179 | add_filter( 'frm_fields_in_form_builder', 'FrmFormsController::update_form_builder_fields' ); |
| 162 | 180 | |
| 163 | 181 | add_filter( 'set-screen-option', 'FrmFormsController::save_per_page', 10, 3 ); |
| 164 | 182 | add_action( 'admin_footer', 'FrmFormsController::insert_form_popup' ); |