bp_core_avatar_folder_dir

  • apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-avatars.php :: Trac Source Line: 183
      	// Set avatar height
      	if ( $height )
      		$html_height = " height='{$height}'";
      	else
      		$html_height = ( 'thumb' == $type ) ? ' height="' . bp_core_avatar_thumb_height() . '"' : ' height="' . bp_core_avatar_full_height() . '"';
      
      	// Set avatar URL and DIR based on prepopulated constants
      	$avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', bp_core_avatar_url() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
      	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
      
      	/****
      	 * Look for uploaded avatar first. Use it if it exists.
      	 * Set the file names to search for, to select the full size
      	 * or thumbnail image.
      	 */
      	$avatar_size              = ( 'full' == $type ) ? '-bpfull' : '-bpthumb';
      	$legacy_user_avatar_name  = ( 'full' == $type ) ? '-avatar2' : '-avatar1';
      	$legacy_group_avatar_name = ( 'full' == $type ) ? '-groupavatar-full' : '-groupavatar-thumb';
      
    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-avatars.php :: Trac Source Line: 353
      			$avatar_dir = 'group-avatars';
      		else if ( 'blog' == $object )
      			$avatar_dir = 'blog-avatars';
      
      		$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
      
      		if ( !$avatar_dir ) return false;
      	}
      
      	$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
      
      	if ( !file_exists( $avatar_folder_dir ) )
      		return false;
      
      	if ( $av_dir = opendir( $avatar_folder_dir ) ) {
      		while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
      			if ( ( preg_match( "/-bpfull/", $avatar_file ) || preg_match( "/-bpthumb/", $avatar_file ) ) && '.' != $avatar_file && '..' != $avatar_file )
      				@unlink( $avatar_folder_dir . '/' . $avatar_file );
      		}
      	}
      
    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-avatars.php :: Trac Source Line: 525
      	$original_file = bp_core_avatar_upload_path() . $original_file;
      
      	if ( !file_exists( $original_file ) )
      		return false;
      
      	if ( !$item_id )
      		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
      	else
      		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
      
      	if ( !file_exists( $avatar_folder_dir ) )
      		return false;
      
      	require_once( ABSPATH . '/wp-admin/includes/image.php' );
      	require_once( ABSPATH . '/wp-admin/includes/file.php' );
      
      	// Delete the existing avatar files for the object
      	bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) );
      
  • apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir )

    Source Reference:

    • Component: BuddyPress :: bp-core
      File: /bp-core/bp-core-avatars.php :: Trac Source Line: 523
      	if ( !$original_file )
      		return false;
      
      	$original_file = bp_core_avatar_upload_path() . $original_file;
      
      	if ( !file_exists( $original_file ) )
      		return false;
      
      	if ( !$item_id )
      		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir );
      	else
      		$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
      
      	if ( !file_exists( $avatar_folder_dir ) )
      		return false;
      
      	require_once( ABSPATH . '/wp-admin/includes/image.php' );
      	require_once( ABSPATH . '/wp-admin/includes/file.php' );
      
      	// Delete the existing avatar files for the object
      

Comments are closed.