-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
access-functions.php
45 lines (41 loc) · 1.13 KB
/
access-functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* This file contains access functions for various class methods.
*
* @package WPGraphQL/Login
* @since 0.0.1
*/
declare( strict_types = 1 );
use WPGraphQL\Login\Utils\Utils;
if ( ! function_exists( 'graphql_login_get_setting' ) ) {
/**
* Get an option value from the plugin settings.
*
* @param string $option_name The key of the option to return.
* @param mixed|false $default_value The default value the setting should return if no value is set.
*
* @uses \WPGraphQL\Login\Utils\Utils::get_setting()
*
* @return mixed
* @since 0.0.1
*/
function graphql_login_get_setting( string $option_name, $default_value = '' ) {
return Utils::get_setting( $option_name, $default_value );
}
}
if ( ! function_exists( 'graphql_login_get_provider_settings' ) ) {
/**
* Gets the provider settings from the database.
*
* @param string $slug The provider slug.
*
* @uses \WPGraphQL\Login\Utils\Utils::get_provider_settings()
*
* @return array<string,mixed>
*
* @since 0.0.1
*/
function graphql_login_get_provider_settings( string $slug ): array {
return Utils::get_provider_settings( $slug );
}
}