Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change cover image profile not upload


  • johanmc
    Participant

    @johanmc

    I’m creating a button that generates a modal with the form to change the cover photo.

    function get_form_change_cover_image() {
    
        ob_start();
        bp_attachments_get_template_part('cover-images/index');
        $output = ob_get_contents();
        ob_end_clean();
    
        return $output;
    }
    
    function changeCover() {
    
        $content = get_form_change_cover_image();
    
        $output = "<div class='modal fade' id='modal_foto_portada' tabindex='-1' role='dialog' aria-labelledby='exampleModalLabel' aria-hidden='true'>
                        <div class='modal-dialog' role='document'>
                            <div class='modal-content'>
                                <div class='modal-header'>
                                    <h5 class='modal-title' id='exampleModalLabel'>New cover/h5>
                                </div>
                                <div class='modal-body'>
                                    {$content}
                                </div>
                                <div class='modal-footer'>
                                    <button type='button' class='btn btn-secondary' data-dismiss='modal'>Clore</button>
                                </div>
                            </div>
                        </div>
                    </div>";
    
        return $output;
    }
    

    I found in a post that was solved by adding wp_footer () in footer.php, but the design of the page is done with beaver builder and that file can not find it.

    Try adding the JS script in Customizing -> code from beaver builder, but I get this error:
    TypeError: BP_Uploader.strings.cover_image_warnings is undefined

    I would appreciate any kind of suggestion.

    Thanks.

  • You must be logged in to reply to this topic.
Skip to toolbar