This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a fee when the user checks out with PayPal | |
*/ | |
function wcfad_apply_payment_gateway_fee() { | |
$payment_method = WC()->session->get( 'chosen_payment_method' ); | |
// Only apply the fee if the payment gateway is PayPal | |
// Note that you might need to check this slug, depending on the PayPal gateway you're using | |
if( $payment_method == 'ppec_paypal' ) { | |
$label = __( 'PayPal fee', 'wcfad' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @constant string THEME_NAME **/ | |
define( 'THEME_NAME', get_option('stylesheet') ); | |
/** | |
* Custom script | |
*/ | |
function my_scripts_method() { | |
wp_enqueue_script( | |
'custom-script', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum HttpHeader { | |
AUTHORIZATION("Authorization"), | |
AUTHENTICATION_TYPE_BASIC("Basic"), | |
X_AUTH_TOKEN("X-AUTH-TOKEN"), | |
WWW_Authenticate("WWW-Authenticate"), | |
X_FORWARDED_FOR("X-Forwarded-For"), | |
PROXY_CLIENT_IP("Proxy-Client-IP"), | |
WL_PROXY_CLIENT_IP("WL-Proxy-Client-IP"), | |
HTTP_CLIENT_IP("HTTP_CLIENT_IP"), | |
HTTP_X_FORWARDED_FOR("HTTP_X_FORWARDED_FOR"); |