Framework 2.4

February 2, 2020

Framework 2.4 brings with it two additional conditional callbacks, the isPostType and isPostTypeArchive callbacks.

IsPostType

The isPostType callback can be used like this:

$app->isPostType('icecream', function() use ($app) {

  // your code goes here.

});

Where the icecream is the post type name in slug form.

IsPostTypeArchive

The isPostTypeArchive callback can be used like this:

$app->isPostTypeArchive('icecream', function() use ($app) {

  // your code goes here.

});

Where the icecream, again, is the post type name in slug form.