Last active
July 8, 2017 02:14
-
-
Save ekandreas/3ea742d2ce4a991d6fe0 to your computer and use it in GitHub Desktop.
papi page types in theme
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace ekandreas; | |
class Papi | |
{ | |
function __construct() | |
{ | |
add_filter( 'papi/settings/directories', function ( $directories ) { | |
$directories[] = dirname(__FILE__) . '/page-types'; | |
return $directories; | |
} ); | |
} | |
static function is_papi_page() { | |
return !!\papi_get_page_type_id(); | |
} | |
} | |
new Papi(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment