data
5 years ago
export
5 years ago
import
6 years ago
views
4 years ago
class-settings-api.php
6 years ago
class-settings-data.php
5 years ago
class-settings-export.php
6 years ago
class-settings-import.php
6 years ago
class-settings-logs.php
5 years ago
class-settings-system-info.php
6 years ago
class-settings-api.php
87 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Give Settings Page/Tab |
| 4 | * |
| 5 | * @package Give |
| 6 | * @subpackage Classes/Give_Settings_API |
| 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_Settings_API' ) ) : |
| 17 | |
| 18 | /** |
| 19 | * Give_Settings_API. |
| 20 | * |
| 21 | * @sine 1.8 |
| 22 | */ |
| 23 | class Give_Settings_API 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 = 'api'; |
| 37 | $this->label = esc_html__( 'API', 'give' ); |
| 38 | |
| 39 | parent::__construct(); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get settings array. |
| 44 | * |
| 45 | * @since 1.8 |
| 46 | * @return array |
| 47 | */ |
| 48 | public function get_settings() { |
| 49 | // Get settings. |
| 50 | $settings = apply_filters( |
| 51 | 'give_settings_api', |
| 52 | array( |
| 53 | array( |
| 54 | 'id' => 'give_tools_api', |
| 55 | 'type' => 'title', |
| 56 | 'table_html' => false, |
| 57 | ), |
| 58 | array( |
| 59 | 'id' => 'api', |
| 60 | 'name' => esc_html__( 'API', 'give' ), |
| 61 | 'type' => 'api', |
| 62 | ), |
| 63 | array( |
| 64 | 'id' => 'give_tools_api', |
| 65 | 'type' => 'sectionend', |
| 66 | 'table_html' => false, |
| 67 | ), |
| 68 | ) |
| 69 | ); |
| 70 | |
| 71 | /** |
| 72 | * Filter the settings. |
| 73 | * |
| 74 | * @since 1.8 |
| 75 | * @param array $settings |
| 76 | */ |
| 77 | $settings = apply_filters( 'give_get_settings_' . $this->id, $settings ); |
| 78 | |
| 79 | // Output. |
| 80 | return $settings; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | endif; |
| 85 | |
| 86 | return new Give_Settings_API(); |
| 87 |