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 snippet allows custom filtering based on a content block's ID. | |
* | |
* To use, create a content-blocks-controls.php file in the child theme and add the followng line to the functions.php file: | |
* require_once get_stylesheet_directory() . '/content-blocks-controls.php'; | |
*/ | |
// Add a filter to modify the condition match for Blocksy Pro content blocks | |
add_filter( |
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
// Export BuddyPress-related tables for the first 10 users of the main site (subdirectory 1) | |
const exportMainSiteBPCommand = ` | |
mysqldump -u ${dbConfig.user} -p${dbConfig.password} -h ${dbConfig.host} ${dbConfig.database} wp_1_bp_follow wp_1_bp_friends wp_1_bp_document wp_1_bp_document_folder wp_1_bp_document_folder_meta wp_1_bp_groups wp_1_bp_groups_groupmeta wp_1_bp_groups_membermeta wp_1_bp_groups_members wp_1_bp_invitations wp_1_bp_invitations_invitemeta wp_1_bp_messages_messages wp_1_bp_messages_meta wp_1_bp_messages_notices wp_1_bp_messages_recipients --where="user_id IN (SELECT ID FROM wp_1_users LIMIT 10)" | |
> db-export-main-site-bp.sql | |
`; | |
// Export BuddyPress-related tables for the first 10 users of the second site (subdirectory 2) | |
const exportSecondSiteBPCommand = ` | |
mysqldump -u ${dbConfig.user} -p${dbConfig.password} -h ${dbConfig.host} ${dbConfig.database} wp_2_bp_follow wp_2_bp_friends wp_2_bp_document wp_2_bp_document_folder wp_2_bp_document_folder_meta wp_2_bp_groups wp_2_bp_groups_groupme |
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_custom_user_settings_tab() { | |
// create the Custom Tab in the settings navigation | |
bp_core_new_subnav_item( | |
array( | |
'name' => __( 'Custom Tab', 'buddyboss-theme' ), // Replace 'Custom Tab' with the name of your tab | |
'slug' => 'custom-tab', // Change this to your desired slug | |
'parent_url' => bp_loggedin_user_domain() . 'settings/', | |
'parent_slug' => 'settings', | |
'screen_function' => 'add_custom_user_settings_tab', |
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 | |
/* | |
Plugin Name: Paid Memberships Pro Integration with SpacesEngine for BuddyBoss | |
Plugin URI: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
Description: Integrate Paid Memberships Pro With SpacesEngine for BuddyBoss | |
Version: 0.2.6 | |
Author: Brandon Meyer | |
Author URI: indigetal.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 | |
function my_pmpro_adjustable_level_cost($level) { | |
$monthly_levels = array(1, 2); // specify monthly level IDs here | |
$annual_levels = array(3, 4); // specify annual level IDs here | |
$extra_fee = 0; | |
if (in_array($level->id, $monthly_levels)) { | |
$extra_fee = 10; //specify the cost of the selected option for monthly plans | |
} |
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_adjustable_level_cost($level) { | |
$extra_fee = 0; // Default extra fee value | |
if(isset($_REQUEST['field_name'])) { | |
//specify the cost of the selected option | |
$extra_fee = 100; | |
// Check if the level has a recurring subscription | |
if (pmpro_isLevelRecurring($level)) { |
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_adjustable_level_cost($level) | |
{ | |
if(isset($_REQUEST['field_name'])) | |
{ | |
$level->initial_payment = $level->initial_payment + 100; //specify the cost of the selected option | |
// You cannot update recurring payments with this code as-is, see comment below | |
} | |
return $level; |
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_adjustable_level_cost($level) | |
{ | |
// Specify the monthly and annual levels | |
$monthly_levels = array(1, 2); | |
$annual_levels = array(3, 4); | |
// Set the field name here | |
$field_name = 'field_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
<?php | |
function my_pmpro_adjustable_level_cost($level) | |
{ | |
// Set the field name here | |
$field_name = 'field_name'; | |
// Set the available field options and their extra fee here | |
$options = array( | |
'option1' => 100, | |
'option2' => 200, |
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 | |
// Restrict access to certain pages based on level group: | |
function my_pmpro_custom_redirects() { | |
// The Level ID's associated with each "Level Group" | |
$group_one = array('1', '2', '3'); | |
$group_two = array('4', '5', '6'); | |
// The pages to be restricted | |
$page_names = array('group-1-access', 'group-2-access'); |