Viewing 5 replies - 1 through 5 (of 5 total)
  • wherepiewhere

    (@wherepiewhere)

    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

    Plugin Author Morteza Geransayeh

    (@man4toman)

    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 ??

    Thread Starter goodmuyis

    (@goodmuyis)

    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 ?

    Plugin Author Morteza Geransayeh

    (@man4toman)

    Yes, add to your theme functions

    Thread Starter goodmuyis

    (@goodmuyis)

    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');
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Front End usage’ is closed to new replies.