• Resolved Ritsk

    (@ritsk)


    Hello,
    It is really Awsome plugin, great peice of work. Thank you for creating this. it has help me to create front end editor. Futher to improve editing option I want to add Button for Featured image of post. I have added button in editor but how to open set featured image popup on click of it.

    There is option of insert media from which we can setup this but I want to have separate button that will only allow to set featured image same as that backend.

    Please guide me on this..

    https://www.ads-software.com/plugins/wp-front-end-editor/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Ritsk

    (@ritsk)

    I have Done the required.. By adding code in class-wp-front-end-editor.php

    $wp_admin_bar->add_node( array(
    ‘id’ => ‘featuredImage’,
    ‘href’ => ‘#’,
    ‘title’ => ‘<span class=”button-primary” title=”Set Header image”>Set Header image</span>’,
    ‘meta’ => array(
    ‘title’ => ‘Set Header image’
    ),
    ‘fee’ => true
    ) );

    inside public function admin_bar_menu( $wp_admin_bar ) {

    And Added jquery function inside js/tinymce.fee.js

    editor.addButton( ‘wp-admin-bar-featuredImage’, {
    title: ‘featuredImage’,
    tooltip: ‘featuredImage’,
    onclick: function( event ) {
    event.preventDefault();
    $( ‘#set-post-thumbnail’ ).click();
    }
    } );

    This may help other people..

    Now files had been changed. I tried to add solution of yours but it doesn’t really work for me. Nothing really happens because there is no #set-post-thumbnail element on page.

    Thread Starter Ritsk

    (@ritsk)

    I guess this element will be there when you use the_post_thumbnail(); to display and when you edit it FEE will turn that to set-post-thumbnail.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add Thumbnail button in frontend editor’ is closed to new replies.