wordpress function through ajax not being called
Based on your comments, I don’t think the MyAjax variable is being localized using wp_localize_script(). In your case, you’ll most likely need something like the following: wp_localize_script( ‘script’, ‘MyAjax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ), ) ); That said, I don’t really have enough information to provide a more detailed answer. EDIT: This and the … Read more