WordPress.org

Ready to get started?Download WordPress

Forums

Featured Video Plus
[resolved] set featured video from frontend (3 posts)

  1. csaicharan
    Member
    Posted 1 year ago #

    I am using my own frontend to create posts in wordpress...
    Actually i am able to set featured image from my own front end (which i was designed ).. and my requirement is to set featured video in the place of image.. so that decided to set use this plugin ( Featured Video Plus ).. please help me to set featured video from my own front end....

    http://wordpress.org/extend/plugins/featured-video-plus/

  2. Alexander Hoereth
    Member
    Plugin Author

    Posted 1 year ago #

    Um I know nothing about your implementation. So lets assume you just want an <input type="text"> on your frontend to pass an video url to the plugin and save it as featured video. Remember that you still need an featured image to be specified.

    I think the simplest way would be to pass your url to the plugin using jQuery & AJAX. WordPress handles all ajax requests through admin-ajax.php in the backend, even if the request is sent from the frontend. This way you do not need to include any of the plugin files on the frontend.

    $.post( ajaxurl, {
    	'action'    : 'fvp_ajax',
    	'id'        : $('#post_ID').val(),
    	'fvp_nonce' : $('#fvp_nonce').val(),
    	'fvp_video' : $('#fvp_video').val(),
    	'fvp_sec'   : $('#fvp_sec').val()
    });

    ajaxurl needs to be specified before, it is just available in the backend by default. Use admin_url('admin-ajax.php'). fvp_nonce needs to be generated by wp_create_nonce('fvp_nonce'). You can use wp_nonce_field for it. id is the posts id you want the video to add to, fvp_video is the url, fvp_sec the (optional) fallback video url.

    I have no idea how skilled you are with WordPress, this is just a rough mockup of the way I would approach it. This wasn't tested! Still, hope I could help,
    Alex

  3. csaicharan
    Member
    Posted 1 year ago #

    Thanks For Your Detailed response.. I Will be Working on it...
    Your Assumption is right...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.