| @@ -17,41 +17,33 @@ | ||
| 17 | 17 | * |
| 18 | 18 | * @return FrmEntryFormatter|FrmProEntryFormatter |
| 19 | 19 | */ |
| 20 | 20 | public static function entry_formatter_instance( $atts ) { |
| 21 | - $formatter_class = 'FrmEntryFormatter'; | |
| 22 | - | |
| 23 | 21 | if ( FrmAppHelper::pro_is_installed() ) { |
| 24 | - $formatter_class = 'FrmProEntryFormatter'; | |
| 22 | + $entry_formatter = new FrmProEntryFormatter( $atts ); | |
| 23 | + } else { | |
| 24 | + $entry_formatter = new FrmEntryFormatter( $atts ); | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - /** | |
| 28 | - * Allows changing entry formatter class name. | |
| 29 | - * | |
| 30 | - * @since 5.0.16 | |
| 31 | - * | |
| 32 | - * @param string $formatter_class Entry formatter class name. | |
| 33 | - * @param array $atts See {@see FrmEntriesController::show_entry_shortcode()}. | |
| 34 | - */ | |
| 35 | - $formatter_class = apply_filters( 'frm_entry_formatter_class', $formatter_class, $atts ); | |
| 36 | - | |
| 37 | - return new $formatter_class( $atts ); | |
| 27 | + return $entry_formatter; | |
| 38 | 28 | } |
| 39 | 29 | |
| 40 | 30 | /** |
| 41 | - * Create an instance of the FrmEntryShortcodeFormatter class | |
| 31 | + * Create an intsance of the FrmEntryShortcodeFormatter class | |
| 42 | 32 | * |
| 43 | 33 | * @since 2.04 |
| 44 | 34 | * |
| 45 | 35 | * @param int|string $form_id |
| 46 | - * @param array $atts | |
| 36 | + * @param array $atts | |
| 47 | 37 | * |
| 48 | 38 | * @return FrmEntryShortcodeFormatter|FrmProEntryShortcodeFormatter |
| 49 | 39 | */ |
| 50 | 40 | public static function entry_shortcode_formatter_instance( $form_id, $atts ) { |
| 51 | 41 | if ( FrmAppHelper::pro_is_installed() ) { |
| 52 | - return new FrmProEntryShortcodeFormatter( $form_id, $atts ); | |
| 42 | + $shortcode_formatter = new FrmProEntryShortcodeFormatter( $form_id, $atts ); | |
| 43 | + } else { | |
| 44 | + $shortcode_formatter = new FrmEntryShortcodeFormatter( $form_id, $atts ); | |
| 53 | 45 | } |
| 54 | 46 | |
| 55 | - return new FrmEntryShortcodeFormatter( $form_id, $atts ); | |
| 47 | + return $shortcode_formatter; | |
| 56 | 48 | } |
| 57 | 49 | } |