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 / 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 verygoodplugins/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
@w3guy
w3guy / README.md
Created December 16, 2017 21:07 — forked from johnpbloch/README.md
A bash script to make .pot files for WordPress plugins

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

@w3guy
w3guy / README.md
Created December 16, 2017 21:03 — forked from r-a-y/README.md

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"