Constants are referable terms in the code that can not be altered.
Below you’ll find the constants as defined or used in the code as of The SEO Framework v5.0.0.
To learn the basics, please read the PHP manual on using constants.
User definable constants
The following constants can be defined by the user in wp-config.php
or a mu-plugin. These constants should not be defined in theme-files. They shouldn’t be defined in a plugin either, as there might be load-sequence issues that will cause fatal errors.
Below you’ll find examples.
/**
* The user capability required to access the extension overview page.
*
* == WARNING ==
* When this constant is used incorrectly, you can expose your site to
* unforeseen security risks. We assume the role supplied here is lower than the webmaster's;
* for example, in a WPMU environment. However, proceed with caution.
*
* @since 4.1.0
* @param string
*/
define( 'THE_SEO_FRAMEWORK_SETTINGS_CAP', 'manage_options' );
/**
* The user capability required to have SEO-fields on their profiles.
*
* == WARNING ==
* When this constant is used incorrectly, you can expose your site to
* unforeseen security risks. We assume the role supplied here is lower than the webmaster's;
* for example, in a WPMU environment. However, proceed with caution.
*
* @since 4.1.0
* @param string
*/
define( 'THE_SEO_FRAMEWORK_AUTHOR_INFO_CAP', 'edit_posts' );
/**
* Enables the site-wide SEO debugging interface.
*
* @since 2.3.4
* @since 5.0.0 Is now registered during plugin load.
* @param bool
*/
define( 'THE_SEO_FRAMEWORK_DEBUG', false );
/**
* The plugin's main settings page slug.
*
* @since 5.0.0
* @param bool
*/
define( 'THE_SEO_FRAMEWORK_SITE_OPTIONS_SLUG', 'theseoframework-settings' );
/**
* Disables hints and infrequent notification about our other services.
*
* @since 3.0.6
* @param bool
*/
define( 'TSF_DISABLE_SUGGESTIONS', false );
Predefined constants
The SEO Framework defines various constants itself. You can refer to these in your plugin or theme. You can not alter these.
/**
* The plugin version.
*
* 3 point: x.x.y; x.x is major; y is minor.
*
* @since 2.3.5
*/
define( 'THE_SEO_FRAMEWORK_VERSION', '4.2.0' );
/**
* The plugin Database version.
*
* Used for lightweight version upgrade comparing.
*
* @since 2.7.0
*/
define( 'THE_SEO_FRAMEWORK_DB_VERSION', '4200' );
/**
* The plugin file, absolute unix path.
* @since 2.2.9
*/
define( 'THE_SEO_FRAMEWORK_PLUGIN_BASE_FILE', __FILE__ );
/**
* The plugin's bootstrap folder location.
* @since 3.1.0
*/
define( 'THE_SEO_FRAMEWORK_BOOTSTRAP_PATH', dirname( THE_SEO_FRAMEWORK_PLUGIN_BASE_FILE ) . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR );
/**
* Tells the world the plugin is present and to be used.
* @since 3.1.0
*/
define( 'THE_SEO_FRAMEWORK_PRESENT', true );
/**
* The plugin options database option_name key.
*
* Used for storing the SEO options array.
*
* @since 2.2.2
* @param string THE_SEO_FRAMEWORK_SITE_OPTIONS
* @since 5.0.0 Removed its filter.
*/
define( 'THE_SEO_FRAMEWORK_SITE_OPTIONS', 'autodescription-site-settings' );
/**
* Plugin term options key.
*
* @since 2.7.0
* @param string THE_SEO_FRAMEWORK_TERM_OPTIONS
* @since 5.0.0 Removed its filter.
*/
define( 'THE_SEO_FRAMEWORK_TERM_OPTIONS', 'autodescription-term-settings' );
/**
* Plugin user term options key.
*
* @since 2.7.0
* @param string THE_SEO_FRAMEWORK_USER_OPTIONS
* @since 5.0.0 Removed its filter.
*/
define( 'THE_SEO_FRAMEWORK_USER_OPTIONS', 'autodescription-user-settings' );
/**
* Plugin updates cache key.
*
* @since 3.1.0
* @param string THE_SEO_FRAMEWORK_SITE_CACHE
* @since 5.0.0 1. Removed its filter.
* 2. Changed the default value from 'autodescription-updates-cache'.
*/
define( 'THE_SEO_FRAMEWORK_SITE_CACHE', 'autodescription-site-cache' );
/**
* The plugin folder URL. Has a trailing slash.
* Used for calling browser files.
*
* @since 2.2.2
*/
define( 'THE_SEO_FRAMEWORK_DIR_URL', plugin_dir_url( THE_SEO_FRAMEWORK_PLUGIN_BASE_FILE ) );
/**
* The plugin file relative to the plugins dir. Does not have a trailing slash.
*
* @since 2.2.8
*/
define( 'THE_SEO_FRAMEWORK_PLUGIN_BASENAME', plugin_basename( THE_SEO_FRAMEWORK_PLUGIN_BASE_FILE ) );
/**
* The plugin folder absolute path.
* Used for calling php files.
*
* @since 2.2.2
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH', dirname( THE_SEO_FRAMEWORK_PLUGIN_BASE_FILE ) . DIRECTORY_SEPARATOR );
/**
* The plugin views folder absolute path.
*
* @since 2.7.0
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH_VIEWS', THE_SEO_FRAMEWORK_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'views' . DIRECTORY_SEPARATOR );
/**
* The plugin class folder absolute path.
*
* @since 2.2.9
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH_CLASS', THE_SEO_FRAMEWORK_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR );
/**
* The plugin trait folder absolute path.
*
* @since 3.1.0
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH_TRAIT', THE_SEO_FRAMEWORK_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'traits' . DIRECTORY_SEPARATOR );
/**
* The plugin interface folder absolute path.
*
* @since 2.8.0
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH_INTERFACE', THE_SEO_FRAMEWORK_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'interfaces' . DIRECTORY_SEPARATOR );
/**
* The plugin function folder absolute path.
*
* @since 2.2.9
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH_FUNCT', THE_SEO_FRAMEWORK_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'functions' . DIRECTORY_SEPARATOR );
/**
* The plugin compatibility folder absolute path.
*
* @since 2.8.0
*/
define( 'THE_SEO_FRAMEWORK_DIR_PATH_COMPAT', THE_SEO_FRAMEWORK_DIR_PATH . 'inc' . DIRECTORY_SEPARATOR . 'compat' . DIRECTORY_SEPARATOR );
/**
* Robots setting, ignore protection.
*
* @since 4.0.0
* @see \The_SEO_Framework\Generate\robots_meta()
*/
const \The_SEO_Framework\ROBOTS_IGNORE_PROTECTION = 0b001;
/**
* Robots setting, ignore settings.
*
* @since 4.0.0
* @see \The_SEO_Framework\Generate\robots_meta()
*/
const \The_SEO_Framework\ROBOTS_IGNORE_SETTINGS = 0b010;
/**
* Robots setting, enable asserting.
*
* @since 4.2.0
* @see \The_SEO_Framework\Generate\robots_meta()
*/
const \The_SEO_Framework\ROBOTS_ASSERT = 0b100;