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 decodeHtmlEntities(str) { | |
console.log(str); | |
var special = { | |
"<" : "<", | |
">" : ">", | |
""" : '"', | |
"'" : "'", | |
"'" : "'", | |
"&" : "&", | |
"\\" : "" |
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
/** | |
* Disables BuddyPress' registration process and fallsback to WordPress' one. | |
*/ | |
function my_disable_bp_registration() { | |
remove_action( 'bp_init', 'bp_core_wpsignup_redirect' ); | |
remove_action( 'bp_screens', 'bp_core_screen_signup' ); | |
} | |
add_action( 'bp_loaded', 'my_disable_bp_registration' ); |
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
/* | |
Use PMPro Register Helper to add PMPro Billing Address fields to the edit user page for admins. | |
*/ | |
function show_pmpro_address_fields_on_edit_profile() | |
{ | |
//require PMPro and PMPro Register Helper | |
if(!defined('PMPRO_VERSION') || !defined('PMPRORH_VERSION')) | |
return; | |
$address_fields = array( |
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 | |
/* | |
* Load iFlyChat Support or Chatroom for Members in Level 1 and 2 Only | |
* Update line 11 with your Membership Level IDs | |
*/ | |
function my_pmpro_iflychat_check_access_filter($access) { | |
$access = true; | |
/** Get current user information **/ | |
global $current_user; | |
wp_get_current_user(); |
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
/** | |
* Adds the datepicker settings to the admin footer. | |
* Only loads on the plugin-name settings page | |
*/ | |
function admin_footer() { | |
$screen = get_current_screen(); | |
if ( $screen->id == 'settings_page_plugin-name' ) { |
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 init_session_var_test() | |
{ | |
//must set /?sessiontest=SOMETHING to get this to run | |
if(empty($_REQUEST['sessiontest'])) | |
return; | |
//start session | |
if (version_compare(phpversion(), '5.4.0', '>=')) { | |
if (session_status() == PHP_SESSION_NONE) | |
session_start(); |
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 | |
/** | |
* Add MyCRED points to whenever a user checksout for a PMPro Membership Level. | |
* Allows different points per membership level. | |
* Allows different points amount for membership renewals. | |
* Add this code below to your PMPro Customizations Plugin - http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
* MyCRED can be downloaded/configured here: https://wordpress.org/plugins/mycred/ | |
* Any questions, please feel free to visit www.paidmembershipspro.com | |
*/ |
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 | |
$countries = array | |
( | |
'AF' => 'Afghanistan', | |
'AX' => 'Aland Islands', | |
'AL' => 'Albania', | |
'DZ' => 'Algeria', | |
'AS' => 'American Samoa', | |
'AD' => 'Andorra', |
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
/* | |
Assigns a random 6 digit number for a username automatically. | |
Two variations... | |
the first will show the username field with number already filled, but editing is disabled. | |
The second variations (uncomment the lines) will not show the username field at all, but will simply generate the numerical username and display it on the confirmation page. | |
*/ | |
function my_pmpro_checkout_after_user_fields() | |
{ | |
echo "<script>"; |
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 | |
/* | |
Update line 8 with the array of sidebar IDs you want to filter. | |
Add this code to your active theme's functions.php or a custom plugin. | |
*/ | |
function my_pmpro_widget_display_callback($instance, $widget, $args) { | |
$hide_sidebars_array = array('sidebar-1','sidebar-2'); | |
global $post; | |
//check if current user has an active membership level and hide the sidebars. |
OlderNewer