PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.5
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.5
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/FrmFormAction.php +4 -56 6.5.35.5 View file →
@@ -34,10 +34,9 @@
34 34
35 35 /**
36 36 * Echo the settings update form
37 37 *
38 - * @param WP_Post $instance Current settings
39 - * @param array $args
38 + * @param array $instance Current settings
40 39 */
41 40 public function form( $instance, $args = array() ) {
42 41 echo '<p class="no-options-widget">' . esc_html__( 'There are no options for this action.', 'formidable' ) . '</p>';
43 42
@@ -50,11 +49,8 @@
50 49 public function get_defaults() {
51 50 return array();
52 51 }
53 52
54 - /**
55 - * @return array
56 - */
57 53 public function get_switch_fields() {
58 54 return array();
59 55 }
60 56
@@ -97,9 +93,8 @@
97 93 'plugin' => $this->id_base,
98 94 'tooltip' => $name,
99 95 'group' => $id_base,
100 96 'color' => '',
101 - 'keywords' => '',
102 97 );
103 98
104 99 $action_options = apply_filters( 'frm_' . $id_base . '_action_options', $action_options );
105 100 $group = $this->get_group( $action_options );
@@ -202,20 +197,15 @@
202 197 public function get_field_id( $field_name ) {
203 198 return $field_name . '_' . $this->number;
204 199 }
205 200
206 - /**
207 - * @param int|string $number
208 - * @return void
209 - */
201 + // Private Function. Don't worry about this.
202 +
210 203 public function _set( $number ) {
211 204 $this->number = $number;
212 205 $this->id = $this->id_base . '-' . $number;
213 206 }
214 207
215 - /**
216 - * @return object
217 - */
218 208 public function prepare_new( $form_id = false ) {
219 209 if ( $form_id ) {
220 210 $this->form_id = $form_id;
221 211 }
@@ -252,11 +242,8 @@
252 242
253 243 return $this->save_settings( $action );
254 244 }
255 245
256 - /**
257 - * @return void
258 - */
259 246 public function duplicate_form_actions( $form_id, $old_id ) {
260 247 if ( $form_id == $old_id ) {
261 248 // don't duplicate the actions if this is a template getting updated
262 249 return;
@@ -292,11 +279,8 @@
292 279
293 280 return $post_id;
294 281 }
295 282
296 - /**
297 - * @param object $action
298 - */
299 283 public function duplicate_one( $action, $form_id ) {
300 284 global $frm_duplicate_ids;
301 285
302 286 $action->menu_order = $form_id;
@@ -523,13 +507,10 @@
523 507 }
524 508
525 509 /**
526 510 * @since 3.04
527 - *
528 511 * @param array $args
529 512 * @param string $default_status
530 - *
531 - * @return void
532 513 */
533 514 protected static function prepare_get_action( &$args, $default_status = 'publish' ) {
534 515 if ( is_numeric( $args ) ) {
535 516 // for reverse compatibility. $limit was changed to $args
@@ -567,14 +548,9 @@
567 548 return ! empty( $payment_actions );
568 549 }
569 550
570 551 public function get_all( $form_id = false, $atts = array() ) {
571 - if ( is_array( $atts ) && ! isset( $atts['limit'] ) && $this->action_options['limit'] > 99 ) {
572 - $atts['limit'] = $this->action_options['limit'];
573 - }
574 -
575 552 self::prepare_get_action( $atts, 'any' );
576 -
577 553 $limit = $atts['limit'];
578 554
579 555 if ( $form_id ) {
580 556 $this->form_id = $form_id;
@@ -616,11 +592,8 @@
616 592
617 593 return $settings;
618 594 }
619 595
620 - /**
621 - * @return array
622 - */
623 596 public static function action_args( $form_id = 0, $limit = 99 ) {
624 597 $args = array(
625 598 'post_type' => FrmFormActionsController::$action_post_type,
626 599 'post_status' => 'publish',
@@ -635,11 +608,8 @@
635 608
636 609 return $args;
637 610 }
638 611
639 - /**
640 - * @param WP_Post|array $action
641 - */
642 612 public function prepare_action( $action ) {
643 613 $action->post_content = (array) FrmAppHelper::maybe_json_decode( $action->post_content );
644 614 $action->post_excerpt = sanitize_title( $action->post_excerpt );
645 615
@@ -649,9 +619,9 @@
649 619 $action->post_content += $default_values;
650 620
651 621 foreach ( $default_values as $k => $vals ) {
652 622 if ( is_array( $vals ) && ! empty( $vals ) ) {
653 - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) {
623 + if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) {
654 624 continue;
655 625 }
656 626 $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals );
657 627 }
@@ -663,11 +633,8 @@
663 633
664 634 return $action;
665 635 }
666 636
667 - /**
668 - * @return void
669 - */
670 637 public function destroy( $form_id = false, $type = 'default' ) {
671 638 global $wpdb;
672 639
673 640 $this->form_id = $form_id;
@@ -691,10 +658,8 @@
691 658 /**
692 659 * Delete the action cache when a form action is created, deleted, or updated
693 660 *
694 661 * @since 2.0.5
695 - *
696 - * @return void
697 662 */
698 663 public static function clear_cache() {
699 664 FrmDb::cache_delete_group( 'frm_actions' );
700 665 }
@@ -702,11 +667,8 @@
702 667 public function get_settings() {
703 668 return self::get_action_for_form( $this->form_id, $this->id_base );
704 669 }
705 670
706 - /**
707 - * @return array
708 - */
709 671 public function get_global_defaults() {
710 672 $defaults = $this->get_defaults();
711 673
712 674 if ( ! isset( $defaults['event'] ) ) {
@@ -824,14 +786,11 @@
824 786 /**
825 787 * Prepare the logic value for comparison against the entered value
826 788 *
827 789 * @since 2.01.02
828 - *
829 790 * @deprecated 4.06.02
830 791 *
831 792 * @param array|string $logic_value
832 - *
833 - * @return void
834 793 */
835 794 private static function prepare_logic_value( &$logic_value, $action, $entry ) {
836 795 if ( is_array( $logic_value ) ) {
837 796 $logic_value = reset( $logic_value );
@@ -879,13 +838,8 @@
879 838
880 839 return $observed_value;
881 840 }
882 841
883 - /**
884 - * @param string $class
885 - *
886 - * @return array
887 - */
888 842 public static function default_action_opts( $class = '' ) {
889 843 return array(
890 844 'classes' => 'frm_icon_font ' . $class,
891 845 'active' => false,
@@ -904,11 +858,8 @@
904 858
905 859 return apply_filters( 'frm_action_triggers', $triggers );
906 860 }
907 861
908 - /**
909 - * @return void
910 - */
911 862 public function render_conditional_logic_call_to_action() {
912 863 ?>
913 864 <h3>
914 865 <a href="javascript:void(0)" class="frm_show_upgrade frm_noallow" data-upgrade="<?php echo esc_attr( $this->get_upgrade_text() ); ?>" data-medium="conditional-<?php echo esc_attr( $this->id_base ); ?>">
@@ -917,11 +868,8 @@
917 868 </h3>
918 869 <?php
919 870 }
920 871
921 - /**
922 - * @return string
923 - */
924 872 protected function get_upgrade_text() {
925 873 return __( 'Conditional form actions', 'formidable' );
926 874 }
927 875 }