PHP code example of iranimij / wp-options-manager
1. Go to this page and download the library: Download iranimij/wp-options-manager 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/ */
iranimij / wp-options-manager example snippets
composer
// Updating an option
wp_options_manager()->update( 'test-option-key', 'test-option-value' )->save();
// Updating two options in a row
wp_options_manager()->update( 'test-option-key', 'test-option-value' )->update( 'test-option-key2', 'test-option-value2' )->save();
// Updating multiple keys in just one array
wp_options_manager()->update( [
'first-key' => 'first-value',
'second-key' => 'second-value',
'third-key' => 'third-value',
] )->save();
// Getting an option => Output = 'test-option-value
wp_options_manager()->select( 'test-option-key' );
// Deleting an option
wp_options_manager()->delete( 'test-option-key' );