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 | |
/* | |
This is the main template part used in the tabbed search results as they are found at www.paidmembershipspro.com. | |
This will not function on it's own. Some notes: | |
* This is part of a child theme using the Memberlite theme as a parent. | |
* There is a search.php file in the child theme folder that loads this template part. | |
* There is also a search-result.php template part used by this. | |
* This also relies on CSS styles in Memberlite and our child theme. | |
*/ | |
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
//line 305 of inc/extras.php | |
//change: | |
elseif(is_search()) | |
{ | |
?> | |
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'memberlite' ), '<span>' . esc_attr(get_search_query()) . '</span>' ); ?></h1> | |
<?php | |
} |
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
//filter constant contact fields | |
function my_pmpro_constant_contact_custom_fields($fields, $user) | |
{ | |
$fields[] = array("name"=>"CustomField1", "value"=>$user->user_login); | |
return $fields; | |
} | |
add_filter("pmpro_constant_contact_custom_fields", "my_pmpro_constant_contact_custom_fields", 10, 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 custom_pmpro_getMemberStartdate($timestamp, $user_id, $level_id) | |
{ | |
global $wpdb; | |
if(!empty($level_id)) | |
$sqlQuery = "SELECT UNIX_TIMESTAMP(startdate) FROM $wpdb->pmpro_memberships_users WHERE membership_id IN(" . esc_sql($level_id) . ") AND user_id = '" . esc_sql($user_id) . "' ORDER BY id LIMIT 1"; | |
else | |
$sqlQuery = "SELECT UNIX_TIMESTAMP(startdate) FROM $wpdb->pmpro_memberships_users WHERE user_id = '" . esc_sql($user_id) . "' ORDER BY id LIMIT 1"; | |
$timestamp = $wpdb->get_var($sqlQuery); |
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
/* | |
This code is just meant as a sample of how to use the new XMLRPC methods in PMPro. | |
Aftering adding this code, navigate to /?rpctest=1 | |
*/ | |
function xmlrpc_test() | |
{ | |
if(!empty($_REQUEST['rpctest']) && current_user_can("manage_options")) | |
{ | |
//load XMLRPC Client | |
include(ABSPATH . "/wp-includes/class-IXR.php"); |
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
mysqldump -uusername -ppassword dbname > dbname_`date +'%Y-%m-%d'`.sql | |
gzip dbname_`date +'%Y-%m-%d'`.sql |
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 field to profile | |
function my_pmprorh_init() | |
{ | |
if(!function_exists("pmprorh_add_registration_field")) | |
return; | |
$secret = new PMProRH_Field("tos_checked_date", "readonly", array("profile"=>"admin", "label"=>"TOS Checked Date")); | |
pmprorh_add_registration_field("checkout_boxes", $secret); | |
} |
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
//change the profile start date | |
function my_pmpro_profile_start_date($date, $order) | |
{ | |
if($order->membership_id == 1) | |
$date = date("Y-m-d", strtotime("+ 14 Days")) . "T0:0:0"; | |
return $date; | |
} | |
add_filter("pmpro_profile_start_date", "my_pmpro_profile_start_date", 10, 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
<?php | |
function my_pmpro_has_membership_access_filter($access, $post, $user) | |
{ | |
if($post->ID == "1") //change ID here | |
return true; | |
return $access; | |
} | |
add_filter('pmpro_has_membership_access_filter', 'my_pmpro_has_membership_access_filter', 10, 3); |
OlderNewer