• Resolved theal3x

    (@theal3x)


    How to load ‘admin-ajax.php’ in frontend
    For users not logged in

    Ex:

    Javascript

    new AjaxUpload('#upload_btn', {
         action: '<?php echo admin_url("admin-ajax.php"); ?>',

    Only works if you are logged.

    ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Phil

    (@owendevelopment)

    You mean check if user is logged in via PHP?

    <?php
    if (!is_user_logged_in() ) {
       // code in here
    } ?>

    The above checks if user is not logged in, if not, does whatever you place in the // code in here area.

    More on this in the WP codex buddy.

    Thread Starter theal3x

    (@theal3x)

    Not checking, load.

    For as it is only load if the user is logged on.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to load 'admin-ajax.php' in frontend’ is closed to new replies.