-
-
Save tommcfarlin/f6a4f132ca47fef7ce65c76b480a6bc4 to your computer and use it in GitHub Desktop.
[WordPress] Demonstrating the SRP using WordPress submenu items and pages.
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 | |
| class Options_Page { | |
| private $options; | |
| public function __construct() { | |
| $this->options = get_option( 'acme-options-key' ); | |
| } | |
| public function display() { | |
| add_options_page( | |
| 'Acme Page Title', | |
| 'Submenu Item Title', | |
| 'manage_options', | |
| 'acme-options-page', | |
| array( $this, 'render' ) | |
| ); | |
| } | |
| public function render() { | |
| /** | |
| * This is where you can display any of the content for the page. | |
| * Some will write inline HTML, some will use an `echo` statement, | |
| * and others will use an `include_once` to another file. | |
| */ | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment