Metabox conditionals depending on post format and template in Gutenberg

Better way is to listen to Gutenberg events. Template change can be observed with something like this: wp.data.subscribe(() => { console.log(wp.data.select( ‘core/editor’ ).getEditedPostAttribute(‘template’)); }); It will fire on many wp.data events, not only for template change. But you can add some checks and do your actions only when it’s needed. Example: const editor = wp.data.select( … Read more

add_post_meta when jQuery button is clicked

WordPress Ajax to the rescue! You’ll need to open up a function in WordPress that can be called via a javascript function, which is what the WP Ajax API was built for. It’s a bit of a multi-step process, but is quite powerful once you have it setup. There’s a helpful article here that explains … Read more

How to change the text of Publish Button

You can use the following code to change Publish button’s text to Save even after editing Post Status. Do not forget: Clicking OK or Cancel buttons when editing Post Status will change Publish button’s text. This happens also when editing Post Visibility and Publish time. I used setTimeout() to postpone changing Publish button’s text after … Read more

Injecting CSS into Iframe

If the source of the iframe is not on the same domain as the page that the iframe is embedded on, you cannot change contents inside the iframe. If the iframe’s source is on the same domain, add the CSS directly to the source page. More: https://stackoverflow.com/a/36513940

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedueduedueduedusedusedusedusedu