iam looking for a way to enable this on WP User Frontend Pro when submitting a post via the front end, this works great in the back end btw
OK
you need some modification in plugin.
First you must add “nopriv” to wp_ajax.
like this:
add_action( 'wp_ajax_nopriv_sp_ajax_hook', 'sp_process');
add_action( 'wp_ajax_nopriv_sp_ajax_hook_sc', 'sp_process');
next you must load plugin’s js file in front-end:
asset/js/ajax.js
and in final step you must add a input box with specific id, “#title”.
That’s all.
But in another way you can wait for new version. We include this feature on it 🙂
add_action( 'wp_ajax_nopriv_sp_ajax_hook', 'sp_process');
add_action( 'wp_ajax_nopriv_sp_ajax_hook_sc', 'sp_process');
The code above am i not going to add to to functions.php ?
Yes, add to your theme functions
I did (in a child theme)but it did not work. this is how i add it, if you have a working sample kindly give me
/* = similar-post-title-checker
****************************************/
add_action( 'wp_ajax_nopriv_sp_ajax_hook', 'sp_process');
add_action( 'wp_ajax_nopriv_sp_ajax_hook_sc', 'sp_process');
function title_checker_scripts() {
wp_register_script('title_checker',plugins_url().'/similar-post-title-checker/asset/js/ajax.js', array('jquery'), '1.0' );
wp_enqueue_script('title_checker');
}
add_action('wp_enqueue_scripts', 'title_checker_scripts');