Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update get_plugin_settings usage to name provider #418

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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