Files
wp-graphql-woocommerce/includes/class-admin.php
T
f583628199 chore: implement WPGraphQL Coding Standards (#769)
* chore: avoid magic constants [PHPCS]

* chore: change ruleset to wp-graphql-cs and lint

* devops: HPOS added back to CI with the release of WC 3.9

---------

Co-authored-by: Geoff Taylor <geoff@axistaylor.com>
2023-07-19 17:11:25 -04:00

43 lines
867 B
PHP

<?php
/**
* Initializes a WooGraphQL Pro admin settings.
*
* @package WPGraphQL\WooCommerce\Pro
* @since 1.0.0
*/
namespace WPGraphQL\WooCommerce;
use WPGraphQL\Admin\Settings\Settings;
use WPGraphQL\WooCommerce\Admin\General;
/**
* Class Admin
*/
class Admin {
/**
* Admin constructor
*/
public function __construct() {
add_action( 'graphql_register_settings', [ $this, 'register_settings' ] );
}
/**
* Registers the WooGraphQL Settings tab.
*
* @param \WPGraphQL\Admin\Settings\Settings $manager Settings Manager.
* @return void
*/
public function register_settings( Settings $manager ) {
$manager->settings_api->register_section(
'woographql_settings',
[ 'title' => __( 'WooGraphQL', 'wp-graphql-woocommerce' ) ]
);
$manager->settings_api->register_fields(
'woographql_settings',
General::get_fields()
);
}
}