[buddypress-trac] [BuddyPress Trac] #5202: Create a new Group Avatar outside of the Group via PHP

buddypress-trac noreply at wordpress.org
Thu Sep 17 14:30:09 UTC 2015


#5202: Create a new Group Avatar outside of the Group via PHP
-------------------------------------+------------------
 Reporter:  svenl77                  |       Owner:
     Type:  enhancement              |      Status:  new
 Priority:  normal                   |   Milestone:  2.4
Component:  Component - Groups       |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+------------------

Comment (by imath):

 Hi @svenl77

 I've just checked your plugin, and the reason is you are sending an url
 when we expect an absolute path. The docblock is mentioning it:
 `@type string $image     The absolute path to the image`

 I think it's justified/safer to check if the file exists before trying to
 copy it in another place.

 I've tried to find a WordPress function to get the attachment path, and it
 seems to only exist for thumbnails > `wp_get_attachment_thumb_file()`.
 Maybe you can get some inspiration out of this function and get the
 absolute path to the 'post-thumbnail' size before using the 'copy'
 function.

 It's weird it's working with an url though... I need to understand why as
 PHP's copy function requires a path.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5202#comment:9>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list