Skip to content

Instantly share code, notes, and snippets.

View espiat's full-sized avatar
🎯
Focusing

DER SPANIER espiat

🎯
Focusing
View GitHub Profile
@espiat
espiat / add_move_payment_request_checkout_page.php
Created December 20, 2021 21:25 — forked from dougaitken/add_move_payment_request_checkout_page.php
Adds the Payment Request button (Apple Pay) on the checkout page then moves it to after the customer details (WooCommerce Stripe extension)
// Adds the Payment Request button (Apple Pay) on the checkout page then moves it to after the customer details.
// Replace `woocommerce_checkout_after_customer_details` with wherever you want to
add_filter( 'wc_stripe_show_payment_request_on_checkout', '__return_true' );
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 );
remove_action( 'woocommerce_checkout_before_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 );
add_action( 'woocommerce_checkout_after_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_html' ), 1 );
add_action( 'woocommerce_checkout_after_customer_details', array( WC_Stripe_Payment_Request::instance(), 'display_payment_request_button_separator_html' ), 2 );
@espiat
espiat / add-submenu-page_to_custom_post_type_example.php
Created March 9, 2022 13:54 — forked from Njengah/add-submenu-page_to_custom_post_type_example.php
Simple function to add submenu page to a custom post type menu in WordPress admin
<?php
// Hook
add_action('admin_menu', 'add_tutorial_cpt_submenu_example');
//Callback function
function add_tutorial_cpt_submenu_example(){
@espiat
espiat / acf-future-posts.php
Created March 10, 2022 10:59 — forked from aderaaij/acf-future-posts.php
Advanced Custom Fields datepicker: Show only events with a date of today or in the future. Extra comments from Pasnon @ ACF Forums: f you needed to, you could also play with the comparison date, which is the first array in meta_query, currently set to date("Y-m-d") which is today; if you were to make it date("Y-m-d", strtotime("-1 day")) you cou…
<?php
/*
* Display posts only from today and in the future:
* http://old.support.advancedcustomfields.com/discussion/6000/how-to-sort-posts-by-acf-date-and-display-only-future-posts
* by Pasnon
*/
$date_args = array(
'post_type' => 'events',
@espiat
espiat / functions.php
Created November 17, 2024 11:17 — forked from vielhuber/functions.php
cleverreach v3 api: add new recipient and send double opt in email #php #wordpress
// cleverreach api
$cleverreach = (object) [
'api_url' => 'https://rest.cleverreach.com',
'client_id' => 'xxxxxxxxxx',
'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'list_id' => 1337,
'form_id' => 1337,
'access_token' => null,
'email' => '[email protected]',
'source' => 'tld.com',
@espiat
espiat / wp-adv-admin-handbook.md
Created May 12, 2025 04:29 — forked from kasparsd/readme.md
WordPress handbooks as a single markdown file for LLMs (source https://developer.wordpress.org)

Advanced Administration Handbook

Source: https://developer.wordpress.org/advanced-administration/

Welcome to the WordPress Advanced Administration Handbook! Here you will find WordPress advanced documentation. Use the “Contents” menu on the left to navigate topics.

Why Advanced Administration?

Not all users who use WordPress have to know about technology, and therefore in its documentation should not appear either, and developers do not have to know certain advanced system configurations.