Option Adapter
The jankx/option-adapter acts as a bridge between the theme settings and the data storage engine. It allows Jankx to work seamlessly with different option frameworks like Redux Framework or WordPress's Native Options API.
Abstraction Layer
By using the adapter pattern, Jankx core remains agnostic of how data is saved. This means you can switch from a heavy framework to a native implementation without changing your theme's logic.
interface OptionAdapterInterface {
public function get($key, $default = null);
public function set($key, $value);
public function save();
}
Native Adapter
The Native Adapter uses standard WordPress get_option and update_option. It is lightweight and recommended for simple sites.
Redux Adapter
The Redux Adapter connects Jankx to the popular Redux Framework. It maps field types and sections correctly to ensure compatibility with legacy themes or advanced configurations.
use Jankx\Option\Adapters\ReduxAdapter;
// Registering the adapter
$adapter = new ReduxAdapter('opt_name');
jankx_register_option_adapter($adapter);
Developed with ❤️ by Jankx Team.