| @@ -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 | |
| @@ -202,20 +198,15 @@ | ||
| 202 | 198 | public function get_field_id( $field_name ) { |
| 203 | 199 | return $field_name . '_' . $this->number; |
| 204 | 200 | } |
| 205 | 201 | |
| 206 | - /** | |
| 207 | - * @param int|string $number | |
| 208 | - * @return void | |
| 209 | - */ | |
| 202 | + // Private Function. Don't worry about this. | |
| 203 | + | |
| 210 | 204 | public function _set( $number ) { |
| 211 | 205 | $this->number = $number; |
| 212 | 206 | $this->id = $this->id_base . '-' . $number; |
| 213 | 207 | } |
| 214 | 208 | |
| 215 | - /** | |
| 216 | - * @return object | |
| 217 | - */ | |
| 218 | 209 | public function prepare_new( $form_id = false ) { |
| 219 | 210 | if ( $form_id ) { |
| 220 | 211 | $this->form_id = $form_id; |
| 221 | 212 | } |
| @@ -252,11 +243,8 @@ | ||
| 252 | 243 | |
| 253 | 244 | return $this->save_settings( $action ); |
| 254 | 245 | } |
| 255 | 246 | |
| 256 | - /** | |
| 257 | - * @return void | |
| 258 | - */ | |
| 259 | 247 | public function duplicate_form_actions( $form_id, $old_id ) { |
| 260 | 248 | if ( $form_id == $old_id ) { |
| 261 | 249 | // don't duplicate the actions if this is a template getting updated |
| 262 | 250 | return; |
| @@ -292,11 +280,8 @@ | ||
| 292 | 280 | |
| 293 | 281 | return $post_id; |
| 294 | 282 | } |
| 295 | 283 | |
| 296 | - /** | |
| 297 | - * @param object $action | |
| 298 | - */ | |
| 299 | 284 | public function duplicate_one( $action, $form_id ) { |
| 300 | 285 | global $frm_duplicate_ids; |
| 301 | 286 | |
| 302 | 287 | $action->menu_order = $form_id; |
| @@ -523,13 +508,10 @@ | ||
| 523 | 508 | } |
| 524 | 509 | |
| 525 | 510 | /** |
| 526 | 511 | * @since 3.04 |
| 527 | - * | |
| 528 | 512 | * @param array $args |
| 529 | 513 | * @param string $default_status |
| 530 | - * | |
| 531 | - * @return void | |
| 532 | 514 | */ |
| 533 | 515 | protected static function prepare_get_action( &$args, $default_status = 'publish' ) { |
| 534 | 516 | if ( is_numeric( $args ) ) { |
| 535 | 517 | // for reverse compatibility. $limit was changed to $args |
| @@ -567,14 +549,9 @@ | ||
| 567 | 549 | return ! empty( $payment_actions ); |
| 568 | 550 | } |
| 569 | 551 | |
| 570 | 552 | 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 | 553 | self::prepare_get_action( $atts, 'any' ); |
| 576 | - | |
| 577 | 554 | $limit = $atts['limit']; |
| 578 | 555 | |
| 579 | 556 | if ( $form_id ) { |
| 580 | 557 | $this->form_id = $form_id; |
| @@ -616,11 +593,8 @@ | ||
| 616 | 593 | |
| 617 | 594 | return $settings; |
| 618 | 595 | } |
| 619 | 596 | |
| 620 | - /** | |
| 621 | - * @return array | |
| 622 | - */ | |
| 623 | 597 | public static function action_args( $form_id = 0, $limit = 99 ) { |
| 624 | 598 | $args = array( |
| 625 | 599 | 'post_type' => FrmFormActionsController::$action_post_type, |
| 626 | 600 | 'post_status' => 'publish', |
| @@ -635,11 +609,8 @@ | ||
| 635 | 609 | |
| 636 | 610 | return $args; |
| 637 | 611 | } |
| 638 | 612 | |
| 639 | - /** | |
| 640 | - * @param WP_Post|array $action | |
| 641 | - */ | |
| 642 | 613 | public function prepare_action( $action ) { |
| 643 | 614 | $action->post_content = (array) FrmAppHelper::maybe_json_decode( $action->post_content ); |
| 644 | 615 | $action->post_excerpt = sanitize_title( $action->post_excerpt ); |
| 645 | 616 | |
| @@ -649,9 +620,9 @@ | ||
| 649 | 620 | $action->post_content += $default_values; |
| 650 | 621 | |
| 651 | 622 | foreach ( $default_values as $k => $vals ) { |
| 652 | 623 | if ( is_array( $vals ) && ! empty( $vals ) ) { |
| 653 | - if ( 'event' === $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { | |
| 624 | + if ( 'event' == $k && ! $this->action_options['force_event'] && ! empty( $action->post_content[ $k ] ) ) { | |
| 654 | 625 | continue; |
| 655 | 626 | } |
| 656 | 627 | $action->post_content[ $k ] = wp_parse_args( $action->post_content[ $k ], $vals ); |
| 657 | 628 | } |
| @@ -663,11 +634,8 @@ | ||
| 663 | 634 | |
| 664 | 635 | return $action; |
| 665 | 636 | } |
| 666 | 637 | |
| 667 | - /** | |
| 668 | - * @return void | |
| 669 | - */ | |
| 670 | 638 | public function destroy( $form_id = false, $type = 'default' ) { |
| 671 | 639 | global $wpdb; |
| 672 | 640 | |
| 673 | 641 | $this->form_id = $form_id; |
| @@ -691,10 +659,8 @@ | ||
| 691 | 659 | /** |
| 692 | 660 | * Delete the action cache when a form action is created, deleted, or updated |
| 693 | 661 | * |
| 694 | 662 | * @since 2.0.5 |
| 695 | - * | |
| 696 | - * @return void | |
| 697 | 663 | */ |
| 698 | 664 | public static function clear_cache() { |
| 699 | 665 | FrmDb::cache_delete_group( 'frm_actions' ); |
| 700 | 666 | } |
| @@ -702,11 +668,8 @@ | ||
| 702 | 668 | public function get_settings() { |
| 703 | 669 | return self::get_action_for_form( $this->form_id, $this->id_base ); |
| 704 | 670 | } |
| 705 | 671 | |
| 706 | - /** | |
| 707 | - * @return array | |
| 708 | - */ | |
| 709 | 672 | public function get_global_defaults() { |
| 710 | 673 | $defaults = $this->get_defaults(); |
| 711 | 674 | |
| 712 | 675 | if ( ! isset( $defaults['event'] ) ) { |
| @@ -824,14 +787,11 @@ | ||
| 824 | 787 | /** |
| 825 | 788 | * Prepare the logic value for comparison against the entered value |
| 826 | 789 | * |
| 827 | 790 | * @since 2.01.02 |
| 828 | - * | |
| 829 | 791 | * @deprecated 4.06.02 |
| 830 | 792 | * |
| 831 | 793 | * @param array|string $logic_value |
| 832 | - * | |
| 833 | - * @return void | |
| 834 | 794 | */ |
| 835 | 795 | private static function prepare_logic_value( &$logic_value, $action, $entry ) { |
| 836 | 796 | if ( is_array( $logic_value ) ) { |
| 837 | 797 | $logic_value = reset( $logic_value ); |
| @@ -879,13 +839,8 @@ | ||
| 879 | 839 | |
| 880 | 840 | return $observed_value; |
| 881 | 841 | } |
| 882 | 842 | |
| 883 | - /** | |
| 884 | - * @param string $class | |
| 885 | - * | |
| 886 | - * @return array | |
| 887 | - */ | |
| 888 | 843 | public static function default_action_opts( $class = '' ) { |
| 889 | 844 | return array( |
| 890 | 845 | 'classes' => 'frm_icon_font ' . $class, |
| 891 | 846 | 'active' => false, |
| @@ -904,11 +859,8 @@ | ||
| 904 | 859 | |
| 905 | 860 | return apply_filters( 'frm_action_triggers', $triggers ); |
| 906 | 861 | } |
| 907 | 862 | |
| 908 | - /** | |
| 909 | - * @return void | |
| 910 | - */ | |
| 911 | 863 | public function render_conditional_logic_call_to_action() { |
| 912 | 864 | ?> |
| 913 | 865 | <h3> |
| 914 | 866 | <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 +869,8 @@ | ||
| 917 | 869 | </h3> |
| 918 | 870 | <?php |
| 919 | 871 | } |
| 920 | 872 | |
| 921 | - /** | |
| 922 | - * @return string | |
| 923 | - */ | |
| 924 | 873 | protected function get_upgrade_text() { |
| 925 | 874 | return __( 'Conditional form actions', 'formidable' ); |
| 926 | 875 | } |
| 927 | 876 | } |