This file contains hidden or 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 | |
require_once('wp-load.php'); | |
list($basedir) = array_values(array_intersect_key(wp_upload_dir(), array('basedir' => 1)))+array(NULL); | |
$file = rtrim($basedir,'/').'/'.str_replace('..', '', isset($_GET[ 'file' ])?$_GET[ 'file' ]:''); | |
$mime = wp_check_filetype($file); | |
$ext = $mime['ext']; | |
$allowed_ext = array( 'jpg', 'jpeg', 'png', 'gif', 'svg' ); |
This file contains hidden or 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($){ | |
$('#authors li').each(function(key, value) { | |
var name = $(this).children('strong').first().html(); | |
var re = /\s\([^\)]+\)/gi; | |
name = name.replace(re, ''); | |
$(this).find('select').first().children('option').each(function(){ | |
if ($(this).html() == name) { | |
console.log('Comparing ' + $(this).html() + ' to ' + name + ".\n"); | |
$(this).attr('selected', 'selected'); |
This file contains hidden or 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 custom sub-tab on groups page. | |
*/ | |
function buddypress_custom_group_tab() { | |
// Avoid fatal errors when plugin is not available. | |
if ( ! function_exists( 'bp_core_new_subnav_item' ) || | |
! function_exists( 'bp_is_single_item' ) || |
This file contains hidden or 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 | |
/** | |
* Remove tabs from user profile. | |
*/ | |
function remove_profile_nav() { | |
// Prevent fatal error if plugin is not available. | |
if ( ! function_exists( 'bp_core_remove_nav_item' ) ) { | |
return; | |
} |
This file contains hidden or 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 bpdev_set_email_notifications_preference( $user_id ) { | |
//I am putting some notifications to no by default and the common ones to yes to enable it. | |
//ref. https://bp-tricks.com/snippets/changing-default-buddypress-notifications-settings and BP forum | |
$settings_keys = array( | |
'notification_activity_new_mention' => 'yes', | |
'notification_activity_new_reply' => 'yes', | |
'notification_friends_friendship_request' => 'no', | |
'notification_friends_friendship_accepted' => 'no', |
This file contains hidden or 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 | |
/** | |
* Disable email notification. | |
* | |
* @param integer $user_id User ID. | |
* @return void | |
*/ | |
function buddyboss_set_email_notifications_preference( $user_id ) { |
This file contains hidden or 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 | |
/** | |
* Change default tab for group. | |
* | |
* @param string $default_tab Slug of default tab. | |
* @return string | |
*/ | |
function buddyboss_groups_default_extension( $default_tab ) { | |
return 'slug_of_tab'; // Last part of the URL. | |
} |
This file contains hidden or 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 custom sub-tab on groups page. | |
*/ | |
function buddyboss_custom_user_tab() { | |
// Avoid fatal errors when plugin is not available. | |
if ( ! function_exists( 'bp_core_new_nav_item' ) || | |
! function_exists( 'bp_loggedin_user_domain' ) || | |
empty( get_current_user_id() ) ) { |
This file contains hidden or 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 custom sub-tab on user profile. | |
*/ | |
function buddyboss_custom_user_tab() { | |
// Avoid fatal errors when plugin is not available. | |
if ( ! function_exists( 'bp_core_new_nav_item' ) || | |
! function_exists( 'bp_loggedin_user_domain' ) || | |
empty( get_current_user_id() ) ) { |