Archive

Using Auto Draft Posts

There's no doubt that WordPress uses "Autosave" feature for some pretty valid reasons and it is very useful in certain scenario. Personally though I never liked this feature and find it to be not so useful for me as I am the only one who is and mo ...

Query WooCommerce Products

There are multiple ways you can query WooCommerce products in WordPress. Though generally you can use the native get_posts funct ...

Check if WooCommerce is Active

Over the past couple of years, I have written and shared number of snippets on WooCommerce which I hope helped some of you. Generally speaking, when I am sharing a snippet on WooCommerce, I do that with an assumption that you already have WooComme ...

Removing Block Editor Stylesheet

Last year when WordPress 5.0 came out, I wrote a simple post showing how to continue using Classic Editor on your WordPress site. Unfortunately though, even after ...

Adding Custom Structured Data in WooCommerce

By default WooCommerce adds structured data for every single published product in JSON format. It is a great feature which not only helps the search engines to crawl imp ...

Get your Classic WordPress Editor Back

WordPress just released it's latest version (5.0) today which is being widely discussed because some of it's major "improvements". While I ap ...

Regex for Twitter Username in JavaScript

On my previous post, I discussed how to validate Twitter username in PHP using Regular Expression (regex). As my project required me to perform the ...

Regex for Twitter Username in PHP

Recently I was working on a project where I had to come up with a solution to validate twitter username before I allow users to insert the data into my database. Now, as far as ...

How to Retrieve File Metadata in JavaScript

Web APIs are simply amazing when you want to build web applications. Perhaps it becomes obvious when your application is highly user focused. Today, I will discuss about how we can access file metadata for a selected file in HTML file input. ...

Sanitizing Integer Value with Filter Var

In one of my previous post, I discussed how validate integer variable. However, I recently came across some weird issue while sanitizing an integer. Not sure why its happening like t ...

Retrieve Simple JSON API Data in PHP

Today I will share a simple PHP script to show how you can retrieve API data using PHP. For demonstration purpose I will use freegeoip.net public API to grab information ...

Validating Integer in PHP

Every now and then we need to check if the value of a variable is an integer or not. Recently I came across a forum thread where someone is trying to understand why his/her snippet is not giving the appropriate result that he/she is looking for. I ...

Query Posts Based on Serialized Meta Value

Recently I was working on an "inventory management" system where we I had to work with lots of products and their variations in color, size, sku, upc code, dimensions, price & other related data. Yes, I took help of meta box to take inputs an ...