Plugin Directory

Changeset 2073746


Ignore:
Timestamp:
04/24/2019 06:55:21 AM (7 years ago)
Author:
wordpresshandbuch
Message:

Configuration settings are only executed when on the proper settings page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wh-eyecatcher/trunk/wh-eyecatcher.php

    r2073734 r2073746  
    5959
    6060    public function page_init() {
    61         register_setting( 'wh_eyecatcher_option_group', 'wh_eyecatcher_slogan' );
    62         register_setting( 'wh_eyecatcher_option_group', 'wh_eyecatcher_style' );
    63         register_setting( 'wh_eyecatcher_option_group', 'wh_eyecatcher_css' );
     61        if (isset($_GET['page'])) {
     62            if (($_GET['page'] == 'wh-eyecatcher-page')) {
     63                register_setting( 'wh_eyecatcher_option_group', 'wh_eyecatcher_slogan' );
     64                register_setting( 'wh_eyecatcher_option_group', 'wh_eyecatcher_style' );
     65                register_setting( 'wh_eyecatcher_option_group', 'wh_eyecatcher_css' );
    6466
    65         add_settings_section( 'wh_eyecatcher_configuration', __('Options', 'wh_eyecatcher'), array( $this, 'print_section_info' ), 'wh-eyecatcher-page' );
    66         add_settings_field( 'wh_eyecatcher_slogan', 'Slogan', array( $this, 'print_form_field_slogan' ), 'wh-eyecatcher-page', 'wh_eyecatcher_configuration' );
    67         add_settings_field( 'wh_eyecatcher_style', 'Style', array( $this, 'print_form_field_style' ), 'wh-eyecatcher-page', 'wh_eyecatcher_configuration' );
    68         add_settings_field( 'wh_eyecatcher_css', 'CSS Style', array( $this, 'print_form_field_css' ), 'wh-eyecatcher-page', 'wh_eyecatcher_configuration' );
     67                add_settings_section( 'wh_eyecatcher_configuration', __('Options', 'wh_eyecatcher'), array( $this, 'print_section_info' ), 'wh-eyecatcher-page' );
     68                add_settings_field( 'wh_eyecatcher_slogan', 'Slogan', array( $this, 'print_form_field_slogan' ), 'wh-eyecatcher-page', 'wh_eyecatcher_configuration' );
     69                add_settings_field( 'wh_eyecatcher_style', 'Style', array( $this, 'print_form_field_style' ), 'wh-eyecatcher-page', 'wh_eyecatcher_configuration' );
     70                add_settings_field( 'wh_eyecatcher_css', 'CSS Style', array( $this, 'print_form_field_css' ), 'wh-eyecatcher-page', 'wh_eyecatcher_configuration' );
     71            }
     72        }
    6973    }
    7074
Note: See TracChangeset for help on using the changeset viewer.