[WordPress] Demonstrating the SRP using WordPress submenu items and pages.
<?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