Skip to content

Commit

Permalink
Make static all the settings page methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
benlk committed May 16, 2019
1 parent 31200e4 commit 4ef8919
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions inc/admin/class-mailchimp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function init() {
add_action( 'admin_init', array( $this, 'register_settings' ) );
}

public function add_options_page() {
public static function add_options_page() {
add_options_page(
'MailChimp Settings',
'MailChimp Settings',
Expand All @@ -45,7 +45,7 @@ public function add_options_page() {
);
}

public function register_settings() {
public static function register_settings() {
register_setting(
'mailchimp_settings',
'mailchimp_settings'
Expand All @@ -65,14 +65,21 @@ public function register_settings() {
);
}

public function mailchimp_api_key_input() {
$settings = get_option( 'mailchimp_settings' ); ?>
<input style="width: 300px;" type="text" name="mailchimp_settings[mailchimp_api_key]" id="mailchimp_api_key"
value="<?php echo $settings['mailchimp_api_key']; ?>"
placeholder="MailChimp API Key" /><?php
public static function mailchimp_api_key_input() {
$settings = get_option( 'mailchimp_settings' );
?>
<input
style="width: 300px;"
type="text"
name="mailchimp_settings[mailchimp_api_key]"
id="mailchimp_api_key"
value="<?php echo esc_attr( $settings['mailchimp_api_key'] ); ?>"
placeholder="MailChimp API Key"
/>
<?php
}

public function render_settings_page() {
public static function render_settings_page() {
mailchimp_tools_render_template( 'settings.php' );
}
}

0 comments on commit 4ef8919

Please sign in to comment.