How do I get reusable blocks via frontend REST API?

How do I get reusable blocks via frontend REST API? We need to be logged in as a user and additionally add the wp_rest nonce to the block rest endpoint request, either via the _wpnonce POST/GET parameter or via the X-WP-Nonce header. See e.g. the docs for more information on the authentication. EDIT: As pointed …

Read more

splitting the URL using jQuery

Not really a WordPress related question but you could do this // creates a object from the array, one of the properies (search) contains the query let url = new URL(‘https://dev/job/?job_id=jkdbsbd45JubJKAAASSYT’); // will create a object of all availalble query properites const urlSearchParams = new URLSearchParams(; const params = Object.fromEntries(urlSearchParams.entries()); // remove ? and everything …

Read more

WordPress: custom field display twice

Hey guys, I found THE solution. Problems : Custom field display twice. No Ajax/jQuery visual feedback. If you’ve been working on the file function.php, make sure you remove extra line breaks. Particularly at the top and the bottom of your file… If you have some line breaks, your xml got an error : XML or …

Read more

Ajax, Permalinks and post_thumbnail

Rather than me solve your problem may I suggest you consider using the more WordPress standard method of AJAX? WordPress Codex: AJAX WordPress Codex: AJAX in Plugins How to manage ajax calls and JSON in WordPress How to Implement Ajax in WordPress Themes If you have follow up questions let us know.

Dashboard – get status and position of metaboxes and pass them to ajax method

You can hook into the sortstop event of the sortable metaboxes, and read the current state: jQuery( function( $ ) { $( ‘.meta-box-sortables’ ).bind( ‘sortstop’, function( event, ui ) { var sortData = {}; $(‘.meta-box-sortables’).each( function() { sortData[‘-‘)[0]] = $(this).sortable( ‘toArray’ ); } ); console.log( sortData ); } ); } ); You can also hook …

Read more