Using the admin Featured Image's modal in the front end

I am trying to get the new upload frame of the featured image used in the admin side, but the one used in the front is different. I will show you some screenshots:

In the admin section when I click into the Add Featured Image I get this modal box frame:

But when I click in the link of my front end I got this modal box frame instead:

Here is the code used to create the form in the front end:

if ( fp_get_option(fps_show_feat_img, false) !== false )
        {
        echo 'div class=frontier-thumbnail';
        echo 'fieldset class=frontier_post_fieldset_tax frontier_post_fieldset_tax_featured';
        echo 'legend  class=frontier_post_legend_featured'.__(Featured image, frontier-post).'/legend';
        
        if ( fp_get_option('fps_show_feat_img') === simple )
            {
            echo 'div id=frontier_post_featured_image_label'.__(Upload featured image,frontier-post).:br/div;
            echo 'input type=file name=thumbnail id=thumbnailbr';
            echo 'div id=frontier_post_featured_image_txt'.__(Not uploaded until post is saved, frontier-post).'/div';
            //echo 'br'; 
            }
        else
            {
            $uparms =  '?post_id='.$post_id;
            $uparms .= 'amp;'.'type=image';
            $uparms .= 'amp;'.'TB_iframe=1';
            $uparms .= 'amp;'.'inline=1';
            $uparms .= 'amp;'.'tab=library';
        
            echo 'a title='.__(Select featured image).' href='.site_url('/wp-admin/media-upload.php').$uparms.' id=set-post-thumbnail name=set-post-thumbnail class=thickbox';
            echo __(Select featured image, frontier-post).'/abr';
            echo 'div id=frontier_post_featured_image_txt'.__(Not updated until post is saved, frontier-post).'/div';
            echo 'br';
            }
        
        
        if (has_post_thumbnail($post_id))
            {
            $thumpid = get_post_thumbnail_id($post_id);
            echo get_the_post_thumbnail($post_id, 'small', array('class' = 'frontier-post-feat-img'));
            }
        else
            {
            $thumpid = -1;
            }

        echo 'input id=_thumbnail_id name=_thumbnail_id value='.$thumpid.' type=hidden';
        echo '/fieldset';
        echo '/div';
                        
        
        
        
        } // end featured image
    
    } // end tags and featured image

I also added the next code to enqueue all the scripts needed for the wp.media but got the same result.

function enqueue_media_uploader()
{
    //this function enqueues all scripts required for media uploader to work
    wp_enqueue_media();
}

add_action(wp_enqueue_scripts, enqueue_media_uploader);

Topic media-modal media-library front-end post-thumbnails plugins Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.