mirror of
https://gh.wpcy.net/https://github.com/elementor/one-click-accessibility.git
synced 2026-04-29 17:39:06 +08:00
* add: webhook endpoint * add: widget module * add: default widget settings on successful registration * update: name of global object to ea11yWidget * update: remove json encoding to make objects available on the frontend * update: widget url, filter and enqueuing method * update: removed obsolete code * update: enqueue script only when connected * update: add check for valid plan data and key * update: conditional check * update: conditional check
39 lines
962 B
PHP
39 lines
962 B
PHP
<?php
|
|
|
|
namespace EA11y\Modules\Settings\Classes;
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit; // Exit if accessed directly.
|
|
}
|
|
|
|
class Settings {
|
|
public const CLOSE_POST_CONNECT_MODAL = 'ea11y_close_post_connect_modal';
|
|
|
|
public const IS_VALID_PLAN_DATA = 'ea11y_is_valid_plan_data';
|
|
public const PLAN_DATA = 'ea11y_plan_data';
|
|
public const WIDGET_ICON_SETTINGS = 'ea11y_widget_icon_settings';
|
|
public const WIDGET_MENU_SETTINGS = 'ea11y_widget_menu_settings';
|
|
|
|
/**
|
|
* Returns plugin settings data by option name
|
|
* type cast to an appropriate data type.
|
|
*
|
|
* @param string $option_name
|
|
* @return mixed
|
|
*/
|
|
public static function get( string $option_name ) {
|
|
return get_option( $option_name );
|
|
}
|
|
|
|
/**
|
|
* Update the settings data by option name.
|
|
*
|
|
* @param string $option_name
|
|
* @param $value
|
|
*
|
|
* @return bool
|
|
*/
|
|
public static function set( string $option_name, $value ): bool {
|
|
return update_option( $option_name, $value, false );
|
|
}
|
|
}
|