| @@ -72,9 +72,8 @@ | ||
| 72 | 72 | 'googlespreadsheet' => 'FrmDefGoogleSpreadsheetAction', |
| 73 | 73 | ); |
| 74 | 74 | |
| 75 | 75 | $action_classes = apply_filters( 'frm_registered_form_actions', $action_classes ); |
| 76 | - $action_classes = self::maybe_unset_highrise( $action_classes ); | |
| 77 | 76 | |
| 78 | 77 | include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php'; |
| 79 | 78 | include_once FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php'; |
| 80 | 79 | |
| @@ -83,23 +82,8 @@ | ||
| 83 | 82 | } |
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | /** |
| 87 | - * Remove the Highrise action if it is not registered. | |
| 88 | - * | |
| 89 | - * @since 6.23 | |
| 90 | - * | |
| 91 | - * @param array $action_classes | |
| 92 | - * @return array | |
| 93 | - */ | |
| 94 | - private static function maybe_unset_highrise( $action_classes ) { | |
| 95 | - if ( 'FrmDefHighriseAction' === ( $action_classes['highrise'] ?? '' ) ) { | |
| 96 | - unset( $action_classes['highrise'] ); | |
| 97 | - } | |
| 98 | - return $action_classes; | |
| 99 | - } | |
| 100 | - | |
| 101 | - /** | |
| 102 | 86 | * @since 4.0 |
| 103 | 87 | * |
| 104 | 88 | * @param array $values |
| 105 | 89 | */ |
| @@ -183,15 +167,18 @@ | ||
| 183 | 167 | 'constantcontact', |
| 184 | 168 | 'getresponse', |
| 185 | 169 | 'aweber', |
| 186 | 170 | 'mailpoet', |
| 187 | - 'convertkit', | |
| 188 | 171 | ), |
| 189 | 172 | ), |
| 190 | 173 | 'crm' => array( |
| 191 | 174 | 'name' => __( 'CRM', 'formidable' ), |
| 192 | 175 | 'icon' => 'frm_icon_font frm_address_card_icon', |
| 193 | - 'actions' => self::get_crm_actions(), | |
| 176 | + 'actions' => array( | |
| 177 | + 'salesforce', | |
| 178 | + 'hubspot', | |
| 179 | + 'highrise', | |
| 180 | + ), | |
| 194 | 181 | ), |
| 195 | 182 | ); |
| 196 | 183 | |
| 197 | 184 | return apply_filters( 'frm_action_groups', $groups ); |
| @@ -197,30 +184,8 @@ | ||
| 197 | 184 | return apply_filters( 'frm_action_groups', $groups ); |
| 198 | 185 | } |
| 199 | 186 | |
| 200 | 187 | /** |
| 201 | - * Get the actions to include in the CRM section. | |
| 202 | - * | |
| 203 | - * @since 6.23 | |
| 204 | - * | |
| 205 | - * @return array | |
| 206 | - */ | |
| 207 | - private static function get_crm_actions() { | |
| 208 | - $crm_actions = array( | |
| 209 | - 'salesforce', | |
| 210 | - 'hubspot', | |
| 211 | - ); | |
| 212 | - | |
| 213 | - // Only include Highrise when the add-on is active. | |
| 214 | - // This is because Highrise is deprecated. We don't want to show it in Lite. | |
| 215 | - if ( class_exists( 'FrmHrsSettings' ) ) { | |
| 216 | - $crm_actions[] = 'highrise'; | |
| 217 | - } | |
| 218 | - | |
| 219 | - return $crm_actions; | |
| 220 | - } | |
| 221 | - | |
| 222 | - /** | |
| 223 | 188 | * Get the number of currently active form actions. |
| 224 | 189 | * |
| 225 | 190 | * @since 4.0 |
| 226 | 191 | * |
| @@ -583,11 +548,8 @@ | ||
| 583 | 548 | return; |
| 584 | 549 | } |
| 585 | 550 | |
| 586 | 551 | FrmForm::maybe_get_form( $form ); |
| 587 | - if ( ! is_object( $form ) ) { | |
| 588 | - return; | |
| 589 | - } | |
| 590 | 552 | |
| 591 | 553 | $link_settings = self::get_form_actions( $type ); |
| 592 | 554 | if ( 'all' !== $type ) { |
| 593 | 555 | $link_settings = array( $type => $link_settings ); |
| @@ -617,9 +579,9 @@ | ||
| 617 | 579 | if ( empty( $entry ) || ( FrmEntriesHelper::DRAFT_ENTRY_STATUS === (int) $entry->is_draft && 'draft' !== $event ) ) { |
| 618 | 580 | continue; |
| 619 | 581 | } |
| 620 | 582 | |
| 621 | - $child_entry = ( is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ! empty( $args['is_child'] ); | |
| 583 | + $child_entry = ( ( is_object( $form ) && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) ); | |
| 622 | 584 | |
| 623 | 585 | if ( $child_entry ) { |
| 624 | 586 | // maybe trigger actions for sub forms |
| 625 | 587 | $trigger_children = apply_filters( 'frm_use_embedded_form_actions', false, compact( 'form', 'entry' ) ); |
| @@ -700,24 +662,8 @@ | ||
| 700 | 662 | |
| 701 | 663 | $where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] ); |
| 702 | 664 | |
| 703 | 665 | return $where; |
| 704 | - } | |
| 705 | - | |
| 706 | - /** | |
| 707 | - * Prevent WPML from filtering form actions based on the active language. | |
| 708 | - * | |
| 709 | - * @since 6.20 | |
| 710 | - * | |
| 711 | - * @param bool|null $null | |
| 712 | - * @param string $post_type | |
| 713 | - * @return bool|null | |
| 714 | - */ | |
| 715 | - public static function prevent_wpml_translations( $null, $post_type ) { | |
| 716 | - if ( self::$action_post_type === $post_type ) { | |
| 717 | - return false; | |
| 718 | - } | |
| 719 | - return $null; | |
| 720 | 666 | } |
| 721 | 667 | } |
| 722 | 668 | |
| 723 | 669 | class Frm_Form_Action_Factory { |