Skip to content

Instantly share code, notes, and snippets.

@sareiodata
sareiodata / dmlu_loggedin_menu.php
Last active August 24, 2022 15:07
Dynamic Menu for Logged In Users
<?php
/*
Plugin Name: Dynamic Menu for Logged In Users
Plugin URI: http://cozmoslabs.com
Description: Serve different menus for logged in / logged out users!
Author: Cristian Antohe
Version: 1.0
Author URI: http://www.cozmoslabs.com/
*
* Copyright (c) 2011-2013 Cristian Antohe - Cozmoslabs.com
<?php
// add the following to your functions file or similar
define( 'FUBLO_GF_PROFILE', 1 ); // define the ID number of your profile form.
// ============================================================= PROFILE EDITING
/**
* These are the user metadata fields, with their names and the data about them.
<?php $loop = new WP_Query( array( 'post_type' => 'phones', 'posts_per_page' => '10', 'category_name' => single_cat_title('', false)) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
// some content of loop goes here
<?php endwhile; ?>
@sareiodata
sareiodata / gist:5237607
Last active December 15, 2015 09:19
Filter Profile Builder username and add extra text after it for information purposes.
// filter Profile Builder username and add extra text after it for information purposes.
add_filter('wppb_register', 'pb_edit_registration_username', 10, 1);
function pb_edit_registration_username($registerFilterArray2){
$registerFilterArray2['name2'] .= 'text here';
return $registerFilterArray2; //returns the default (formatted) input + your custom text
}
@sareiodata
sareiodata / pb_contact_form.php
Created March 25, 2013 15:38
Simplest Contact form for logged in users only. Sends an email to an administrator from the current user's email address.
<?php
/*
Plugin Name: User Contact Form
Plugin URI:
Description: Simplest Contact form for logged in users only. Sends an email to an administrator from the current user's email address.
Version: 1
Author: Reflection Media, Barina Gabriel
Author URI: http://www.reflectionmedia.ro
License: GPL2
@sareiodata
sareiodata / custom_password_email.php
Last active December 20, 2015 08:58
Custom Profile Builder reset password email plugin.
<?php
/*
Plugin Name: Cozmoslabs.com Custom Password Email
Plugin URI: http://www.cozmoslabs.com
Description: Just a simple to modify plugin for a custom email when users request a password reset.
Version: 1.0
Author: Cristian Antohe
Author URI: http://www.cozmoslabs.com
*/
@sareiodata
sareiodata / gist:6281963
Created August 20, 2013 14:09
update profile builder extra fields dynamically.
$pb_options = get_option('wppb_custom_fields');
if (is_array($pb_options)){
foreach ($pb_options as $key => $single_option){
if ( $single_option['item_metaName'] == 'custom_field_1' )
$pb_options[$key]['item_options'] = 'Unu,Doi,Trei';
}
}
update_option('wppb_custom_fields', $pb_options);
add_action( 'init', 'wppb_redirect_wpsignup' );
function wppb_redirect_wpsignup(){
$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
if ( strpos( $actual_link, '/wp-signup.php' ) !== false ) {
wp_redirect( "http://testserver29.com/multisites/blog1/register/" );
exit();
}
}
// hide the confirmation email.
function hideEC($oldString, $checked){
return '';
}
add_filter ('wppb_register_confirmation_email_form', 'hideEC', 10, 2);
// filter the search text
add_filter('wppb_userlisting_search_field_text', 'wppb_change_search_text');
function wppb_change_search_text(){
return 'Search All Tutors';
}