$64 GRAYBYTE WORDPRESS FILE MANAGER $70

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravrvjk/itiministry.org/wp-content/plugins/give/includes/admin/

HOME
Current File : /home/bravrvjk/itiministry.org/wp-content/plugins/give/includes/admin//admin-filters.php
<?php
/**
 * Admin Filters
 *
 * @package     Give
 * @subpackage  Admin/Filters
 * @copyright   Copyright (c) 2016, GiveWP
 * @license     https://opensource.org/licenses/gpl-license GNU Public License
 * @since       1.0
 */

// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Sanitize number of decimals setting field.
 *
 *  1. User can only set absolute integer value as number of decimals.
 *  2. number_decimals setting will be zero if no decimal separator defined
 *
 * @since 4.9.0 rename function - PHP 8 compatibility
 * @since   1.8
 * @used-by Give_Plugin_Settings::give_settings()
 *
 * @param   string $value
 *
 * @return  mixed
 */
function give_sanitize_number_decimals_setting_field( $value ) {
	$value_changed = false;
	$show_notice   = false;
	$old_value     = $value;

	if ( isset( $_POST['decimal_separator'] ) ) {
		$value         = ! empty( $_POST['decimal_separator'] ) ? $value : 0;
		$value_changed = true;
	}

	if ( $value_changed && ( $old_value !== $value ) ) {
		Give_Admin_Settings::add_error( 'give-number-decimal', __( 'The \'Number of Decimals\' option has been automatically set to zero because the \'Decimal Separator\' is not set.', 'give' ) );
	}

	$value                      = absint( $value );
	$is_currency_set_to_bitcoin = ( 'XBT' === give_get_option( 'currency' ) && ! isset( $_POST['currency'] ) ) || 'XBT' === $_POST['currency'];

	if ( $is_currency_set_to_bitcoin && 8 < $value ) {
		$value       = 8;
		$show_notice = true;
	} elseif ( ! $is_currency_set_to_bitcoin && 6 <= $value ) {
		$value       = 5;
		$show_notice = true;
	}

	if ( $show_notice ) {
		Give_Admin_Settings::add_error(
			'give-number-decimal',
			sprintf(
				__( 'The \'Number of Decimals\' option has been automatically set to %s because you entered a number higher than the maximum allowed.', 'give' ),
				$value
			)
		);
	}

	return absint( $value );
}

add_filter( 'give_admin_settings_sanitize_option_number_decimals', 'give_sanitize_number_decimals_setting_field', 10 );


/**
 * Sanitize number of decimals setting field.
 *
 *  1. User can only set absolute integer value as number of decimals.
 *  2. number_decimals setting will be zero if no decimal separator defined
 *
 * @since 4.9.0 rename function - PHP 8 compatibility
 * @since   1.8
 * @used-by Give_Plugin_Settings::give_settings()
 *
 * @param   string $value
 *
 * @return  mixed
 */
function give_validate_decimal_separator_setting_field( $value ) {
	$thousand_separator = isset( $_POST['thousands_separator'] ) ? give_clean( $_POST['thousands_separator'] ) : '';
	$decimal_separator  = isset( $_POST['decimal_separator'] ) ? give_clean( $_POST['decimal_separator'] ) : '';

	if ( $decimal_separator === $thousand_separator ) {
		$value                    = '';
		$_POST['number_decimals'] = 0;
		Give_Admin_Settings::add_error( 'give-decimal-separator', __( 'The \'Decimal Separator\' option has automatically been set to empty because it can not be equal to the \'Thousand Separator\'', 'give' ) );
	}

	return $value;
}

add_filter( 'give_admin_settings_sanitize_option_decimal_separator', 'give_validate_decimal_separator_setting_field', 10 );

/**
 * Change $delimiter text to symbol.
 *
 * @since 4.9.0 rename function - PHP 8 compatibility
 * @since 1.8.14
 *
 * @param string $delimiter
 *
 * @return string $delimiter.
 */
function give_import_delimiter_set_callback( $delimiter ) {
	$delimite_type = array(
		'csv'                  => ',',
		'tab-separated-values' => "\t",
	);

	return ( array_key_exists( $delimiter, $delimite_type ) ? $delimite_type[ $delimiter ] : ',' );
}

add_filter( 'give_import_delimiter_set', 'give_import_delimiter_set_callback', 10 );

/**
 * Give unset the page id from the core setting data from the json files.
 *
 * @since 1.8.17
 *
 * @param array  $json_to_array Data from json file
 * @param string $type
 *
 * @return array $json_to_array
 */
function give_import_core_settings_merge_pages( $json_to_array, $type ) {
	if ( 'merge' === $type ) {
		unset( $json_to_array['success_page'] );
		unset( $json_to_array['failure_page'] );
		unset( $json_to_array['history_page'] );
	}

	return $json_to_array;
}

add_filter( 'give_import_core_settings_data', 'give_import_core_settings_merge_pages', 11, 2 );

/**
 * Give check the image size from the core setting data from the json files.
 *
 * @since 1.8.17
 *
 * @param $json_to_array
 * @param string        $type
 *
 * @return array $json_to_array
 */
function give_import_core_settings_merge_image_size( $json_to_array, $type ) {
	if ( 'merge' === $type ) {
		// Featured image sizes import under Display Options > Post Types > Featured Image Size.
		if (
			! empty( $json_to_array['form_featured_img'] )
			&& ! empty( $json_to_array['featured_image_size'] )
			&& give_is_setting_enabled( $json_to_array['form_featured_img'] )
		) {
			$images_sizes = get_intermediate_image_sizes();

			if ( ! in_array( $json_to_array['featured_image_size'], $images_sizes, true ) ) {
				unset( $json_to_array['featured_image_size'] );
			}
		}
	}

	return $json_to_array;
}

add_filter( 'give_import_core_settings_data', 'give_import_core_settings_merge_image_size', 12, 2 );

/**
 * Give upload the image logo from the core setting data from the json files.
 *
 * @since 1.8.17
 *
 * @param $json_to_array
 * @param string        $type
 *
 * @return array $json_to_array
 */
function give_import_core_settings_merge_upload_image( $json_to_array, $type ) {
	if ( 'merge' === $type ) {
		// Emails > Email Settings > Logo.
		if ( ! empty( $json_to_array['email_logo'] ) ) {

			// Need to require these files.
			if ( ! function_exists( 'media_handle_upload' ) ) {
				require_once ABSPATH . 'wp-admin/includes/image.php';
				require_once ABSPATH . 'wp-admin/includes/file.php';
				require_once ABSPATH . 'wp-admin/includes/media.php';
			}

			$url     = $json_to_array['email_logo'];
			$new_url = media_sideload_image( $url, 0, null, 'src' );
			if ( ! is_wp_error( $new_url ) ) {
				$json_to_array['email_logo'] = $new_url;
			} else {
				unset( $json_to_array['email_logo'] );
			}
		}
	}

	return $json_to_array;
}

add_filter( 'give_import_core_settings_data', 'give_import_core_settings_merge_upload_image', 13, 2 );

/**
 * Give unset the license key from the core setting data from the json files.
 *
 * @since 1.8.17
 *
 * @param array  $json_to_array Data from json file
 * @param string $type
 *
 * @return array $json_to_array
 */
function give_import_core_settings_merge_license_key( $json_to_array, $type ) {
	if ( 'merge' === $type ) {
		foreach ( $json_to_array as $key => $value ) {
			$is_license_key = strpos( '_license_key', $key );
			if ( ! empty( $is_license_key ) ) {
				unset( $json_to_array[ $key ] );
			}
		}
	}

	return $json_to_array;
}

add_filter( 'give_import_core_settings_data', 'give_import_core_settings_merge_license_key', 14, 2 );

/**
 * Give merge the json data and setting data.
 *
 * @since 1.8.17
 *
 * @param $json_to_array
 * @param $type
 * @param $host_give_options
 *
 * @return array $json_to_array
 */
function give_import_core_settings_merge_data( $json_to_array, $type, $host_give_options ) {
	if ( 'merge' === $type ) {
		$json_to_array_merge = array_merge( $host_give_options, $json_to_array );
		$json_to_array       = $json_to_array_merge;
	}

	return $json_to_array;
}

add_filter( 'give_import_core_settings_data', 'give_import_core_settings_merge_data', 1000, 3 );

/**
 * Backward Compatibility - Cleanup User Roles.
 *
 * @param array $caps List of capabilities.
 *
 * @since 1.8.17
 *
 * @return mixed
 */
function give_bc_1817_cleanup_user_roles( $caps ) {

	if (
		! give_has_upgrade_completed( 'v1817_cleanup_user_roles' ) &&
		! isset( $caps['view_give_payments'] )
	) {
		give_v1817_process_cleanup_user_roles();
	}

	return $caps;
}

add_filter( 'user_has_cap', 'give_bc_1817_cleanup_user_roles' );


Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
add-ons
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
donors
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
emails
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
forms
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
payments
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
reports
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
settings
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
shortcodes
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
tools
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
upgrades
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
views
--
4 Apr 2026 1.57 AM
bravrvjk / bravrvjk
0755
abstract-admin-settings-page.php
6.561 KB
11 Jan 2024 12.22 AM
bravrvjk / bravrvjk
0644
admin-actions.php
50.273 KB
28 Jan 2026 8.00 PM
bravrvjk / bravrvjk
0644
admin-filters.php
7.7 KB
17 Sep 2025 8.52 PM
bravrvjk / bravrvjk
0644
admin-footer.php
1.113 KB
16 Oct 2023 9.55 PM
bravrvjk / bravrvjk
0644
admin-pages.php
11.103 KB
28 Jan 2026 8.00 PM
bravrvjk / bravrvjk
0644
class-addon-activation-banner.php
21.372 KB
17 Sep 2025 8.52 PM
bravrvjk / bravrvjk
0644
class-admin-settings.php
44.063 KB
16 Apr 2025 5.25 PM
bravrvjk / bravrvjk
0644
class-api-keys-table.php
8.451 KB
17 Jun 2022 4.03 AM
bravrvjk / bravrvjk
0644
class-blank-slate.php
8.331 KB
31 Mar 2025 11.17 PM
bravrvjk / bravrvjk
0644
class-give-admin.php
4.951 KB
23 Mar 2021 1.24 AM
bravrvjk / bravrvjk
0644
class-give-html-elements.php
24.235 KB
11 Jun 2025 10.57 PM
bravrvjk / bravrvjk
0644
class-i18n-module.php
8.507 KB
30 Jun 2022 3.03 AM
bravrvjk / bravrvjk
0644
dashboard-widgets.php
1.279 KB
9 Jun 2023 1.23 AM
bravrvjk / bravrvjk
0644
give-metabox-functions.php
59.676 KB
21 Oct 2022 1.34 AM
bravrvjk / bravrvjk
0644
import-functions.php
35.817 KB
9 Jul 2025 5.09 PM
bravrvjk / bravrvjk
0644
misc-functions.php
9.052 KB
4 Oct 2023 8.16 PM
bravrvjk / bravrvjk
0644
plugins.php
16.611 KB
1 Oct 2025 3.37 PM
bravrvjk / bravrvjk
0644
setting-page-functions.php
1.651 KB
20 Sep 2019 4.29 AM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF