Fragen\GitHub_Updater\Install::register_settings PHP Method

register_settings() public method

Add settings sections.
public register_settings ( string $type )
$type string
    public function register_settings($type)
    {
        /*
         * Place translatable strings into variables.
         */
        if ('plugin' === $type) {
            $repo_type = esc_html__('Plugin', 'github-updater');
        }
        if ('theme' === $type) {
            $repo_type = esc_html__('Theme', 'github-updater');
        }
        register_setting('github_updater_install', 'github_updater_install_' . $type, array('Fragen\\GitHub_Updater\\Settings', 'sanitize'));
        add_settings_section($type, sprintf(esc_html__('GitHub Updater Install %s', 'github-updater'), $repo_type), array(), 'github_updater_install_' . $type);
        add_settings_field($type . '_repo', sprintf(esc_html__('%s URI', 'github-updater'), $repo_type), array(&$this, 'get_repo'), 'github_updater_install_' . $type, $type);
        add_settings_field($type . '_branch', esc_html__('Repository Branch', 'github-updater'), array(&$this, 'branch'), 'github_updater_install_' . $type, $type);
        add_settings_field($type . '_api', esc_html__('Remote Repository Host', 'github-updater'), array(&$this, 'install_api'), 'github_updater_install_' . $type, $type);
        add_settings_field('github_access_token', esc_html__('GitHub Access Token', 'github-updater'), array(&$this, 'github_access_token'), 'github_updater_install_' . $type, $type);
        if (empty(parent::$options['bitbucket_username']) || empty(parent::$options['bitbucket_password'])) {
            add_settings_field('bitbucket_username', esc_html__('Bitbucket Username', 'github-updater'), array(&$this, 'bitbucket_username'), 'github_updater_install_' . $type, $type);
            add_settings_field('bitbucket_password', esc_html__('Bitbucket Password', 'github-updater'), array(&$this, 'bitbucket_password'), 'github_updater_install_' . $type, $type);
        }
        add_settings_field('is_private', esc_html__('Private Bitbucket Repository', 'github-updater'), array(&$this, 'is_private_repo'), 'github_updater_install_' . $type, $type);
        if (empty(parent::$options['gitlab_access_token']) || empty(parent::$options['gitlab_enterprise_token'])) {
            add_settings_field('gitlab_access_token', esc_html__('GitLab Access Token', 'github-updater'), array(&$this, 'gitlab_access_token'), 'github_updater_install_' . $type, $type);
        }
    }