PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.3
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.3
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/models/FrmApplicationTemplate.php +1 -37 6.35.3 View file →
@@ -30,10 +30,8 @@
30 30
31 31 /**
32 32 * @param array<string> $keys
33 33 * @param array<string> $keys_with_images
34 - *
35 - * @return void
36 34 */
37 35 public static function init() {
38 36 /**
39 37 * @since 5.3
@@ -81,32 +79,16 @@
81 79 * @return void
82 80 */
83 81 private static function populate_category_information( $categories ) {
84 82 foreach ( $categories as $category ) {
85 - if ( self::category_matches_a_license_type( $category ) ) {
83 + if ( false !== strpos( $category, '+Views' ) || in_array( $category, self::$categories, true ) ) {
86 84 continue;
87 85 }
88 - if ( in_array( $category, self::$categories, true ) ) {
89 - continue;
90 - }
91 86 self::$categories[] = $category;
92 87 }
93 88 }
94 89
95 90 /**
96 - * @since 5.5.2
97 - *
98 - * @param string $category
99 - * @return bool
100 - */
101 - private static function category_matches_a_license_type( $category ) {
102 - if ( false !== strpos( $category, '+Views' ) ) {
103 - return true;
104 - }
105 - return in_array( $category, FrmFormsHelper::ignore_template_categories(), true );
106 - }
107 -
108 - /**
109 91 * @return array<string>
110 92 */
111 93 public static function get_categories() {
112 94 return isset( self::$categories ) ? self::$categories : array();
@@ -117,12 +99,8 @@
117 99 */
118 100 public function as_js_object() {
119 101 $application = array();
120 102 foreach ( self::$keys as $key ) {
121 - if ( ! isset( $this->api_data[ $key ] ) ) {
122 - continue;
123 - }
124 -
125 103 $value = $this->api_data[ $key ];
126 104
127 105 if ( 'icon' === $key ) {
128 106 // Icon is an array. The first array item is the image URL.
@@ -158,14 +136,11 @@
158 136 if ( false !== $purchase_url ) {
159 137 $application['forPurchase'] = true;
160 138 }
161 139 $application['upgradeUrl'] = $this->get_admin_upgrade_link();
162 - $application['requires'] = FrmFormsHelper::get_plan_required( $application );
163 140 $application['link'] = $application['upgradeUrl'];
164 141 }
165 142
166 - $application['isNew'] = $this->is_new();
167 -
168 143 return $application;
169 144 }
170 145
171 146 /**
@@ -198,19 +173,8 @@
198 173 return false;
199 174 }
200 175
201 176 return true;
202 - }
203 -
204 - /**
205 - * Check if an application template is new. If it is, we include a "NEW" pill beside the title.
206 - *
207 - * @since 6.0
208 - *
209 - * @return bool
210 - */
211 - private function is_new() {
212 - return ! empty( $this->api_data['is_new'] );
213 177 }
214 178
215 179 /**
216 180 * @return string