How can I fire a jQuery event once getBlocks() actually returns the post’s blocks instead of null?

You need to “subscribe” to changes (see this issue) with wp.data.subcribe. A more modern version would have you use useSelect() to get the blocks. It will automatically update blocks if it changes (i.e. it will first return null, then an array of blocks once the API request completes). import { useSelect } from ‘@wordpress/data’; const … Read more

WordPress Sending data to Ajax with select option

I would start with checking what’s sql query you have print_r(“Select * From wp_ilce where il_id={$_POST[‘il’]}”); Next copy it to the sql tab in your phpmyadmin and see if it returns the currect data, could be the the wp_ prefix is incorrect, mabe $_POST[‘il’] contains an incorrect value. But aside from all that WP has … Read more

window resizing problem

Next to .height() and .width() there is .outerHeight() and .innerHeight() (same for width as well). You might be looking for these methods to gather the browsers size, not only the size of the windows viewport. Keep in mind that this not always works 100% across all browsers, so you always might run into problems if … Read more

How can I load jquery library into my dashboard widget?

You need to enqueue your script at certain points. Rather than just placing the wp_enqueue_script call inside your dashboard widget function, you need to place it in a separate function and hook on to the proper action. So: function add_jquery_to_my_widget() { wp_enqueue_script( ‘jquery’ ); } add_action( ‘init’, ‘add_jquery_to_my_widget’ );