Many times we come across a situation in JavaScript where we have to generate dynamic html You can see the code above looks messy and difficult to read. WordPress recommends to use underscore templates.WordPress already has support for underscore.js library. All you have you to do is enqueue it like so : Then you can
Fix PHPCS errors in WordPress
Posted onVisibility must be declared on method “__construct” Add public before the class method Detected usage of a non-sanitized input variable: $_POST[‘xyz’] You need to sanitize it. E.g. esc_html( $_POST[‘xyz’] ) or sanitize_text_field( $_POST[‘xyz’] ) Detected usage of a possibly undefined superglobal array index: $_POST[‘query’]. Use isset() or empty() to check Wrap it inside empty() e.g.
Object Caching In WordPress
Posted onAs a CMS, WordPress is heavily dependent on its database, and database efficiency is crucial to scaling( capability to handle increased/growing workload ) WordPress. If requests to your website generates a large number of database queries, your database servers resource can become overwhelmed. This will reduce your site’s performance and uptime. To avoid multiple database
Storybook for React
Posted onIn this blog, we will talk about what is storybook, why should we use it and how to set up storybook for your React project using storybook and create-react-app. So what is storybook? Storybook is an open source tool that is used for developing UI components in isolation for React, Vue, and Angular. Why should
Google Maps in React: Autocomplete Location Search | Draggable Marker | Marker Infobox
Posted onI will teach you how to integrate Google Maps in your React Project.You will also learn how to create an autocomplete location search and draggable marker. When you search the location and select one the marker will automatically move to that location and display the address in the infobox. We will use the following npm