Skip to content

Instantly share code, notes, and snippets.

@tech4him
tech4him / gist:354c1122c97cb535bb455113937d5e5f
Created June 24, 2017 22:25
GeoDirectory vs. Them My Login - Conflict Resolution (Search)
function _my_geodir_search_init () {
if(isset($_REQUEST['geodir_search'])){
if(class_exists( 'Theme_My_Login' )) {
remove_action( 'pre_get_posts', array( Theme_My_Login::get_object(), 'pre_get_posts' ) );
}
}
}
add_action('init','_my_geodir_search_init');
@tech4him
tech4him / gist:73aaad36f92ccb2facdc78d69b25d59f
Created June 24, 2017 22:24
GeoDirectory Remove Remove Reply Link
function remove_geodir_comment_replaylink() {
remove_filter('comment_reply_link', 'geodir_comment_replaylink');
remove_filter('comment_reply_link', 'geodir_reviewrating_comment_replylink');
}
add_action('init','remove_geodir_comment_replaylink');
@tech4him
tech4him / gist:a39cf232089766292665404441568990
Created June 24, 2017 22:22
PaidMembershipsPro - Default Membership on Registration
/**
* When registering, add the member to a specific membership level
* @param integer $user_id
**/
//Disables the pmpro redirect to levels page when user tries to register
add_filter("pmpro_login_redirect", "__return_false");
function my_pmpro_default_registration_level($user_id) {
//Give all members who register membership level 1
pmpro_changeMembershipLevel(1, $user_id);
}
@tech4him
tech4him / gist:ab627bf347f6a909b7f30acc618f72c8
Created June 24, 2017 22:21
Geodirectory Override Login / Signup / Forgot Password URLS
// Login
add_filter('geodir_login_url','_my_geodir_login_url',10,3);
function _my_geodir_login_url($login_url,$args,$gd_page_id){
if(isset($args['signup'])){
//registration URL
$login_url = '/login';
} elseif(isset($args['forgot'])) {
//forgot password URL
} else {