• amperandsand

    (@amperandsand)


    Each user, except Admin, will only have one post each, a custom post type – which is a questionnaire fill-out. I already have the login redirecting to the custom post type page, but I’d like to go one step further and make it really easy for the user.

    If they are logging in for the first time, it would continue to redirect them to the custom post type page, but also auto click on the add custom post type button.

    If they have already begun the questionnaire, it would auto click the edit button.

    I have an auto click working elsewhere, but it’s being triggered by a live click on another button. All script is in functions.php

    Here’s my login-redirect:

    add_filter('login_redirect', 'plugin_admin_redirect');
     function plugin_admin_redirect($redirect_to, $url_redirect_to = '', $user = null) {
     return 'https://mywebsite.com/wp-admin/edit.php?post_type=nanny_profile';
     }

    I’ve tried using document ready then jQuery(".row-actions").find(".edit").click(); but it’s not working. Neither is this: jQuery(".row-actions").find(".edit").trigger('click');

    This function works elsewhere for a different function:

    jQuery('.steps-button').live('click', function() {
      jQuery("#publish").click();
    });

  • The topic ‘After login redirect, auto click button to go to next page’ is closed to new replies.