PHP code example of twindigital / wordpress-settings-api-class
1. Go to this page and download the library: Download twindigital/wordpress-settings-api-class 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/ */
twindigital / wordpress-settings-api-class example snippets
/**
* Get the value of a settings field
*
* @param string $option settings field name
* @param string $section the section name this field belongs to
* @param string $default default text if it's not found
*
* @return mixed
*/
function prefix_get_option( $option, $section, $default = '' ) {
$options = getOption( $section );
if ( isset( $options[$option] ) ) {
return $options[$option];
}
return $default;
}