Skip to content

Commit

Permalink
Merge pull request #418 from 10up/feature/update-usage-of-get_plugin_…
Browse files Browse the repository at this point in the history
…settings

Update get_plugin_settings usage to name provider
  • Loading branch information
dkotter authored Mar 22, 2023
2 parents 92e9022 + 58c51f2 commit 260bb6e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions includes/Classifai/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function reset_plugin_settings() {
* @return string
*/
function get_watson_api_url() {
$settings = get_plugin_settings( 'language_processing' );
$settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );
$creds = ! empty( $settings['credentials'] ) ? $settings['credentials'] : [];

if ( ! empty( $creds['watson_url'] ) ) {
Expand All @@ -149,7 +149,7 @@ function get_watson_api_url() {
* @return string
*/
function get_watson_username() {
$settings = get_plugin_settings( 'language_processing' );
$settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );
$creds = ! empty( $settings['credentials'] ) ? $settings['credentials'] : [];

if ( ! empty( $creds['watson_username'] ) ) {
Expand All @@ -170,7 +170,7 @@ function get_watson_username() {
* @return string
*/
function get_watson_password() {
$settings = get_plugin_settings( 'language_processing' );
$settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );
$creds = ! empty( $settings['credentials'] ) ? $settings['credentials'] : [];

if ( ! empty( $creds['watson_password'] ) ) {
Expand Down Expand Up @@ -238,7 +238,7 @@ function get_post_statuses_for_language_settings() {
* return array
*/
function get_supported_post_types() {
$classifai_settings = get_plugin_settings( 'language_processing' );
$classifai_settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );

if ( empty( $classifai_settings ) ) {
$post_types = [];
Expand Down Expand Up @@ -273,7 +273,7 @@ function get_supported_post_types() {
* @return array
*/
function get_supported_post_statuses() {
$classifai_settings = get_plugin_settings( 'language_processing' );
$classifai_settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );

if ( empty( $classifai_settings ) ) {
$post_statuses = [ 'publish' ];
Expand Down Expand Up @@ -308,7 +308,7 @@ function get_supported_post_statuses() {
* @return bool
*/
function get_feature_enabled( $feature ) {
$settings = get_plugin_settings( 'language_processing' );
$settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );

if ( ! empty( $settings ) && ! empty( $settings['features'] ) ) {
if ( ! empty( $settings['features'][ $feature ] ) ) {
Expand Down Expand Up @@ -359,7 +359,7 @@ function language_processing_features_enabled() {
* @return int
*/
function get_feature_threshold( $feature ) {
$settings = get_plugin_settings( 'language_processing' );
$settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );
$threshold = 0;

if ( ! empty( $settings ) && ! empty( $settings['features'] ) ) {
Expand Down Expand Up @@ -403,7 +403,7 @@ function get_feature_threshold( $feature ) {
* @return string Taxonomy mapped to the feature
*/
function get_feature_taxonomy( $feature ) {
$settings = get_plugin_settings( 'language_processing' );
$settings = get_plugin_settings( 'language_processing', 'Natural Language Understanding' );
$taxonomy = 0;

if ( ! empty( $settings ) && ! empty( $settings['features'] ) ) {
Expand Down

0 comments on commit 260bb6e

Please sign in to comment.