クラス
Options
Wishlist options. Contains CRUD methods for option data.
ソース ソース
ファイル: src/Config/Options.php
class Options { const KEY = 'wcexwl_options'; /** * Returns option data as an array * * @author Evan D Shaw <evandanielshaw@gmail.com> * @return array */ public static function getOptions() { $opts = get_option(self::KEY); $opts = is_array($opts) ? $opts : []; $opts['use_react'] = isset($opts['use_react']) ? (bool)$opts['use_react'] : false; return $opts; } /** * Returns `true` if we should use React implementation of WCEX Wishlist, `false` otherwise * * @author Evan D Shaw <evandanielshaw@gmail.com> * @return mixed */ public static function useReact() { return self::getOptions()['use_react']; } }
- getOptions — Returns option data as an array
- useReact — Returns true if we should use React implementation of WCEX Wishlist, false otherwise