[buddypress-trac] [BuddyPress Trac] #8581: Extending no content activities with images and call of actions
buddypress-trac
noreply at wordpress.org
Sat Nov 20 17:41:04 UTC 2021
#8581: Extending no content activities with images and call of actions
-----------------------------+---------------------
Reporter: vapvarun | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: 10.0.0
Component: Activity | Version:
Severity: normal | Resolution:
Keywords: needs-refresh |
-----------------------------+---------------------
Comment (by vapvarun):
@oztaser we can use file_get_contents in case we are getting timeout from
wp_remote_get.
as on local system or controlled environment, we may get empty output from
it.
is it okay to go with the following approach? I was trying to avoid
calling file_get_contents directly inside code but after checking inside
bp core codes, it's already been used 2 times
{{{#!php
$data = wp_remote_get( $avatar_url);
if ( is_array( $result ) && ! is_wp_error( $result ) ) {
$data = wp_remote_retrieve_body( $data );
} else {
$data = file_get_contents( $avatar_url );
}
}}}
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/8581#comment:13>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list