Created
April 19, 2023 12:12
-
-
Save danielcharrua/5417ac61f69e921bc6baf69818ee197d to your computer and use it in GitHub Desktop.
Execute WordPress function from URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Run by doing https://domain.com/wp-admin/admin-ajax.php?action=osm_id_callback_action | |
// For users not logged in | |
add_action('wp_ajax_nopriv_osmid_callback_action', 'osm_id_callback_action'); | |
// For users logged in | |
add_action('wp_ajax_osmid_callback_action', 'osm_id_callback_action'); | |
function osm_id_callback_action() | |
{ | |
// Do something | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment