Skip to content

Instantly share code, notes, and snippets.

@traversal
Created December 6, 2014 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save traversal/ba1244ef052ecc7aa05f to your computer and use it in GitHub Desktop.
Save traversal/ba1244ef052ecc7aa05f to your computer and use it in GitHub Desktop.
Init Function
<?php
// place this inside functions.php
function my_function() {
global $wf;
// should be able to loop over post types, for example
foreach ( $wf->post_types as $pt ) {
}
// ... or access a specific one
$type = $wf->type("product");
}
add_action('mp_init', 'my_function');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment