mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
* feat: WooGraphQL settings tab added. * chore: WPCS compliance met * bugfix: Order Item Node ID implemented. * chore: Deprecated "AppContext::getLoader" calls replaced. * chore: WPCS compliance met. * fix: DownloadableItem "id" field implemented
50 lines
997 B
PHP
50 lines
997 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;
|
|
use WPGraphQL\WooCommerce\Admin\Substitutions;
|
|
|
|
/**
|
|
* Class Admin
|
|
*/
|
|
class Admin {
|
|
|
|
/**
|
|
* Admin constructor
|
|
*/
|
|
public function __construct() {
|
|
add_action( 'graphql_register_settings', [ $this, 'register_settings' ] );
|
|
}
|
|
|
|
/**
|
|
* Registers the WooGraphQL Settings tab.
|
|
*
|
|
* @param 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(),
|
|
);
|
|
|
|
$manager->settings_api->register_fields(
|
|
'woographql_settings',
|
|
Substitutions::get_fields(),
|
|
);
|
|
}
|
|
}
|