You often need to remove or hide menu items from WordPress admin panel or dashboard. This is a common requirement if you develop WordPress websites for clients or manage multi-user blog.
Tag » Function
Display Custom Post Types Content in WordPress Templates
Create few templates to display custom post types content in WordPress. In the previous article, we have created few posts in our Books post types with some custom content fields.
3 Ways to Change Array Key without Changing the Order in PHP
You can change array key too easily but doing it without changing the order in PHP is quite tricky. Simply assigning the value to a new key and deleting old one doesn’t change the position of the new key at the place of old in the array.
Add Custom Taxonomies to Custom Post Types in WordPress
You just need a function to add Custom Taxonomies to Custom Post Types. In previous article we made WordPress default taxonomies called Category & Tag to support our CPTs. Here we are going to create custom taxonomies for them.
Add Default WordPress Categories and Tags to Custom Post Types
You can add default WordPress Categories and Tags taxonomies to Custom Post Types through passing taxonomies parameters to arguments. In previous article we had learnt how to create CPT using code in functions.php. Here I will explain how can you use WordPress default built-in taxonomies like Categories and Tags with those CPT.
Caching in WordPress to Store Data – Transients API
Caching in WordPress using Transients API can store the data which have an expiration time. After the data has expired or not available, we can run code to grab data and catch it again. Transients API in WordPress makes caching process very easier to store a data for limited time.
6 Steps: Create Custom Post Types in WordPress – I
Custom Post Types in WordPress is the feature which makes WordPress so popular content management platform. By default Post, Page and 5 others are post types available in WordPress. A few example of Custom Post Types are Portfolio, Project, Contact Form 7 or Product in WooCommerce etc.
MySQL update if value is greater than current value
While working with MySQL database there might be situation when you wish to update certain column only if the value being updated is greater than existing value or current value stored in that column. MySQL GREATEST and LEAST functions are quite handy in such situations. Let’s see how can we use first function to update a column if value is greater than current value.
2 ways to fix: Can’t use method return value in write context
Have you ever used a function call in `empty()` for an `if` condition to perform some checking? Then you might come up with an PHP fatal error saying Can’t use method return value in write context. I am explaining here why did the error come and 2 ways to write them correctly.
Get query string parameters values from URL in JavaScript
Sometimes we need to retrieve URL parameters values from browser address bar in our client side script to process some functioning like click to a button or show/hide some elements. Here I have created a function in JavaScript to get query string parameters from URL and displayed uses example.