This file contains 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 | |
$free_ship_minimum = 100; // minimum total for free shipping to be applied | |
$shipping_method = 'weight_rate'; // the shipping method for this to be applied on. | |
/* | |
* Changes the Shipping cost on the Checkout Estimated costs page | |
*/ | |
add_filter( 'mp_cart/cart_meta/shipping_total', 'mp_custom_shipping_price', 88, 2); | |
/* |
This file contains 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
function get_blog_creator_id($blog_id) { | |
global $wpdb; | |
| |
$blog_id = (int) $blog_id; | |
if($blog_id !== 0) { | |
$email = $wpdb->query("SELECT email FROM {$wpdb->prefix}registration_log WHERE blog_id = {$blog_id}"); | |
$user = get_user_by( 'email', $email ); | |
return $user->ID; |
This file contains 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
function my_app_email_on_appointment_cancelled ($app_id) { | |
global $appointments; | |
$to = $appointments->get_admin_email(); | |
| |
$appt = $appointments->get_app($app_id); | |
$date = date_i18n( 'F j, Y', strtotime( $appt->start ) ) . ' at ' . date_i18n( 'G:i', strtotime( $appt->start ) ); | |
$body = "{$appt->name} cancelled his appointment on {$date}\n\n | |
Appointment ID {$app_id}"; | |
| |
$worker_email = $appointments->get_worker_email($appt->worker); |
This file contains 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 Shortcode | |
function user_shortcode( $atts ) { | |
$a = shortcode_atts( | |
array( | |
'user_id' => get_current_user_id(), | |
'field' => '', | |
), $atts ); | |
| |
$user = get_user_by( 'id', $a['user_id'] ); | |
This file contains 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
function wpmudev_change_comment_settings() { | |
global $wpdb; | |
| |
$blog_ids = wp_get_sites(); | |
| |
foreach($blog_ids as $blog) { | |
switch_to_blog($blog['blog_id']); | |
$wpdb->query("UPDATE {$wpdb->prefix}options SET option_value = 1 WHERE option_name = 'comment_registration'"); | |
restore_current_blog(); | |
} |
This file contains 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
// Filters blog signup validation methods | |
// Blogname must now contain minimum of 2 numbers | |
function wpmudev_blogname_numbers( $content ) { | |
global $wpdb, $domain; | |
| |
$current_site = get_current_site(); | |
$base = $current_site->path; | |
| |
$blog_title = strip_tags( $content['blog_title'] ); | |
$blog_title = substr( $blog_title, 0, 50 ); |
This file contains 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', 'app_custom_header' ); | |
function app_custom_header() { | |
$admin_email = 'your_email@email.com'; | |
| |
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); | |
$content_type = 'text/plain'; | |
if (!(defined('APP_EMAIL_DROP_LEGACY_HEADERS') && APP_EMAIL_DROP_LEGACY_HEADERS)) { | |
$message_headers = "MIME-Version: 1.0\n" . | |
"From: {$blogname}" . | |
" <{$admin_email}>\n" . |
This file contains 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_action('manage_users_columns','wpmudev_add_user_m2p_column'); | |
function wpmudev_add_user_m2p_column($column_headers) { | |
$column_headers['membership'] = 'Membership'; | |
return $column_headers; | |
} | |
| |
add_action('admin_head', 'wpmudev_custom_admin_css'); | |
function wpmudev_custom_admin_css() { | |
echo '<style> | |
.column-membership {width: 15%} |