export_type . '-' . date( 'n' ) . '-' . date( 'Y' ) ) . '.json' ); header( 'Expires: 0' ); } /** * Prints Give's core settings in JSON format * * @access public * @since 1.8.17 */ public function json_core_settings_export() { $settings_excludes = isset( $_POST['settings_export_excludes'] ) ? give_clean( $_POST['settings_export_excludes'] ) : array(); $give_settings = Give_Cache_Setting::get_settings(); if ( is_array( $settings_excludes ) && ! empty( $settings_excludes ) ) { foreach ( $settings_excludes as $key => $value ) { if ( give_is_setting_enabled( $value ) ) { unset( $give_settings[ $key ] ); } } } echo wp_json_encode( $give_settings ); } /** * Get the Export Data * * @access public * @since 1.8.17 */ public function export() { if ( ! $this->can_export() ) { wp_die( esc_html__( 'You do not have permission to export data.', 'give' ), esc_html__( 'Error', 'give' ), array( 'response' => 403 ) ); } // Set headers. $this->headers(); $this->json_core_settings_export(); give_die(); } }