PHP code example of automattic / jetpack-feature-flags
1. Go to this page and download the library: Download automattic/jetpack-feature-flags 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/ */
automattic / jetpack-feature-flags example snippets
use Automattic\Jetpack\Feature_Flags\Feature_Flags;
Feature_Flags::register(
'my-product-new-flow',
array(
'default' => false,
'description' => 'Enable the new product flow.',
'owner' => 'my-product',
)
);
if ( Feature_Flags::is_enabled( 'my-product-new-flow' ) ) {
// Load the feature.
}