Skip to content

Instantly share code, notes, and snippets.

@sagalbot
sagalbot / bootstrap.php
Created April 1, 2017 22:50
Testing boilerplate for a WooCommerce extension.
<?php
/**
* PHPUnit bootstrap file
*
* @package Cli_Tests
*/
$wc = getenv( 'WC_TESTS_DIR' ) ? getenv( 'WC_TESTS_DIR' ) : '/tmp/woocommerce/tests';
$wp = getenv( 'WP_TESTS_DIR' ) ? getenv( 'WP_TESTS_DIR' ) : '/tmp/wordpress-tests-lib';
@carlodaniele
carlodaniele / custom_menu_admin.php
Last active May 26, 2022 20:32
A basic plugin showing how to add menu metaboxes to admin menu page
<?php
/**
* @package Custom_menu_admin
* @version 1.0
*/
/*
Plugin Name: Custom menu admin
Plugin URI: http://wordpress.org/extend/plugins/#
Description: This is an example plugin
Author: Carlo Daniele
@imath
imath / bp-custom.php
Created July 28, 2014 16:14
BuddyPress members directory : Filtrer selon meta_key/value ou trier selon meta_key
<?php
/**
* Tu peux tester en créant un fichier bp-custom.php dans ton répertoire plugins
* @see http://codex.buddypress.org/plugindev/bp-custom-php/
*/
/******************************************************************
* 1/ filter par rapport à un couple meta_key/meta_value
@strangerstudios
strangerstudios / update_currency_per_level.php
Created February 4, 2014 15:59
Change currencies depending on Paid Memberships Pro level. Add this code to your active theme's functions.php or a custom plugin. This is just an example that will need to be tweaked for your needs.
/*
Change currencies depending on Paid Memberships Pro level.
Add this code to your active theme's functions.php or a custom plugin.
This is just an example that will need to be tweaked for your needs.
Other places to look into swapping currencies:
* Levels page.
* Invoices page.
* In emails.
* In membership levels table in admin.