Checked attribute react

First question here!.I'm an experienced WP developer, but pretty new to React so my vocabulary might be a little off... I developed a custom (Gutenberg) block that have to update is content on almost every block manipulation on the block editor. It works great, mostly: i "listen" to changes with a wp.data.subscribe function and update the block attributes with wp.data.dispatch( 'core/block-editor' ).updateBlockAttributes. The problem is that the blocks stop updating when converted to a reusable block or put in one (like a reusable group). It's fine in the reusable block manager, but the feature that let you edit a reusable block inside the post it is used on is like a frame that don't fire my wp.data.subscribe function. How do i check for modifications in this "window" and update blocks inside it? It's just a backend problem. The client side rendering is dynamic so it works fine. Thank you, Nicolas … [Read more...] about Custom block update rendering when reused

When trying to do local SEO and increase the visibility of your local business, learning how to use Google My Business (GMB) is a good step. The service helps you stand out in (local) searches, is a great inbound marketing measure and can bring in more business. After all, 50 percent of consumers who do a local search end up visiting a store on the same day. If you are not sure about what Google My Business is and how it can benefit your website, this is the post for you. We will go over those questions as well as show you step by step how to use Google My Business and optimize it for the best effect. What is Google My Business? As the name suggests, Google My Business is a Google service. It’s free and allows you to optimize how your business appears in Google search and other services like Google Maps. If you have ever searched for a business name and found something like the below, that’s thanks to Google My Business. The extra listing provides important information to … [Read more...] about The Complete Guide to Google My Business for Website Owners

This post is part of a series on React development for WordPress developers. In my last post, I covered unit testing React components using Jest. Jest, when used for basic assertions and snapshot tests can cover a lot of the functionality of a React component. The “React Way” of developing interfaces calls for composing interfaces, which are themselves components, out of smaller components. Jest lets us test each component in isolation, but we’ll also need to make sure that component work as intended when nested inside of each other. This article also covers looping through React components — for example, a Posts component that renders an array of posts using a Post component for each one — using array iterators. In order to speed up development even further, I’ll cover how I use a command line utility to intelligently copy existing components to new components. Testing Nested Components In A React App As I wrote earlier, passing props down to … [Read more...] about Testing Nested Components In A React App

“I have a plugin,” says you, “how do I make it Gutenberg-ready?”The story is straightforward; Gutenberg is the new editor experience in WordPress, which is going to be merged into core in the next major release. A lot of plugins that do not keep up with this will become obsolete. This makes it essential that you adapt your plugin for Gutenberg before it’s too late.Who’s affected?Almost all the plugins that have anything to do with the post editor will be affected by Gutenberg. For example, if your plugin adds a button in TinyMCE to then place a shortcode in the editor, bad news; it will be the end of it. How to adapt your #WordPress plugin for #Gutenberg: Block API #tutorial 🚧 Click To Tweet “Do I need to adapt my plugins for Gutenberg?” So which plugins need updating for Gutenberg? Any plugins that work with: Custom metaboxes Shortcodes TinyMCE buttons or any editor feature at all While some plugins will still … [Read more...] about How to Adapt Your Plugin for Gutenberg: Part 1 (Block API)

I’ve written a lot about object-oriented PHP and the WordPress REST API for Torque over the past few years. I’ve also touched on using Composer for dependency management and to provide an autoloader, as well as covered unit testing. The basic message of everything I’ve written is that by applying the established best practices of software development to how we develop for WordPress, we can create better plugins. This is the first of a series of articles, that will pull together these concepts in a practical, functional example. I’ll be walking through creating a WordPress plugin to modify the capabilities of WordPress REST API endpoints so they can be better optimized for search. The plugin is available on Github. You may want to browse the commit log to see how I put it together. In this series, I’ll cover structuring plugins and classes using modern object-oriented PHP and not only how to make it testable, but also how to write automated tests for it. I … [Read more...] about Advanced OOP For WordPress: Customizing REST API Endpoints To Improve WordPress Search