Plugin Author
Alex
(@ahoereth)
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
Thanks For Your Detailed response.. I Will be Working on it…
Your Assumption is right…