This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This filter function creates a variable from Usermeta to be used with PMPro emails. | |
* | |
* The function returns a variable prepared for the special html syntax within PMPro emails. In this example, the value of the array key 'favorite_color' is returned and can be used in emails with the html placeholder !!favorite_color!!. | |
*/ | |
function pmpro_usermeta_in_email_data( $usermeta, $email ) { | |
global $current_user; | |
$usermeta['favorite_color'] = get_user_meta( $current_user->ID, 'favorite_color', false ); | |
return $usermeta[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php # -*- coding: utf-8 -*- | |
declare( encoding = 'UTF-8' ); | |
/** | |
* Plugin Name: Basic Meta Box | |
* Description: Create a simple meta box. Demo plugin. | |
* Version: 2012.02.05 | |
* Required: 3.3 | |
* Author: Thomas Scholz | |
* Author URI: http://toscho.de | |
* License: GPL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Use this recipe in combination with MyCRED to award points to members when signing up | |
for Level 1 membership. This code gist could be customized to give points for another | |
membership level ID, award recurring points for each subscription payment, and more. | |
MyCRED can be downloaded/configured here: https://wordpress.org/plugins/mycred/ | |
*/ | |
// Register Hook for PMPro Membership Points at Signup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: ACF Customizer Patch | |
Plugin URI: https://gist.github.com/fabrizim/9c0f36365f20705f7f73 | |
Description: A class to allow acf widget fields to be stored with normal widget settings and allow for use in customizer. | |
Author: Mark Fabrizio | |
Version: 1.0 | |
Author URI: http://owlwatch.com/ | |
*/ | |
class acf_customizer_patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Enqueue the stylesheet. | |
* http://aristeides.com/blog/modifying-wordpress-customizer/ | |
*/ | |
function my_enqueue_customizer_stylesheet() { | |
wp_register_style( 'my-customizer-css', YOUR_PLUGIN_URL. 'assets/css/customizer.css', NULL, NULL, 'all' ); | |
wp_enqueue_style( 'my-customizer-css' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This will check for !!company_name!! in the emails body and replace it with the 'company_name' metadata (created by Register Helper). | |
* Add this code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_email_body( $body, $email ) { | |
//only checkout emails + strict comparison | |
if ( false !== strpos( $email->template, 'checkout' ) ) { | |
global $current_user; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The function some_kind_of_pmpro_redirection is an arbitrary name given to the | |
* function created to run this specific bit of code. You can name it anything | |
* meaningful that you like, assuming that it is unique to the code on the site. | |
* | |
* The name of the filter hook, however, is not arbitrary as this is something | |
* created by the PMPro plugin. In this case, pmpro_confirmation_url, tells | |
* WordPress when to run this code in the some_kind_of_pmpro_redirection function. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//opcache_reset(); // Disable local dev MAMP cache | |
/* | |
WP_API_OAuth_Test_client.php | |
Tested with Wordpress 4.7.1 | |
WordPress REST API - OAuth 1.0a Server v.0.3.0 - https://en-gb.wordpress.org/plugins/rest-api-oauth1/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change content of Checkout email based on membership level. | |
* | |
* @param string $body The contents of the email is a string of text that you can adjust here as you see fit or pull from another custom function. | |
* @param object $email This is the php object from which we extracting the appropriate level and to which we'll add the new email content. | |
* @return string Whichever condition applies in the function below will determine what string is supplied to the email object. If none of the conditions are met, the return string will be the original message content. | |
*/ | |
function pmpro_adjust_email_content_to_level_checkout( $body, $email ) { |