Remove value from array within post meta ajax admin

You’re not printing anything from the AJAX callback. Trying using wp_send_json_success: function ajaxtestdel(){ global $post; $currentPdfs = get_post_meta( $post->ID, ‘pdf_upload_url’, true ); $postValue = isset($_POST[‘postid’]) ? $_POST[‘postid’] : ”; $array_without_strawberries = array_diff($currentPdfs, array($postValue)); update_post_meta( $post->ID, ‘pdf_upload_url’, $array_without_strawberries ); // Send something back to AJAX wp_send_json_success(); } I have a feeling that perhaps your jQuery selector … Read more

Why does my jQuery plugin show up as text in WordPress?

You can use this PHP code to output your slider’s initiator in your themes footer: add_action(‘wp_footer’,’initiate_unslider’); function initiate_unslider () { ?> <script src=”https://code.jquery.com/jquery-2.1.4.min.js”></script> <script src=”/path/to/unslider.js”></script> <script> $(document).ready(function() { $(‘.banner’).unslider(); }); </script> <?php } Also it’s safer to add a $(document).ready before initiating your slider, in case some necessary components of your page has not been … Read more