PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.16
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.16
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 +33 -39 6.3.26.16 View file →
@@ -8,60 +8,44 @@
8 8 */
9 9 class FrmInboxController {
10 10
11 11 /**
12 + * Get the HTML for the inbox notice.
13 + *
12 14 * @since 4.05
15 + * @since 6.8.4 The $filtered parameter was added.
13 16 *
14 - * @return void
17 + * @param bool $filtered Set this to false to avoid the frm_inbox_badge filter.
18 + * @return string
15 19 */
16 - public static function menu() {
17 - $unread = self::get_notice_count();
18 - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Inbox', 'formidable' ), __( 'Inbox', 'formidable' ) . $unread, 'frm_change_settings', 'formidable-inbox', 'FrmInboxController::inbox' );
19 - }
20 -
21 - /**
22 - * @since 4.05
23 - */
24 - private static function get_notice_count() {
20 + public static function get_notice_count( $filtered = true ) {
25 21 FrmFormMigratorsHelper::maybe_add_to_inbox();
26 22
27 23 $inbox = new FrmInbox();
28 - return $inbox->unread_html();
24 + return $inbox->unread_html( $filtered );
29 25 }
30 26
31 27 /**
32 - * @since 4.06
28 + * @since 6.8
33 29 *
34 - * @return void
30 + * @return array
35 31 */
36 - public static function dismiss_all_button( $atts ) {
37 - if ( empty( $atts['messages'] ) ) {
38 - return;
39 - }
40 -
41 - echo '<button class="frm-button-secondary" id="frm-dismiss-inbox" type="button">' .
42 - esc_html__( 'Dismiss All', 'formidable' ) .
43 - '</button>';
44 - }
45 -
46 - /**
47 - * @since 4.05
48 - *
49 - * @return void
50 - */
51 - public static function inbox() {
52 - FrmAppHelper::include_svg();
32 + public static function get_inbox_messages() {
53 33 self::add_tracking_request();
54 34 self::add_free_template_message();
55 35
56 - $inbox = new FrmInbox();
57 - $messages = $inbox->get_messages( 'filter' );
58 - $messages = array_reverse( $messages );
59 - $user = wp_get_current_user();
36 + $inbox = new FrmInbox();
37 + $unread_messages = $inbox->get_messages();
38 + $dismissed_messages = $unread_messages;
60 39
61 - wp_enqueue_script( 'frm-ac', FrmAppHelper::plugin_url() . '/js/ac.js', array(), FrmAppHelper::plugin_version(), true );
40 + $inbox->filter_messages( $unread_messages, 'filter' );
41 + $inbox->filter_messages( $dismissed_messages, 'dismissed' );
62 42
63 - include( FrmAppHelper::plugin_path() . '/classes/views/inbox/list.php' );
43 + return array(
44 + 'unread' => array_reverse( $unread_messages ),
45 + 'dismissed' => array_reverse( $dismissed_messages ),
46 + 'user' => wp_get_current_user(),
47 + );
64 48 }
65 49
66 50 /**
67 51 * @since 4.05
@@ -126,18 +110,28 @@
126 110 if ( $api->has_free_access() ) {
127 111 return;
128 112 }
129 113
130 - $link = admin_url( 'admin.php?page=formidable&triggerNewFormModal=1&free-templates=1' );
114 + $link = admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG . '&free-templates=1' );
131 115
132 116 $message = new FrmInbox();
133 117 $message->add_message(
134 118 array(
135 119 'key' => 'free_templates',
136 - 'message' => 'Add your email address to get a code for 10+ free form templates.',
137 - 'subject' => 'Get 10+ Free Form Templates',
120 + 'message' => 'Add your email address to get a code for 20+ free form templates.',
121 + 'subject' => 'Get 20+ Free Form Templates',
138 122 '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>',
139 123 'type' => 'feedback',
140 124 )
141 125 );
126 + }
127 +
128 + /**
129 + * @since 4.06
130 + * @deprecated 6.16
131 + *
132 + * @return void
133 + */
134 + public static function dismiss_all_button( $atts ) {
135 + _deprecated_function( __METHOD__, '6.16' );
142 136 }
143 137 }