Last active
April 22, 2016 06:19
-
-
Save amostajo/f857c828ea9be74fa06a7e54e6215ca6 to your computer and use it in GitHub Desktop.
Wordpress MVC - Add action legacy
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 | |
class Main extends Plugin | |
{ | |
public function init() | |
{ | |
// This will call 'save_post' function located in Main class. | |
add_action( 'save_post', [ &$this, 'save_post' ] ); | |
} | |
// Callback handler for action 'save_post'. | |
public function save_post() | |
{ | |
// TODO CODE | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment