• Hi,

    I want to customize bpcp-file-dialog.php in order to set different error messages for uploading files in the portfolio.

    I specifically want to edit this part:

    if ( is_wp_error( $attachment_id ) ) {
                        $types = __('jpg, jpeg, jpe, png, gif', 'bp-portfolio');
                        if($_GET["type"] == 'song' )
                            $types = __('mp3, m4a, m4b, ra, ram, ogg, oga, mid, midi, wav, wma, wax, mka', 'bp-portfolio');
    
                        $html = $this->core_alerts(sprintf(__('%s has failed to upload due to an error. Sorry, this file type is not permitted. Please upload one of the following file types: %s.','bp-portfolio'),
                            $_FILES['file']['name'],
                            $types
                            ),'error');
                        echo 'jQuery("#upload_photo_attachment_message").html('.json_encode($html).');';
                        return false;
                }

    Is there a way to do that?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Marc Luther Capulong

    (@mlcapulong)

    I’m talking about the proper customization, though. Customizing the file in a child theme.

    Thanks!

    Plugin Author BuddyBoss

    (@buddyboss)

    @mlcapulong it’s part of functions not a template file.
    You will need to make edits inside plugin file or override the complete
    function upload_attachment()
    You will need to disable remove these actions and create your own.
    `add_action(“wp_ajax_upload_photos_attachment”,array($this,”upload_attachment”),6);
    add_action( ‘wp_ajax_nopriv_upload_photos_attachment’, array($this,”upload_attachment”),6 );`

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to customize bpcp-file-dialog.php?’ is closed to new replies.