Skip to content

Instantly share code, notes, and snippets.

@mahfelwp
mahfelwp / fix_select2.php
Created January 30, 2020 09:09
fix select 2 on theme that conflict with youzer plugin
<?php
function select2_fix() {
if ( is_buddypress() ) { ?>
<script>
jQuery( document ).ready( function($) {
$('select').select2('destroy');
});
</script>
@mahfelwp
mahfelwp / member_types.php
Created February 6, 2020 19:57
add member types to youzer
<?php
/**
* Register member types.
*
* From the wp-admin/extended profile
* it will be possible to set the user's member type
*/
function using_mt_register_member_types() {
@mahfelwp
mahfelwp / delet_new_avatar.php
Last active September 30, 2020 14:33
DELETE NEW AVATAR FROM MEDIA AND ACTIVITY TABLE
<?php
function get_all_activity_ids_type_is_new_avatar(){
global $wpdb, $bp;
// Prepare Sql
$sql = $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE type = %s AND component = '%s'", 'new_avatar' , 'profile' );
// Get Result
@mahfelwp
mahfelwp / delete_widgets_settings_page_and_link_from_profile_edit.php
Created October 14, 2020 14:27
Delete widgets settings page and link from user dashboard