Trigger wp-embed via JavaScript to refresh iframe preview?

Unfortunately WP Embed isn’t responsible for converting links into iframes. The conversion of links and shortcodes into iframes is implemented by OEmbed and that happens via OEmbed APIs on the_content filter in PHP, not javascript. It’s much more likely that your transitioning to pages that use raw post content rather than processed/rendered content, e.g. templates … Read more

Add php code to wp_print_scripts?

You can use admin_footer or admin_head like below. This code only run on admin. You can also use for frontend by using wp_head or wp_footer function shapeSpace_print_scripts() { $block_yt_url=”test”; ?> <script> jQuery(document).ready(function ($) { let $yt_url = false; $(document).on( “click”, ‘#yt_run .acf-button-group’, function() { $(“.editor-post-publish-button__button”).hide(); $(“.acf-block-body div div.acf-block-fields.acf-fields div.acf-field.acf-field-text.acf-field-6260f423f1666”).css({‘height’:’inherit’,’padding’:’16px 20px’,’overflow’:’inherit’}); $(“.acf-block-body div div.acf-block-fields.acf-fields div.acf-field.acf-field-text.acf-field-6260f423f1666”).val(<?php echo … Read more

Wp-script package stop to work

Finally i found the problem ! There was a problem in the scss file which stop the building script. I had no error message. I think that the problem was that i used a sass variable which was too long.

How to register two blocks in the same plugin

Add a subfolder in your-plugin/src with the block name Put all src files inside this folder Repeat 1 and 2 for other blocks that you want to add. At this moment, the src folder looks like this: Be careful to edit properly each block.json to give them a name, etc. replace de single block registration … Read more

Why is the ‘Gutenberg’ Plugin generating an ‘Inconsistent File Permissions’ error when other Plugins, with the same permissions, do not?

If you originally installed via FTP/Cpanel/CLI the directory and files may have a different “owner” belonging to “different group” than those installed via WordPress. One possible solution: If you have server access try deactivating Guttenberg and rename its plugin directory to something else. Then reinstall the plugin through WordPress – if this works your Dashboard … Read more

How to put and components inside in Gutenberg block

When an element doesn’t have children it can be self-closing: <Something something=”123″ /> Otherwise it needs to behave like normal html tag with an opening part: <Something> and a closing one: </Something> edit: function( props ) { return( <Form method=”get” className=”search-form” > <PlainText title=”search box” placeholder=”Search” className=”search-field” type=”text” name=”s” readonly=”true” /> <PlainText type=”hidden” name=”type” value=”media” … Read more