PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmInboxController.php +61 -23 6.266.8 View file →
@@ -8,25 +8,33 @@
8 8 */
9 9 class FrmInboxController {
10 10
11 11 /**
12 - * Get the HTML for the inbox notice.
13 - *
14 12 * @since 4.05
15 - * @since 6.8.4 The $filtered parameter was added.
16 - *
17 - * @param bool $filtered Set this to false to avoid the frm_inbox_badge filter.
18 - *
19 - * @return string
20 13 */
21 - public static function get_notice_count( $filtered = true ) {
14 + public static function get_notice_count() {
22 15 FrmFormMigratorsHelper::maybe_add_to_inbox();
23 16
24 17 $inbox = new FrmInbox();
25 - return $inbox->unread_html( $filtered );
18 + return $inbox->unread_html();
26 19 }
27 20
28 21 /**
22 + * @since 4.06
23 + *
24 + * @return void
25 + */
26 + public static function dismiss_all_button( $atts ) {
27 + if ( empty( $atts['messages'] ) ) {
28 + return;
29 + }
30 +
31 + echo '<button class="frm-button-secondary" id="frm-dismiss-inbox" type="button">' .
32 + esc_html__( 'Dismiss All', 'formidable' ) .
33 + '</button>';
34 + }
35 +
36 + /**
29 37 * @since 6.8
30 38 *
31 39 * @return array
32 40 */
@@ -31,9 +39,9 @@
31 39 * @return array
32 40 */
33 41 public static function get_inbox_messages() {
34 42 self::add_tracking_request();
35 - self::remove_free_template_message();
43 + self::add_free_template_message();
36 44
37 45 $inbox = new FrmInbox();
38 46 $unread_messages = $inbox->get_messages();
39 47 $dismissed_messages = $unread_messages;
@@ -54,25 +62,18 @@
54 62 * @return void
55 63 */
56 64 public static function dismiss_message() {
57 65 check_ajax_referer( 'frm_ajax', 'nonce' );
58 - FrmAppHelper::permission_check( 'frm_view_forms' );
66 + FrmAppHelper::permission_check( 'frm_change_settings' );
59 67
60 68 $key = FrmAppHelper::get_param( 'key', '', 'post', 'sanitize_text_field' );
61 -
62 69 if ( ! empty( $key ) ) {
63 70 $message = new FrmInbox();
64 71 $message->dismiss( $key );
65 -
66 72 if ( $key === 'review' ) {
67 73 $reviews = new FrmReviews();
68 74 $reviews->dismiss_review();
69 75 }
70 -
71 - if ( $key === 'onboarding_wizard' ) {
72 - // Delete the skipped option or the inbox message will continue to get added.
73 - delete_option( FrmOnboardingWizardController::ONBOARDING_SKIPPED_OPTION );
74 - }
75 76 }
76 77
77 78 wp_die();
78 79 }
@@ -83,9 +84,8 @@
83 84 * @return void
84 85 */
85 86 private static function add_tracking_request() {
86 87 $settings = FrmAppHelper::get_settings();
87 -
88 88 if ( $settings->tracking ) {
89 89 return;
90 90 }
91 91
@@ -109,11 +109,49 @@
109 109 * @since 4.10.03
110 110 *
111 111 * @return void
112 112 */
113 - private static function remove_free_template_message() {
114 - if ( ! FrmAppHelper::pro_is_installed() ) {
115 - $message = new FrmInbox();
116 - $message->dismiss( 'free_templates' );
113 + private static function add_free_template_message() {
114 + if ( FrmAppHelper::pro_is_installed() ) {
115 + return;
117 116 }
117 +
118 + $api = new FrmFormTemplateApi();
119 + if ( $api->has_free_access() ) {
120 + return;
121 + }
122 +
123 + $link = admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG . '&free-templates=1' );
124 +
125 + $message = new FrmInbox();
126 + $message->add_message(
127 + array(
128 + 'key' => 'free_templates',
129 + 'message' => 'Add your email address to get a code for 20+ free form templates.',
130 + 'subject' => 'Get 20+ Free Form Templates',
131 + 'cta' => '<a href="#" class="frm-button-secondary frm_inbox_dismiss">Dismiss</a> <a href="' . esc_url( $link ) . '" class="button-primary frm-button-primary">Get Now</a>',
132 + 'type' => 'feedback',
133 + )
134 + );
118 135 }
136 +
137 + /**
138 + * @since 4.05
139 + * @deprecated 6.8
140 + *
141 + * @return void
142 + */
143 + public static function menu() {
144 + _deprecated_function( __METHOD__, '6.8' );
145 + }
146 +
147 + /**
148 + * @since 4.05
149 + * @deprecated 6.8
150 + *
151 + * @return void
152 + */
153 + public static function inbox() {
154 + _deprecated_function( __METHOD__, '6.8' );
155 + }
156 +
119 157 }