PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.8.2
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.8.2
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
formidable / classes / factories / FrmEntryFactory.php

FrmEntryFactory.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.8.2, at classes/factories/FrmEntryFactory.php

60 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( 'You are not allowed to call this page directly.' );
4 }
5
6 /**
7 * @since 2.04
8 */
9 class FrmEntryFactory {
10
11 /**
12 * Create an instance of the FrmEntryFormatter class
13 *
14 * @since 2.04
15 *
16 * @param array $atts
17 *
18 * @return FrmEntryFormatter|FrmProEntryFormatter
19 */
20 public static function entry_formatter_instance( $atts ) {
21 $formatter_class = 'FrmEntryFormatter';
22
23 if ( FrmAppHelper::pro_is_installed() ) {
24 $formatter_class = 'FrmProEntryFormatter';
25 }
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 );
38 }
39
40 /**
41 * Create an intsance of the FrmEntryShortcodeFormatter class
42 *
43 * @since 2.04
44 *
45 * @param int|string $form_id
46 * @param array $atts
47 *
48 * @return FrmEntryShortcodeFormatter|FrmProEntryShortcodeFormatter
49 */
50 public static function entry_shortcode_formatter_instance( $form_id, $atts ) {
51 if ( FrmAppHelper::pro_is_installed() ) {
52 $shortcode_formatter = new FrmProEntryShortcodeFormatter( $form_id, $atts );
53 } else {
54 $shortcode_formatter = new FrmEntryShortcodeFormatter( $form_id, $atts );
55 }
56
57 return $shortcode_formatter;
58 }
59 }
60