Created
January 18, 2012 03:52
-
-
Save mikeschinkel/1630788 to your computer and use it in GitHub Desktop.
Example showing how to use proposed add_autohook_support() for WordPress.
This file contains 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 | |
/** | |
* Example for use of proposed add_autohook_support() for WordPress. | |
* | |
* @see: https://gist.github.com/1630212 | |
* | |
* @author Mike Schinkel - http://about.me/mikeschinkel/ | |
* | |
* @wp-autohook implicit | |
* | |
*/ | |
class AutoHook_Example { | |
/** | |
* @wp-nohook | |
*/ | |
static function on_load() { | |
add_autohook_support( __CLASS__ ); | |
} | |
/** | |
* @wp-filter manage_edit-person_columns 25 | |
*/ | |
static function manage_edit_person_columns( ... ) { | |
... | |
} | |
/** | |
* @wp-filter manage_edit-page_columns | |
*/ | |
static function manage_edit_page_columns( ... ) { | |
... | |
} | |
/** | |
* @wp-priority 25 | |
*/ | |
static function save_post( ... ) { | |
... | |
} | |
/** | |
* @wp-nohook | |
*/ | |
static function init( ... ) { | |
... | |
} | |
} | |
AutoHook_Example::on_load() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment