Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawkidoki/626dd0700137ac385d0c5cbc91eb3295 to your computer and use it in GitHub Desktop.
Save hawkidoki/626dd0700137ac385d0c5cbc91eb3295 to your computer and use it in GitHub Desktop.
<?php
// File: /wp-content/themes/my_theme/includes/ajax-actions.php
add_action('wp_ajax_my_action', 'hwk_ajax_my_action');
add_action('wp_ajax_nopriv_my_action', 'hwk_ajax_my_action');
function hwk_ajax_my_action(){
// is_user_logged_in()
// current_user_can()
// get_userdata()
// get_users()
// get_post()
// get_posts()
// get_page_by_path()
// get_the_title()
// get_permalink()
// get_post_field()
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment