Function __global->get_ecommerce_option

Definitions

sources/ecommerce.php

  • Get either the live or the testing value of an eCommerce config option.This wraps get_option.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$config_option ID_TEXT No No required parameter N/A N/A The name of the configuration option
$missing_ok boolean No No False N/A N/A Whether to accept a missing option (and return null)
$return_testing ?boolean No No Null N/A N/A Return the testing value instead of the live value (null: returns testing value if ecommerce_test_mode(), else returns live value)

Returns

  • The configuration value (null: configuration not found and $missing_ok set to true)
  • Type: ?string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get either the live or the testing value of an eCommerce config option.This wraps get_option.
 *
 * @param  ID_TEXT $config_option The name of the configuration option
 * @param  boolean $missing_ok Whether to accept a missing option (and return null)
 * @param  ?boolean $return_testing Return the testing value instead of the live value (null: returns testing value if ecommerce_test_mode(), else returns live value)
 * @return ?string The configuration value (null: configuration not found and $missing_ok set to true)
 */

function get_ecommerce_option(string $config_option, bool $missing_ok = false, ?bool $return_testing = null) : ?string