PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 2.12.0
GiveWP – Donation Plugin and Fundraising Platform v2.12.0
4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 All 254 releases
give / includes / admin / reports / class-forms-report.php

class-forms-report.php in GiveWP – Donation Plugin and Fundraising Platform 2.12.0, at includes/admin/reports/class-forms-report.php

107 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Give Reports Page/Tab
4 *
5 * @package Give
6 * @subpackage Classes/Give_Forms_Report
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.8
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit; // Exit if accessed directly
14 }
15
16 if ( ! class_exists( 'Give_Forms_Report' ) ) :
17
18 /**
19 * Give_Forms_Report.
20 *
21 * @sine 1.8
22 */
23 class Give_Forms_Report extends Give_Settings_Page {
24 /**
25 * Flag to check if enable saving option for setting page or not
26 *
27 * @since 1.8.17
28 * @var bool
29 */
30 protected $enable_save = false;
31
32 /**
33 * Constructor.
34 */
35 public function __construct() {
36 $this->id = 'forms';
37 $this->label = esc_html__( 'Forms', 'give' );
38
39 parent::__construct();
40
41 add_action( 'give_admin_field_report_forms', array( $this, 'render_report_forms_field' ), 10, 2 );
42
43 // Do not use main form for this tab.
44 if ( give_get_current_setting_tab() === $this->id ) {
45 add_action( 'give-reports_open_form', '__return_empty_string' );
46 add_action( 'give-reports_close_form', '__return_empty_string' );
47 }
48 }
49
50 /**
51 * Get settings array.
52 *
53 * @since 1.8
54 * @return array
55 */
56 public function get_settings() {
57
58 /**
59 * Filter the settings.
60 *
61 * @since 1.8
62 *
63 * @param array $settings
64 */
65 $settings = apply_filters(
66 'give_get_settings_' . $this->id,
67 array(
68 array(
69 'id' => 'give_reports_forms',
70 'type' => 'title',
71 'table_html' => false,
72 ),
73 array(
74 'id' => 'forms',
75 'name' => esc_html__( 'Forms', 'give' ),
76 'type' => 'report_forms',
77 ),
78 array(
79 'id' => 'give_reports_forms',
80 'type' => 'sectionend',
81 'table_html' => false,
82 ),
83 )
84 );
85
86 // Output.
87 return $settings;
88 }
89
90 /**
91 * Render report forms field
92 *
93 * @since 1.8
94 * @access public
95 *
96 * @param $field
97 * @param $option_value
98 */
99 public function render_report_forms_field( $field, $option_value ) {
100 do_action( 'give_reports_view_forms' );
101 }
102 }
103
104 endif;
105
106 return new Give_Forms_Report();
107