| @@ -4,14 +4,8 @@ | ||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | class FrmTipsHelper { |
| 7 | 7 | |
| 8 | - /** | |
| 9 | - * @param string $callback | |
| 10 | - * @param string $html | |
| 11 | - * | |
| 12 | - * @return void | |
| 13 | - */ | |
| 14 | 8 | public static function pro_tip( $callback, $html = '' ) { |
| 15 | 9 | if ( FrmAppHelper::pro_is_installed() ) { |
| 16 | 10 | return; |
| 17 | 11 | } |
| @@ -18,47 +12,22 @@ | ||
| 18 | 12 | |
| 19 | 13 | $tips = self::$callback(); |
| 20 | 14 | $tip = self::get_random_tip( $tips ); |
| 21 | 15 | |
| 22 | - self::show_tip( $tip, $html ); | |
| 23 | - } | |
| 16 | + if ( 'p' === $html ) { | |
| 17 | + echo '<p class="frmcenter frm_no_top_margin">'; | |
| 18 | + } | |
| 24 | 19 | |
| 25 | - /** | |
| 26 | - * Shows tip. | |
| 27 | - * | |
| 28 | - * @since 6.0 | |
| 29 | - * | |
| 30 | - * @param array $tip { | |
| 31 | - * Tip args | |
| 32 | - * | |
| 33 | - * @type array $link Tip link data. See the first parameter of {@see FrmAppHelper::admin_upgrade_link()} for more details. | |
| 34 | - * @type string $page The based link of the tip. If this is empty, `https://formidableforms.com/lite-upgrade/` will | |
| 35 | - * be used. Otherwise, `https://formidableforms.com/{$page}` will be used. | |
| 36 | - * @type string $tip Tip text. | |
| 37 | - * @type string $call Call to action text. | |
| 38 | - * } | |
| 39 | - * @param string $html | |
| 40 | - * | |
| 41 | - * @return void | |
| 42 | - */ | |
| 43 | - public static function show_tip( $tip, $html = '' ) { | |
| 44 | - $defaults = array( | |
| 45 | - 'page' => '', | |
| 46 | - 'class' => 'frm-mt-0', | |
| 47 | - ); | |
| 48 | - $tip = array_merge( $defaults, $tip ); | |
| 49 | - | |
| 50 | - if ( isset( $tip['link'] ) && ! isset( $tip['link']['medium'] ) ) { | |
| 20 | + if ( ! isset( $tip['page'] ) ) { | |
| 21 | + $tip['page'] = ''; | |
| 22 | + } | |
| 23 | + if ( ! isset( $tip['link']['medium'] ) ) { | |
| 51 | 24 | $tip['link']['medium'] = 'tip'; |
| 52 | 25 | } |
| 53 | 26 | |
| 54 | - if ( 'p' === $html ) { | |
| 55 | - echo '<p class="frmcenter ' . esc_attr( $tip['class'] ) . '">'; | |
| 56 | - } | |
| 57 | - | |
| 58 | - $link = empty( $tip['link'] ) ? $tip['page'] : FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] ); | |
| 27 | + $link = FrmAppHelper::admin_upgrade_link( $tip['link'], $tip['page'] ); | |
| 59 | 28 | ?> |
| 60 | - <a href="<?php echo esc_url( $link ); ?>" <?php echo empty( $tip['link'] ) ? '' : 'target="_blank"'; ?> class="frm_pro_tip"> | |
| 29 | + <a href="<?php echo esc_url( $link ); ?>" target="_blank" class="frm_pro_tip"> | |
| 61 | 30 | <?php FrmAppHelper::icon_by_class( 'frmfont frm_lightning', array( 'aria-hidden' => 'true' ) ); ?> |
| 62 | 31 | |
| 63 | 32 | <?php if ( isset( $tip['call'] ) ) { ?> |
| 64 | 33 | <span class="frm-tip-info"> |
| @@ -73,17 +42,13 @@ | ||
| 73 | 42 | </span> |
| 74 | 43 | <?php } ?> |
| 75 | 44 | </a> |
| 76 | 45 | <?php |
| 77 | - | |
| 78 | 46 | if ( 'p' === $html ) { |
| 79 | 47 | echo '</p>'; |
| 80 | 48 | } |
| 81 | 49 | } |
| 82 | 50 | |
| 83 | - /** | |
| 84 | - * @return array | |
| 85 | - */ | |
| 86 | 51 | public static function get_builder_tip() { |
| 87 | 52 | $tips = array( |
| 88 | 53 | array( |
| 89 | 54 | 'link' => array( |
| @@ -137,11 +102,8 @@ | ||
| 137 | 102 | |
| 138 | 103 | return $tips; |
| 139 | 104 | } |
| 140 | 105 | |
| 141 | - /** | |
| 142 | - * @return array | |
| 143 | - */ | |
| 144 | 106 | public static function get_form_settings_tip() { |
| 145 | 107 | $tips = array( |
| 146 | 108 | array( |
| 147 | 109 | 'link' => array( |
| @@ -171,11 +133,8 @@ | ||
| 171 | 133 | |
| 172 | 134 | return $tips; |
| 173 | 135 | } |
| 174 | 136 | |
| 175 | - /** | |
| 176 | - * @return array | |
| 177 | - */ | |
| 178 | 137 | public static function get_form_action_tip() { |
| 179 | 138 | $tips = array( |
| 180 | 139 | array( |
| 181 | 140 | 'link' => array( |
| @@ -256,16 +215,8 @@ | ||
| 256 | 215 | ), |
| 257 | 216 | 'tip' => __( 'Send an SMS message when a form is submitted.', 'formidable' ), |
| 258 | 217 | 'call' => __( 'Get the Twilio integration.', 'formidable' ), |
| 259 | 218 | ), |
| 260 | - array( | |
| 261 | - 'link' => array( | |
| 262 | - 'content' => 'acf-tip', | |
| 263 | - 'param' => 'acf-tip', | |
| 264 | - ), | |
| 265 | - 'tip' => __( 'Fill Advanced Custom Fields from a form.', 'formidable' ), | |
| 266 | - 'call' => __( 'Add ACF Integration', 'formidable' ), | |
| 267 | - ), | |
| 268 | 219 | ); |
| 269 | 220 | |
| 270 | 221 | return $tips; |
| 271 | 222 | } |
| @@ -303,11 +254,8 @@ | ||
| 303 | 254 | |
| 304 | 255 | return $tips; |
| 305 | 256 | } |
| 306 | 257 | |
| 307 | - /** | |
| 308 | - * @return array | |
| 309 | - */ | |
| 310 | 258 | public static function get_entries_tip() { |
| 311 | 259 | $tips = array( |
| 312 | 260 | array( |
| 313 | 261 | 'link' => array( |
| @@ -338,11 +286,8 @@ | ||
| 338 | 286 | |
| 339 | 287 | return $tips; |
| 340 | 288 | } |
| 341 | 289 | |
| 342 | - /** | |
| 343 | - * @return array | |
| 344 | - */ | |
| 345 | 290 | public static function get_import_tip() { |
| 346 | 291 | $tips = array( |
| 347 | 292 | array( |
| 348 | 293 | 'link' => array( |
| @@ -356,11 +301,8 @@ | ||
| 356 | 301 | |
| 357 | 302 | return $tips; |
| 358 | 303 | } |
| 359 | 304 | |
| 360 | - /** | |
| 361 | - * @return array | |
| 362 | - */ | |
| 363 | 305 | public static function get_banner_tip() { |
| 364 | 306 | $tips = array( |
| 365 | 307 | array( |
| 366 | 308 | 'link' => array( |