Automattic\WooCommerce\Admin\API

Options::get_default_option_permissions()public staticWC 1.0

Get the default available option permissions.

Метод класса: Options{}

No Hooks.

Return

Array.

Usage

$result = Options::get_default_option_permissions();

Код Options::get_default_option_permissions() WC 7.1.0

public static function get_default_option_permissions() {
	$is_woocommerce_admin    = \Automattic\WooCommerce\Internal\Admin\Homescreen::is_admin_user();
	$woocommerce_permissions = array(
		'woocommerce_setup_jetpack_opted_in',
		'woocommerce_stripe_settings',
		'woocommerce-ppcp-settings',
		'woocommerce_ppcp-gateway_setting',
		'woocommerce_demo_store',
		'woocommerce_demo_store_notice',
		'woocommerce_ces_tracks_queue',
		'woocommerce_navigation_intro_modal_dismissed',
		'woocommerce_shipping_dismissed_timestamp',
		'woocommerce_allow_tracking',
		'woocommerce_task_list_keep_completed',
		'woocommerce_task_list_prompt_shown',
		'woocommerce_default_homepage_layout',
		'woocommerce_setup_jetpack_opted_in',
		'woocommerce_no_sales_tax',
		'woocommerce_calc_taxes',
		'woocommerce_bacs_settings',
		'woocommerce_bacs_accounts',
		'woocommerce_task_list_prompt_shown',
		'woocommerce_settings_shipping_recommendations_hidden',
		'woocommerce_task_list_dismissed_tasks',
		'woocommerce_setting_payments_recommendations_hidden',
		'woocommerce_navigation_favorites_tooltip_hidden',
		'woocommerce_marketing_overview_welcome_hidden',
		'woocommerce_admin_transient_notices_queue',
		'woocommerce_task_list_welcome_modal_dismissed',
		'woocommerce_welcome_from_calypso_modal_dismissed',
		'woocommerce_task_list_hidden',
		'woocommerce_task_list_complete',
		'woocommerce_extended_task_list_hidden',
		'woocommerce_ces_shown_for_actions',
		'woocommerce_clear_ces_tracks_queue_for_page',
		'woocommerce_admin_install_timestamp',
		'woocommerce_task_list_tracked_completed_tasks',
		'woocommerce_show_marketplace_suggestions',
		'woocommerce_task_list_reminder_bar_hidden',
		'wc_connect_options',
		'woocommerce_admin_created_default_shipping_zones',
		'woocommerce_admin_reviewed_default_shipping_zones',
		'woocommerce_admin_reviewed_store_location_settings',
	);

	$theme_permissions = array(
		'theme_mods_' . get_stylesheet() => current_user_can( 'edit_theme_options' ),
		'stylesheet'                     => current_user_can( 'edit_theme_options' ),
	);

	return array_merge(
		array_fill_keys( $theme_permissions, current_user_can( 'edit_theme_options' ) ),
		array_fill_keys( $woocommerce_permissions, $is_woocommerce_admin )
	);
}