PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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/views/styles/components/FrmStyleComponent.php +10 -15 6.26 → trunk View file →
@@ -62,9 +62,9 @@
62 62 * The FrmStyleComponent instance.
63 63 *
64 64 * @since 6.14
65 65 *
66 - * @var stdClass|null
66 + * @var FrmStyleComponent|null
67 67 */
68 68 private static $instance;
69 69
70 70 private function __construct() {
@@ -79,12 +79,10 @@
79 79 *
80 80 * @return void
81 81 */
82 82 public static function register_assets() {
83 - $plugin_url = FrmAppHelper::plugin_url();
84 - $version = FrmAppHelper::plugin_version();
85 -
86 - wp_register_script( self::ASSETS_SLUG, $plugin_url . '/js/formidable_styles.js', array( 'formidable_admin' ), $version, true );
83 + $version = FrmAppHelper::plugin_version();
84 + wp_register_script( self::ASSETS_SLUG, FrmAppHelper::plugin_url() . '/js/formidable_styles.js', array( 'formidable_admin' ), $version, true );
87 85 }
88 86
89 87 /**
90 88 * Get the singleton instance.
@@ -90,13 +88,13 @@
90 88 * Get the singleton instance.
91 89 *
92 90 * @since 6.14
93 91 *
94 - * @return stdClass|void
92 + * @return FrmStyleComponent|null
95 93 */
96 94 protected static function get_instance() {
97 95 if ( self::$instance ) {
98 - return;
96 + return null;
99 97 }
100 98
101 99 self::$instance = new FrmStyleComponent();
102 100 return self::$instance;
@@ -148,8 +146,9 @@
148 146
149 147 if ( ! empty( $this->data['will_change'] ) ) {
150 148 return $class . ' frm-style-dependent-updater-component';
151 149 }
150 +
152 151 return $class;
153 152 }
154 153
155 154 /**
@@ -175,8 +174,9 @@
175 174
176 175 if ( ! empty( $this->data['will_change'] ) ) {
177 176 $attributes .= 'data-will-change=' . wp_json_encode( $this->data['will_change'] );
178 177 }
178 +
179 179 return $attributes;
180 180 }
181 181
182 182 /**
@@ -187,9 +187,9 @@
187 187 *
188 188 * @return string
189 189 */
190 190 private function get_field_name() {
191 - return ! empty( $this->field_name ) ? 'name=' . $this->field_name : '';
191 + return $this->field_name ? 'name=' . $this->field_name : '';
192 192 }
193 193
194 194 /**
195 195 * Init the full view path.
@@ -209,9 +209,9 @@
209 209 *
210 210 * @return void
211 211 */
212 212 protected function load_view() {
213 - if ( empty( $this->view_name ) ) {
213 + if ( ! $this->view_name ) {
214 214 return;
215 215 }
216 216
217 217 $this->set_view_path();
@@ -230,14 +230,9 @@
230 230 protected function hide_component() {
231 231 if ( empty( $this->data['not_show_in'] ) ) {
232 232 return false;
233 233 }
234 -
235 - if ( FrmAppHelper::get_param( 'section', '', 'get', 'sanitize_text_field' ) === $this->data['not_show_in'] ) {
236 - return true;
237 - }
238 -
239 - return false;
234 + return FrmAppHelper::get_param( 'section', '', 'get', 'sanitize_text_field' ) === $this->data['not_show_in'];
240 235 }
241 236
242 237 /**
243 238 * Load component CSS file.