ibenic.com ibenic.com

Loading Your Library only once between WordPress Plugins

When you are developing multiple plugins, you might develop a library that will be used in some of them. So, what happens when your customers might use more than 1 of your plugins with that libary. How are you going to handle the loading of it so you’re sure that the latest is being used? In one of the previous tutorials, you could read about Using Composer for Libraries in WordPress Plugins or Themes. This can be a way to load...

ibenic.com ibenic.com

Headless WordPress: Displaying a Single Article

In the last two articles we have shown how to get the articles, display them and also use the React Router for pagination. In this tutorial we will now see how to show a single article using the React Router in out Headless WodPress application. How are we going to do this? We will get the Slug from the RouteCheck if there is an article with that slugIf not, fetch a new oneIf we still don’t have an article, show 404 Page Not...

ibenic.com ibenic.com

Gutenberg Components: ServerSideRender

Sometimes, we will need to render dynamic content and we usually used shortcodes for that. But shortcodes did not show the output in the editor. With ServerSideRender component we can now also see what will happen on the front while using Gutenberg. In my personal experience, when I want to convert a shortcode used to display dynamic content, I tend to go for this component. This component can be found in the Gutenberg...

ibenic.com ibenic.com

Headless WordPress: Google Login with JWT

In the first tutorial of the Headless WordPress series, we have created a way to login with your user account using JWT. This tutorial will show you how you can use the same JWT flow when trying to login users using Google. To use the Google login, you will need the Google Client ID which can be created using the Google Console. When creating the credentials, you can set the Origin and Redirect URIs to http://localhost:3000 (or any...