Viewing 1 post (of 1 total)
  • Author
    Posts
  • Conveys
    Participant
    Post count: 6

    So, if you want it to fire on the front-end for both visitors users and logged-in users, you can do this:

    add_action( 'wp_ajax_my_action', 'my_action_callback' );
    add_action( 'wp_ajax_nopriv_my_action', 'my_action_callback' );

    Example

    add_action( 'wp_ajax_GetPostMedia', 'GetPostMedia' );
    add_action( 'wp_ajax_nopriv_GetPostMedia', 'GetPostMedia' );

    function GetPostMedia(){
    Something here...
    }

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.