Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

New answers tagged

0

is_admin() always returns true for every AJAX call. If you want to validate AJAX calls from frontend only, this may be a work-around: if (!isset($GLOBALS['current_screen']) && !is_customize_preview()) { // AJAX calls from frontend, excludes customize preview screen. }


0

In your case, I'll prefer suggest you to use one of these functions depending on the case and especially what you get from $_POST : media_handle_upload() media_handle_sideload()


Top 50 recent answers are included