PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.0
1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 1.7.0.9 1.8.0 All 210 releases
charitable / includes / admin / views / settings / settings.php

settings.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.8.0, at includes/admin/views/settings/settings.php

125 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Display the main settings page wrapper.
4 *
5 * @author David Bisset
6 * @package Charitable/Admin View/Settings
7 * @copyright Copyright (c) 2023, WP Charitable LLC
8 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 * @since 1.0.0
10 * @version 1.6.19
11 */
12
13 $active_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'general';
14 $tab_no_form_tag = array ('import', 'export', 'tools' );
15 $group = isset( $_GET['group'] ) ? $_GET['group'] : $active_tab;
16 $sections = charitable_get_admin_settings()->get_sections();
17 $show_return = $group != $active_tab;
18
19 if ( $show_return ) {
20 /**
21 * Filter the return link text.
22 *
23 * @since 1.6.19
24 *
25 * @param string $default The default return link text.
26 * @param string $active_tab The active tab.
27 * @param string $group The current group.
28 */
29 $return_tab_text = apply_filters(
30 'charitable_settings_return_tab_text',
31 sprintf(
32 /* translators: %s: tab name */
33 __( '&#8592; Return to %s', 'charitable' ),
34 $active_tab
35 ),
36 $active_tab,
37 $group
38 );
39
40 /**
41 * Filter the return link URL.
42 *
43 * @since 1.6.19
44 *
45 * @param string $default The default return link URL
46 * @param string $active_tab The active tab.
47 * @param string $group The current group.
48 */
49 $return_tab_url = apply_filters(
50 'charitable_settings_return_tab_url',
51 add_query_arg(
52 array( 'tab' => $active_tab ),
53 admin_url( 'admin.php?page=charitable-settings' )
54 ),
55 $active_tab,
56 $group
57 );
58 }
59
60 ob_start();
61 ?>
62 <div id="charitable-settings" class="wrap">
63 <h1 class="screen-reader-text"><?php echo get_admin_page_title(); ?></h1>
64 <h1><?php echo get_admin_page_title(); ?></h1>
65 <?php echo do_action( 'charitable_maybe_show_notification' ); ?>
66 <h2 class="nav-tab-wrapper">
67 <?php foreach ( $sections as $tab => $name ) : ?>
68 <a href="<?php echo esc_url( add_query_arg( array( 'tab' => $tab ), admin_url( 'admin.php?page=charitable-settings' ) ) ); ?>" class="nav-tab <?php echo $active_tab == $tab ? 'nav-tab-active' : ''; ?>"><?php echo $name; ?></a>
69 <?php endforeach ?>
70 </h2>
71 <?php if ( $show_return ) : ?>
72 <?php /* translators: %s: active settings tab label */ ?>
73 <p><a href="<?php echo esc_url( $return_tab_url ); ?>"><?php echo $return_tab_text; ?></a></p>
74 <?php endif ?>
75 <?php
76 /**
77 * Do or render something right before the settings form.
78 *
79 * @since 1.0.0
80 *
81 * @param string $group The settings group we are viewing.
82 */
83 do_action( 'charitable_before_admin_settings', $group );
84 ?>
85 <?php if ( ! in_array( strtolower( $active_tab ), $tab_no_form_tag ) ) : ?>
86 <form method="post" action="options.php">
87 <?php endif; ?>
88 <table class="form-table">
89 <?php
90 if ( ! in_array( strtolower( $active_tab ), $tab_no_form_tag ) ) :
91 settings_fields( 'charitable_settings' );
92 endif;
93
94 charitable_do_settings_fields( 'charitable_settings_' . $group, 'charitable_settings_' . $group );
95 ?>
96 </table>
97 <?php if ( ! in_array( strtolower( $active_tab ), $tab_no_form_tag ) ) : ?>
98 <?php
99 /**
100 * Filter the submit button at the bottom of the settings table.
101 *
102 * @since 1.6.0
103 *
104 * @param string $button The button output.
105 */
106 echo apply_filters( 'charitable_settings_button_' . $group, get_submit_button( null, 'primary', 'submit', true, null ) );
107 ?>
108 <?php endif; ?>
109 <?php if ( ! in_array( strtolower( $active_tab ), $tab_no_form_tag ) ) : ?>
110 </form>
111 <?php endif; ?>
112 <?php
113 /**
114 * Do or render something right after the settings form.
115 *
116 * @since 1.0.0
117 *
118 * @param string $group The settings group we are viewing.
119 */
120 do_action( 'charitable_after_admin_settings', $group );
121 ?>
122 </div>
123 <?php
124 echo ob_get_clean();
125