Get Options with wp_sms_get_option() in WordPress

Updated on Jan 03, 2023

In this document, we will show you how to use the wp_sms_get_option() function to retrieve any available options from the WP SMS or WP SMS Pro plugin for WordPress. This function returns a variety of settings and options values for your SMS messages to you, as well as options from the default WordPress installation. Let’s get started!

As a default, it will be working with the WP SMS setting name.

Parameters

wp_sms_get_option( $option_name, $pro = false, $setting_name = '' );
  • $option_name (string) (Required) The option name.
  • $pro (boolean) (Required) The SMS text message.
  • $setting_name (string) (Optional) The whole setting name that you want to get value from it.

Example

// Get international_mobile option value from WP-SMS setting
wp_sms_get_option( 'international_mobile' );

// Get wc_mobile_field option value from WP-SMS-Pro setting
wp_sms_get_option( 'wc_mobile_field', true );

// Get option_name option value from custom setting
// The $pro parameter not important to be used as false or true
wp_sms_get_option( 'option_name', false, 'wps_wc_otp' );
Tags:
halloween