';
settings_fields( $option_long_name );
}
$this->set_option( $option );
}
/**
* Set the option used in output for form elements
*
* @since 2.0
*
* @param string $option_name Option key.
*/
public function set_option( $option_name ) {
$this->option_name = $option_name;
$this->options = $this->get_option();
}
/**
* Sets a value in the options.
*
* @since 5.4
*
* @param string $key The key of the option to set.
* @param mixed $value The value to set the option to.
* @param bool $overwrite Whether to overwrite existing options. Default is false.
*/
public function set_options_value( $key, $value, $overwrite = false ) {
if ( $overwrite || ! array_key_exists( $key, $this->options ) ) {
$this->options[ $key ] = $value;
}
}
/**
* Retrieve options based on whether we're on multisite or not.
*
* @since 1.2.4
* @since 2.0 Moved to this class.
*
* @return array
*/
private function get_option() {
if ( is_network_admin() ) {
return get_site_option( $this->option_name );
}
return get_option( $this->option_name );
}
/**
* Generates the footer for admin pages
*
* @since 2.0
*
* @param bool $submit Whether or not a submit button and form end tag should be shown.
* @param bool $show_sidebar Whether or not to show the banner sidebar - used by premium plugins to disable it.
*/
public function admin_footer( $submit = true, $show_sidebar = true ) {
if ( $submit ) {
submit_button( __( 'Save changes', 'wordpress-seo' ) );
echo '
';
}
/**
* Apply general admin_footer hooks
*/
do_action( 'wpseo_admin_footer' );
/**
* Run possibly set actions to add for example an i18n box
*/
do_action( 'wpseo_admin_promo_footer' );
echo '
';
if ( $show_sidebar ) {
$this->admin_sidebar();
}
echo '
';
if ( ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) ) {
$xdebug = ( extension_loaded( 'xdebug' ) ? true : false );
echo '