2016-2017 Alabama Hunting Seasons

Below are the 2016-2017 Alabama hunting season dates. Dates are valid through August 31st, 2017. This information is from outdooralabama.com/season-and-bag-limits (the DNR has finally put all this on a single web page!)

Check out the 2016-2017 Hunting & Fishing Digest – which contains this year’s requirements, fees, and season dates. Also, be sure and catch up on new regulations for this year and remember, you’re now required to check your game via the Game Check system.

Continue reading “2016-2017 Alabama Hunting Seasons”

Filter and modify a Custom Post Type – after it’s been registered

Today I was tasked with adding functionality to an existing custom post type. The problem was, the CPT was being registered in a plugin which I could not edit (client declined to give WDS write access to the /plugins folder).

After some digging, I found there’s a filter for that (found in post.php) which allows you to modify a custom post type (after it’s been registered some other way) and could do so in the theme.

apply_filters( 'register_post_type_args', $args, $post_type );

Hooking into that filter, allowed me to pass additional options to an existing CPT:

Now “Products” has an archive, along with some other meta boxes in the post editor. Nice!

Filter and clean the Archive Title

This client wanted to feature their archive titles in a large hero area. The PSD excluded the prefixes like, “Category:”, “Tag:”, “Author:”, etc…

The snippet below allows you to strip out the prefixes used in the get_the_archive_title(); function, as well as any HTML tags.

Screenshot of the clean archive title
Screenshot of the “clean” archive title.

Jeremy Pry helped me solve this by inserting this regular expression into PHP’s preg_replace();  function. It executes a find and replace on the $title variable.