PHP code example of sau / wp-settings-api

1. Go to this page and download the library: Download sau/wp-settings-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sau / wp-settings-api example snippets


use Sau\WP\SettingsAPI\SettingsGroup;

$group_id='pages';
$group_title='Страницы';
$page_id='reading';
$setting_group = new SettingsGroup($group_id,$group_title,$page_id);


$setting_group = new SettingsGroup( ... );

$setting_group
    ->addField(new UrlField($id, $title));
    //->addField(new TextField($id, $title));
    //->addField(new SelectField($id, $title));
    //->addField(new PasswordField($id, $title));
    //->addField(new PageListField($id, $title));
    //->addField(new EmailField($id, $title));