PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.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.7.0, at includes/admin/views/settings/settings.php

115 lines 3.1 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) 2022, 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 $group = isset( $_GET['group'] ) ? $_GET['group'] : $active_tab;
15 $sections = charitable_get_admin_settings()->get_sections();
16 $show_return = $group != $active_tab;
17
18 if ( $show_return ) {
19 /**
20 * Filter the return link text.
21 *
22 * @since 1.6.19
23 *
24 * @param string $default The default return link text.
25 * @param string $active_tab The active tab.
26 * @param string $group The current group.
27 */
28 $return_tab_text = apply_filters(
29 'charitable_settings_return_tab_text',
30 sprintf(
31 /* translators: %s: tab name */
32 __( '&#8592; Return to %s', 'charitable' ),
33 $active_tab
34 ),
35 $active_tab,
36 $group
37 );
38
39 /**
40 * Filter the return link URL.
41 *
42 * @since 1.6.19
43 *
44 * @param string $default The default return link URL
45 * @param string $active_tab The active tab.
46 * @param string $group The current group.
47 */
48 $return_tab_url = apply_filters(
49 'charitable_settings_return_tab_url',
50 add_query_arg(
51 array( 'tab' => $active_tab ),
52 admin_url( 'admin.php?page=charitable-settings' )
53 ),
54 $active_tab,
55 $group
56 );
57 }
58
59 ob_start();
60 ?>
61 <div id="charitable-settings" class="wrap">
62 <h1 class="screen-reader-text"><?php echo get_admin_page_title(); ?></h1>
63 <h1><?php echo get_admin_page_title(); ?></h1>
64 <h2 class="nav-tab-wrapper">
65 <?php foreach ( $sections as $tab => $name ) : ?>
66 <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>
67 <?php endforeach ?>
68 </h2>
69 <?php if ( $show_return ) : ?>
70 <?php /* translators: %s: active settings tab label */ ?>
71 <p><a href="<?php echo esc_url( $return_tab_url ); ?>"><?php echo $return_tab_text; ?></a></p>
72 <?php endif ?>
73 <?php
74 /**
75 * Do or render something right before the settings form.
76 *
77 * @since 1.0.0
78 *
79 * @param string $group The settings group we are viewing.
80 */
81 do_action( 'charitable_before_admin_settings', $group );
82 ?>
83 <form method="post" action="options.php">
84 <table class="form-table">
85 <?php
86 settings_fields( 'charitable_settings' );
87
88 charitable_do_settings_fields( 'charitable_settings_' . $group, 'charitable_settings_' . $group );
89 ?>
90 </table>
91 <?php
92 /**
93 * Filter the submit button at the bottom of the settings table.
94 *
95 * @since 1.6.0
96 *
97 * @param string $button The button output.
98 */
99 echo apply_filters( 'charitable_settings_button_' . $group, get_submit_button( null, 'primary', 'submit', true, null ) );
100 ?>
101 </form>
102 <?php
103 /**
104 * Do or render something right after the settings form.
105 *
106 * @since 1.0.0
107 *
108 * @param string $group The settings group we are viewing.
109 */
110 do_action( 'charitable_after_admin_settings', $group );
111 ?>
112 </div>
113 <?php
114 echo ob_get_clean();
115