WooCommerce::define_constants()
Define WC Constants.
Method of the class: WooCommerce{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->define_constants();
WooCommerce::define_constants() WooCommerce::define constants code WC 9.2.3
private function define_constants() { $upload_dir = wp_upload_dir( null, false ); $this->define( 'WC_ABSPATH', dirname( WC_PLUGIN_FILE ) . '/' ); $this->define( 'WC_PLUGIN_BASENAME', plugin_basename( WC_PLUGIN_FILE ) ); $this->define( 'WC_VERSION', $this->version ); $this->define( 'WOOCOMMERCE_VERSION', $this->version ); $this->define( 'WC_ROUNDING_PRECISION', 6 ); $this->define( 'WC_DISCOUNT_ROUNDING_MODE', 2 ); $this->define( 'WC_TAX_ROUNDING_MODE', 'yes' === get_option( 'woocommerce_prices_include_tax', 'no' ) ? 2 : 1 ); $this->define( 'WC_DELIMITER', '|' ); $this->define( 'WC_SESSION_CACHE_GROUP', 'wc_session_id' ); $this->define( 'WC_TEMPLATE_DEBUG_MODE', false ); /** * As of 8.8.0, it is preferable to use the `woocommerce_log_directory` filter hook to change the log * directory. WC_LOG_DIR_CUSTOM is a back-compatibility measure so we can tell if `WC_LOG_DIR` has been * defined outside of WC Core. */ if ( defined( 'WC_LOG_DIR' ) ) { $this->define( 'WC_LOG_DIR_CUSTOM', true ); } $this->define( 'WC_LOG_DIR', LoggingUtil::get_log_directory() ); // These three are kept defined for compatibility, but are no longer used. $this->define( 'WC_NOTICE_MIN_PHP_VERSION', '7.2' ); $this->define( 'WC_NOTICE_MIN_WP_VERSION', '5.2' ); $this->define( 'WC_PHP_MIN_REQUIREMENTS_NOTICE', 'wp_php_min_requirements_' . WC_NOTICE_MIN_PHP_VERSION . '_' . WC_NOTICE_MIN_WP_VERSION ); /** Define if we're checking against major, minor or no versions in the following places: * - plugin screen in WP Admin (displaying extra warning when updating to new major versions) * - System Status Report ('Installed version not tested with active version of WooCommerce' warning) * - core update screen in WP Admin (displaying extra warning when updating to new major versions) * - enable/disable automated updates in the plugin screen in WP Admin (if there are any plugins * that don't declare compatibility, the auto-update is disabled) * * We dropped SemVer before WC 5.0, so all versions are backwards compatible now, thus no more check needed. * The SSR in the name is preserved for bw compatibility, as this was initially used in System Status Report. */ $this->define( 'WC_SSR_PLUGIN_UPDATE_RELEASE_VERSION_TYPE', 'none' ); }