WordPress – Page 6

Meta Boxes Conditional Logic

In this tutorial I will explain you how to show or hide a field depending on a value of another field within a simple WordPress metabox.

Like this:

conditional logic in WordPress meta boxes
Show or hide a custom field depending on a value of another field.

Add Custom Fields to a Taxonomy

In this tutorial I will show you step by step how to add a custom field to a custom taxonomy in WordPress. Of course, this method is going to work great for default taxonomies as well.

First of all I will show you how to do it without any plugins and then we will do the same with the help of my Simple Fields plugin, so you can see the difference.

Well, let’s take a look what we are going to create here.

WordPress custom fields in taxonomy
Here I decided to add multiple fields – a simple text field and an image field.

And this is how it looks when you go edit a specific taxonomy term:

add custom fields on edit term pages

Create Custom Options Pages

WordPress custom settings pages are quite useful when you are developing a plugin or a theme. You will definitely need some place in admin area where users can configure your plugin and Settings API is perfect for that.

And yes, we are going to use Settings API which will help us creating our options pages. It was added in WordPress 2.7 only. I really doubt that you are using a WordPress version prior 2.7, but anyway I think I have to mention that.

Below is the screenshot of a settings page we are going to create in this tutorial. I decided to make it simple, so we have multiple fields – a text field and a checkbox.

how to create a WordPress option page with field validation

3 Ways to Add Notification Counter Bubbles to WordPress Admin Menu

How to Display a Column with Users’ Last Login Date / Time

Extend the List of Allowed Domains for wp_safe_redirect()

What is the difference between using wp_redirect() and wp_safe_redirect() functions actually?

The thing is that wp_redirect() allows to perform redirections just anywhere, but wp_safe_redirect() by default allows only the domain specified as Site Address (URL) in Settings > General.

In this tutorial I will show you how you can add any domain as an allowed domain for wp_safe_redirect() function using allowed_redirect_hosts action hook.

Remove Posts in WordPress Dashboard with AJAX