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_filter('yz_get_profile_hidden_widgets','hide_widgets_from_user_profile_edit_section'); | |
function hide_widgets_from_user_profile_edit_section( $widget ) { | |
$widget[] = 'portfolio'; | |
return $widget; |
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 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 |
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 random_user_query( &$query ) | |
{ | |
$query->query_orderby = "ORDER BY RAND()"; | |
} | |
function display_random_vip_users( $atts ) { |
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 get_all_users_id_by_membership_level_id() { | |
$memberships = rcp_get_memberships( array( | |
'status' => 'active', | |
'object_id' => 2 // Membership Levels ID | |
) ); | |
foreach ($memberships as $membership) { |
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 | |
/** | |
* 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() { | |
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 | |
/** | |
* Members Directory - Include Users By Meta_key & Meta_value | |
*/ | |
function yz_include_members_directory_by_verified( $loop ) { | |
if ( ! bp_is_members_directory() ) { | |
return $loop; | |
} |
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 bp_force_user_to_set_profile_avatar() { | |
if ( ! is_user_logged_in() ) { | |
return; | |
} | |
$user_id = get_current_user_id(); | |
if ( ! bp_get_user_has_avatar( $user_id ) && bp_current_action() != 'change-avatar' ) { |
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 select2_fix() { | |
if ( is_buddypress() ) { ?> | |
<script> | |
jQuery( document ).ready( function($) { | |
$('select').select2('destroy'); | |
}); | |
</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 | |
function convert_activity_product_date_to_shamsi($args , $product){ | |
if( ! function_exists('parsidate') || get_locale() != 'fa_IR' ) { | |
return false; | |
} | |
$args['date'] = parsidate("Y-m-d", $product->get_date_created()->format( 'F j, Y' ), "per"); | |
return $args; |
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
// For more information you can see this url: https://developer.mozilla.org/en-US/docs/Web/API/URL | |
let parseUrl = (url) => { | |
let parser = document.createElement('a'); | |
parser.href = url; | |
return parser; | |
} | |
let url = parseUrl("http://username:password@example.com:3000/deploy/?search=test#hash"); | |
url.protocol; // => "http:" |
NewerOlder