Skip to content

Instantly share code, notes, and snippets.

View w3guy's full-sized avatar
✍️
Typing...

Collins Agbonghama w3guy

✍️
Typing...
View GitHub Profile
@w3guy
w3guy / a.md
Created August 23, 2025 21:22 — forked from ericandrewlewis/a.md
The WordPress Customizer

The WordPress Customizer

The WordPress Customizer is an interface for drafting changes to content while previewing the changes before they are saved. This is an alternative to the "save and suprise" model of changing settings without knowing what exactly will happen.

The customizer can be accessed in the admin interface under Appearance > Customize.

A screenshot of the customizer

#19909 is the trac ticket that introduced the Customizer during the 3.4 release cycle.

@w3guy
w3guy / edd-refund-column.php
Created August 12, 2025 06:31 — forked from zackkatz/edd-refund-column.php
EDD Refund Column - Adds a “Request Refund” column to the Easy Digital Downloads purchase history table
<?php
/**
* Plugin Name: EDD Refund Column
* Description: Adds a “Request Refund” column to the Easy Digital Downloads purchase history table that links to a refund page with the Order ID.
* Author: Your Name
* Version: 1.3.0
* Requires at least: 6.0
* Requires PHP: 7.4
* License: GPL-2.0-or-later
*
@w3guy
w3guy / make-pot.sh
Created March 6, 2024 09:40 — forked from UVLabs/make-pot.sh
Using WordPress makepot.php to generate pot file used for the internationalization of your plugin or theme.
#!/bin/bash
php path/to/makepot.php wp-plugin /path/to/your/plugin pluginname.pot
#php path/to/makepot.php wp-theme /path/to/your/theme themename.pot
@w3guy
w3guy / edd-custom-cancel.php
Created November 1, 2022 16:03 — forked from jack-arturo/edd-custom-cancel.php
Modifies the Easy Digital Downloads cancellation link to point to a custom "Confirm cancellation" page
<?php
/**
* Modify the EDD cancel URL to point custom cancellation page.
*
* @param string $url The cancel URL.
* @param EDD_Subscription $subscription The subscription.
*/
function wpf_edd_subscription_cancel_url( $url, $subscription ) {
@w3guy
w3guy / edd_perpetual_discounts.php
Created April 17, 2022 14:48 — forked from polevaultweb/edd_perpetual_discounts.php
EDD - Allow discounts to be set to apply to all renewals
<?php
add_filter( 'edd_update_discount', 'edd_perpetual_discounts_add_meta' );
add_filter( 'edd_insert_discount', 'edd_perpetual_discounts_add_meta' );
add_action( 'edd_edit_discount_form_before_use_once', 'edd_perpetual_discounts_setting', 10, 2 );
add_filter( 'edd_get_option_recurring_one_time_discounts', 'edd_perpetual_discounts_discounts' );
function edd_perpetual_discounts_add_meta( $meta ) {
$meta['use_renewals'] = 0;
@w3guy
w3guy / user_meta_key.php
Created July 20, 2020 10:42 — forked from zourbuth/user_meta_key.php
Get All WordPress User Meta Keys
<?php
/**
* Returns all unique meta key from user meta database
*
* @param no parameter right now
* @retun std Class
* @todo do what you do for each meta key.
*/
function get_user_meta_key() {
@w3guy
w3guy / edd-run-a-sale.php
Created June 19, 2019 21:32 — forked from zackkatz/edd-run-a-sale.php
Easily run a sale in Easy Digital Downloads. This code applies a coupon globally.
<?php
// When not running a sale, just RETURN here. (but if you forget, no problem...)
# return;
// Pass the coupon code that you want applied as the global sale coupon
new GV_Theme_Sale( 'SOLSTICE2019' );
class GV_Theme_Sale {
@w3guy
w3guy / commercial-client.php
Created November 7, 2018 13:26 — forked from pento/commercial-client.php
Sample Commercial Plugin update server and client
<?php
/*
* Plugin Name: Commercial Client
* Plugin URI: http://pento.net/
* Description: A sample client plugin for showing updates for non-WordPress.org plugins
* Author: pento
* Version: 0.1
* Author URI: http://pento.net/
* License: GPL2+
*/
@w3guy
w3guy / cache_test.php
Created January 25, 2018 20:30 — forked from ideadude/cache_test.php
PHP Script to Use for Testing Server Caching
<?php
$now = date('Y-m-d H:i:s', time())
?>
<html><head><title>Cache Test (<?php echo $now;?>)</title></head>
<body>
<h1>Cache Test</h1>
<p><?php echo 'Time right now: <strong>' . $now . '</strong>'; ?>
</p>
<p>If this doesn't refresh on page load, then something is caching this page.</p>
<p>You can try adding ?t=arandomnumberorstring to the end of the URL to break the cache. You'll see the current time.</p>
@w3guy
w3guy / example-paypal-ipn-payloads.txt
Created January 11, 2018 18:43 — forked from thenbrent/example-paypal-ipn-payloads.txt
PayPal Standard & Express Checkout Subscription Related IPN Messages (from Sandbox)
-------------------------------------
PayPal Standard Subscription Sign-up
-------------------------------------
[txn_type] => subscr_signup
[subscr_id] => I-NARPL1C0KAHA
[last_name] => User
[residence_country] => US
[mc_currency] => AUD
[item_name] => Digital Subscription