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
#!/bin/bash | |
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux | |
## Thanks to Philipp Klaus | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "You have to run this script as Superuser!" | |
exit 1 | |
fi |
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
add_filter( 'app_message_headers', 'custom_headers' ); | |
function custom_headers( $message_headers ){ | |
$message_headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; | |
return $message_headers; | |
} | |
function follow_up( $value ) { | |
global $wpdb, $appointments; | |
$a = $appointments; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
function sv_free_checkout_fields() { | |
global $woocommerce ; | |
// Bail we're not at checkout, or if we're at checkout but payment is needed | |
if ( ! is_checkout() || ( is_checkout() && WC()->cart->needs_payment() ) ) { | |
return; | |
} |
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
### We are adding telephone number as custom field | |
1. Go to /wp-content/plugins/membership/app/view/templates/ and copy all 4 files. | |
2. Go to /wp-content/themes/YOUR_CURRENT_THEME/ and create a new folder called membership2, then paste all 4 files inside the new created membership2 folder | |
3. Open membership_registration_form.php and put the following: membership_registration_form.php | |
4. Now open the membership_account.php file and put the following: membership_account.php | |
5. Finally need to add some code: mu-plugin.php | |
## You can add those codes in your functions.php in the theme, | |
## if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. |
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 | |
$user = MeprUtils::get_currentuserinfo(); | |
$sub_user_ids = array(); | |
if($user !== false) { | |
$transactions = $user->active_product_subscriptions('transactions'); | |
if(!empty($transactions)) { | |
foreach($transactions as $txn) { | |
if(($sub = $txn->subscription()) !== false) { |
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 | |
// allow for verification to be required for free trial users. | |
function mepr_newuser_approve_override($user_id) { | |
$auto_approve = array(970688, 970684, 970687, 970686, 970685); //An array of product ID's to auto approve | |
if(!class_exists('MeprOptions')) { return; } | |
if(!isset($_POST['mepr_product_id']) && !isset($_POST['manage_sub_accounts_form'])) { return $user_id; } //Not a MemberPress signup? | |
$product_id = isset($_POST['mepr_product_id'])?$_POST['mepr_product_id']:false; |
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 loops through the current user's Active Transactions | |
// If one or more of the Transactions belongs to a Parent Corporate Account | |
// Then it's URL to the "Manage Sub Accounts" link will be output on the page. | |
$user = MeprUtils::get_currentuserinfo(); | |
if($user !== false) { | |
$transactions = $user->active_product_subscriptions('transactions'); | |
if(!empty($transactions)) { |
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 | |
//Capture a new member signup. Only ever triggers once for each new member. | |
//Does not trigger for exising members who have subscribed to a Membership before. | |
// | |
//The user may not be logged in when this is called | |
//as it is triggered when a user is added over the REST API, | |
//and also when a user is added from the dashboard (MemberPress -> Members -> Add New) | |
function mepr_capture_new_member_signup_completed($event) { | |
$user = $event->get_data(); | |
$txn_data = json_decode($event->args); |