Skip to content

Instantly share code, notes, and snippets.

@szbl
Last active December 19, 2015 08:19
Show Gist options
  • Save szbl/5924584 to your computer and use it in GitHub Desktop.
Save szbl/5924584 to your computer and use it in GitHub Desktop.
Example of an auto-included plugin "controller" script.
<?php
if ( class_exists( 'Sizeable_Person' ) ) :
add_action( 'add_meta_boxes', 'szbl_mvc_example_add_meta_boxes' );
function szbl_mvc_example_add_meta_boxes()
{
add_meta_box( 'szbl-mvc-person-meta', 'Additional Information', 'szbl_mvc_example_meta_output', Sizeable_Person::POST_TYPE_SLUG, 'normal', 'high' );
}
function szbl_mvc_example_meta_output()
{
if ( file_exists( dirname( __FILE__ ) . '/views/meta.php' ) )
include dirname( __FILE__ ) . '/views/meta.php';
}
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment