wp_ajax is not calling the action

if the request is from an unauthenticated user, you should use wp_ajax_nopriv_(action) to call the function, which in your case is: add_action(‘wp_ajax_nopriv_cpm_add_update’, array($this,’edit_added_people’));

Can’t load search results with ajax

The JavaScript should be: <script> jQuery( document ).ready(function ( $ ) { $( “#searchform” ).on( “submit”, function ( ev ) { ev.preventDefault(); $.post( “<?php echo admin_url( ‘admin-ajax.php’ ) ?>”, { action: “wpa56343_search”, search: $( “#s” ).val() }, function ( response ) { $( “body” ).append( response ); } ); }); }); </script> And the AJAX … Read more

adding ajax load more to display images from meta box

It can be done just following regular way to use Ajax in WordPress. https://codex.wordpress.org/AJAX_in_Plugins First register a script file and also create an AJAX Call. wp_enqueue_script( ‘meta-ajaxscript’, get_stylesheet_directory_uri() . ‘/js/ajax-init.js’, array( ‘jquery’ ), ”, true ); wp_localize_script( ‘meta-ajaxscript’, ‘ajaxMeta’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) )); Second, Wrap your metadata with a parent element by … Read more