| Server IP : 172.67.71.254 / Your IP : 216.73.216.4 Web Server : nginx/1.27.1 System : Linux in-5 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : arabianexpress ( 1872) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /storage/v9321/buzzbitesv3/public_html/wp-content/themes/bite/plugins/give/ |
Upload File : |
<?php
/* Give (donation forms) support functions
------------------------------------------------------------------------------- */
if ( ! defined( 'BITE_GIVE_FORMS_PT_FORMS' ) ) define( 'BITE_GIVE_FORMS_PT_FORMS', 'give_forms' );
if ( ! defined( 'BITE_GIVE_FORMS_PT_PAYMENT' ) ) define( 'BITE_GIVE_FORMS_PT_PAYMENT', 'give_payment' );
if ( ! defined( 'BITE_GIVE_FORMS_TAXONOMY_CATEGORY' ) ) define( 'BITE_GIVE_FORMS_TAXONOMY_CATEGORY', 'give_forms_category' );
if ( ! defined( 'BITE_GIVE_FORMS_TAXONOMY_TAG' ) ) define( 'BITE_GIVE_FORMS_TAXONOMY_TAG', 'give_forms_tag' );
// Theme init priorities:
// 3 - add/remove Theme Options elements
if ( ! function_exists( 'bite_give_theme_setup3' ) ) {
add_action( 'after_setup_theme', 'bite_give_theme_setup3', 3 );
function bite_give_theme_setup3() {
if ( bite_exists_give() ) {
// Section 'Give'
bite_storage_merge_array(
'options', '', array_merge(
array(
'give' => array(
'title' => esc_html__( 'Give Donations', 'bite' ),
'desc' => wp_kses_data( __( 'Select parameters to display the Give Donations pages', 'bite' ) ),
'icon' => 'icon-donation',
'type' => 'section',
),
),
bite_options_get_list_cpt_options( 'give', esc_html__( 'Give Donations', 'bite' ) )
)
);
}
}
}
// Theme init priorities:
// 9 - register other filters (for installer, etc.)
if ( ! function_exists( 'bite_give_theme_setup9' ) ) {
add_action( 'after_setup_theme', 'bite_give_theme_setup9', 9 );
function bite_give_theme_setup9() {
if ( bite_exists_give() ) {
add_action( 'wp_enqueue_scripts', 'bite_give_frontend_scripts', 1100 );
add_action( 'trx_addons_action_load_scripts_front_give', 'bite_give_frontend_scripts', 10, 1 );
add_filter( 'bite_filter_merge_styles', 'bite_give_merge_styles' );
add_filter( 'bite_filter_get_post_categories', 'bite_give_get_post_categories', 10, 2 );
add_filter( 'bite_filter_post_type_taxonomy', 'bite_give_post_type_taxonomy', 10, 2 );
add_filter( 'bite_filter_detect_blog_mode', 'bite_give_detect_blog_mode' );
add_filter( 'give_get_locate_template', 'bite_give_get_locate_template', 100, 3 );
add_filter( 'give_get_template_part', 'bite_give_get_template_part', 100, 3 );
add_filter( 'trx_addons_filter_elementor_animate_items', 'bite_give_elementor_animate_items', 10, 1 );
}
if ( is_admin() ) {
add_filter( 'bite_filter_tgmpa_required_plugins', 'bite_give_tgmpa_required_plugins' );
}
}
}
// Filter to add in the required plugins list
if ( ! function_exists( 'bite_give_tgmpa_required_plugins' ) ) {
//Handler of the add_filter('bite_filter_tgmpa_required_plugins', 'bite_give_tgmpa_required_plugins');
function bite_give_tgmpa_required_plugins( $list = array() ) {
if ( bite_storage_isset( 'required_plugins', 'give' ) && bite_storage_get_array( 'required_plugins', 'give', 'install' ) !== false ) {
$list[] = array(
'name' => bite_storage_get_array( 'required_plugins', 'give', 'title' ),
'slug' => 'give',
'required' => false,
);
}
return $list;
}
}
// Check if plugin installed and activated
if ( ! function_exists( 'bite_exists_give' ) ) {
function bite_exists_give() {
return class_exists( 'Give' );
}
}
// Enqueue styles for frontend
if ( ! function_exists( 'bite_give_frontend_scripts' ) ) {
//Handler of the add_action( 'wp_enqueue_scripts', 'bite_give_frontend_scripts', 1100 );
//Handler of the add_action( 'trx_addons_action_load_scripts_front_give', 'bite_give_frontend_scripts', 10, 1 );
function bite_give_frontend_scripts( $force = false ) {
bite_enqueue_optimized( 'give', $force, array(
'css' => array(
'bite-give' => array( 'src' => 'plugins/give/give.css' ),
)
) );
}
}
// Merge custom styles
if ( ! function_exists( 'bite_give_merge_styles' ) ) {
//Handler of the add_filter('bite_filter_merge_styles', 'bite_give_merge_styles');
function bite_give_merge_styles( $list ) {
$list[ 'plugins/give/give.css' ] = false;
return $list;
}
}
// Return true, if current page is any give page
if ( ! function_exists( 'bite_is_give_page' ) ) {
function bite_is_give_page() {
$rez = false;
if ( bite_exists_give() && ! is_search() ) {
$page_id = is_page() ? get_the_ID() : 0;
$rez = ( bite_is_single() && in_array( get_query_var('post_type'), array( BITE_GIVE_FORMS_PT_FORMS, BITE_GIVE_FORMS_PT_PAYMENT ) ) )
|| bite_check_url( array( 'donation', 'donor' ) )
|| is_post_type_archive( BITE_GIVE_FORMS_PT_FORMS )
|| is_tax( BITE_GIVE_FORMS_TAXONOMY_CATEGORY )
|| is_tax( BITE_GIVE_FORMS_TAXONOMY_TAG )
|| ( function_exists( 'is_give_form' ) && is_give_form() )
|| ( function_exists( 'is_give_category' ) && is_give_category() )
|| ( function_exists( 'is_give_tag' ) && is_give_tag() )
|| ( $page_id > 0 && function_exists( 'give_get_option' )
&& ( give_get_option( 'success_page' ) == $page_id
|| give_get_option( 'failure_page' ) == $page_id
|| give_get_option( 'history_page' ) == $page_id
|| give_get_option( 'donor_dashboard_page' ) == $page_id
|| give_get_option( 'subscriptions_page' ) == $page_id
|| ( function_exists( 'give_is_campaign_page' ) && give_is_campaign_page() )
)
);
}
return $rez;
}
}
// Detect current blog mode
if ( ! function_exists( 'bite_give_detect_blog_mode' ) ) {
//Handler of the add_filter( 'bite_filter_detect_blog_mode', 'bite_give_detect_blog_mode' );
function bite_give_detect_blog_mode( $mode = '' ) {
if ( bite_is_give_page() ) {
$mode = 'give';
}
return $mode;
}
}
// Return taxonomy for current post type
if ( ! function_exists( 'bite_give_post_type_taxonomy' ) ) {
//Handler of the add_filter( 'bite_filter_post_type_taxonomy', 'bite_give_post_type_taxonomy', 10, 2 );
function bite_give_post_type_taxonomy( $tax = '', $post_type = '' ) {
if ( bite_exists_give() && BITE_GIVE_FORMS_PT_FORMS == $post_type ) {
$tax = BITE_GIVE_FORMS_TAXONOMY_CATEGORY;
}
return $tax;
}
}
// Show categories of the current product
if ( ! function_exists( 'bite_give_get_post_categories' ) ) {
//Handler of the add_filter( 'bite_filter_get_post_categories', 'bite_give_get_post_categories', 10, 2 );
function bite_give_get_post_categories( $cats = '', $args = array() ) {
if ( get_post_type() == BITE_GIVE_FORMS_PT_FORMS ) {
$cat_sep = apply_filters(
'bite_filter_post_meta_cat_separator',
'<span class="post_meta_item_cat_separator">' . ( ! isset( $args['cat_sep'] ) || ! empty( $args['cat_sep'] ) ? ', ' : ' ' ) . '</span>',
$args
);
$cats = bite_get_post_terms( $cat_sep, get_the_ID(), BITE_GIVE_FORMS_TAXONOMY_CATEGORY );
}
return $cats;
}
}
// Search skin-specific templates in the skin dir (if exists)
if ( ! function_exists( 'bite_give_get_locate_template' ) ) {
//Handler of the add_filter( 'give_get_locate_template', 'bite_give_get_locate_template', 100, 3 );
function bite_give_get_locate_template( $template, $template_name, $template_path ) {
$folders = apply_filters( 'bite_filter_give_locate_template_folders', array(
$template_path,
'plugins/give/templates'
) );
foreach ( $folders as $f ) {
$theme_dir = apply_filters( 'bite_filter_get_theme_file_dir', '', trailingslashit( bite_esc( $f ) ) . $template_name );
if ( '' != $theme_dir ) {
$template = $theme_dir;
break;
}
}
return $template;
}
}
// Search skin-specific templates parts in the skin dir (if exists)
if ( ! function_exists( 'bite_give_get_template_part' ) ) {
//Handler of the add_filter( 'give_get_template_part', 'bite_give_get_template_part', 100, 3 );
function bite_give_get_template_part( $template, $slug, $name ) {
$folders = apply_filters( 'bite_filter_give_get_template_part_folders', array(
'give',
'plugins/give/templates'
) );
foreach ( $folders as $f ) {
$theme_dir = apply_filters( 'bite_filter_get_theme_file_dir', '', trailingslashit( bite_esc( $f ) ) . "{$slug}-{$name}.php" );
if ( '' != $theme_dir ) {
$template = $theme_dir;
break;
}
$theme_dir = apply_filters( 'bite_filter_get_theme_file_dir', '', trailingslashit( bite_esc( $f ) ) . "{$slug}.php" );
if ( '' != $theme_dir ) {
$template = $theme_dir;
break;
}
}
return $template;
}
}
// Add Give items to the separate animation list
if ( ! function_exists( 'bite_give_elementor_animate_items' ) ) {
add_filter( 'trx_addons_filter_elementor_animate_items', 'bite_give_elementor_animate_items', 10, 1 );
function bite_give_elementor_animate_items( $list ) {
if ( is_array( $list ) && ! in_array( '.give-grid__item', $list ) ) {
$list[] = '.give-grid__item';
}
return $list;
}
}
// Add plugin-specific colors and fonts to the custom CSS
if ( bite_exists_give() ) {
$bite_fdir = bite_get_file_dir( 'plugins/give/give-style.php' );
if ( ! empty( $bite_fdir ) ) {
require_once $bite_fdir;
}
}