Pods offers web developers the ability to globally set options, tucked away and invisible to client eyes. These constants can be defined in wp-config.php or in a file inside your mu-plugins folder. By defining these constants, you’re able to alter the default functionality in Pods; settings such as hiding the Pods sidebar menu, toggling on or off Pods’ API cache, enabling or disabling Pods Components, and more.
When defining a Pods constant, be sure that it’s defined before Pods loads, which is when the plugins_loaded action runs.
Before defining any constant, determine if it’s actually needed; remember: constants are constant, and defining a constant without understanding what is actually happening could have adverse effects!
NOTE: All defaults listed below are as of Pods 2.8.6
Contents
How to Define a Constant
The syntax you should follow goes like this: define( 'CONSTANT_NAME', 'constant value' );
An example using a Pods constant might look like this: define( 'PODS_DISABLE_CONTENT_MENU', true );
Following you will find all of the available constants provided within the Pods codebase. Unless otherwise noted, all Pods constants available accept boolean values: i.e. one of true or false
Admin Visibility
These constants can disable some of Pods Admin screens from showing up, when no longer needed (or for Production sites that have Staging sites to manage configurations).
PODS_DISABLE_CONTENT_MENUDefault:false- Hides the ‘Pods’ menu that shows all pods content pages for any pod that does not have it’s own top-level menu item. Note: You can set access to individual Pods by capability using the Pods Roles component or using our supported user capabilities for Advanced Content Types.
PODS_DISABLE_ADMIN_MENUDefault:false- Hides the ‘Pods Admin’ menu for users of any role. Note: You can set access to the Pods admin menu by user level using the Pods Roles component or using our supported user capabilities for Pods Administration.
Advanced / Performance
These are advanced constants, using them may improve performance or enable advanced functionality depending on needs of a project.
PODS_LIGHTDefault:false- Disables all Pods components.
PODS_TABLELESSDefault:false- Enables “Tableless Mode”. No additional database tables such as wp_podsrel will be created nor utilized. The wp_podsrel table is created on activation
PODS_MEDIADefault:true- Disable including Pods media helper functions.
PODS_ALLOW_FULL_METADefault:true- Set to false to prevent get_post_meta( $id ) interaction with Pods for meta storage Pods.
PODS_STRICTDefault:false- True will enable strict mode, which results in global pagination disabled and global search disabled in pods() (unless manually set in $params); False will disable $_SERVER access in pods_v and from special magic tags; Disables deprecated functionality; And pods( ‘pod_does_not_exist’ ) will return false instead of an object
PODS_API_CACHEDefault:false- Disables Pods API caching, used to cache data for Pods, Fields, and other lookups Pods does often.
PODS_PRELOAD_CONFIG_AFTER_FLUSHDefault:false- Enables a performance tweak that rebuilds all of the config data needed for Pods directly after flushing Pods caches from Pods Admin > Settings > Clear Pods Caches. With this, on the next page load everything will already be generated and set in the cache. Useful for large configurations.
PODS_FIELD_STRICTDefault:true- Names for Pods or Pod Fields reserved for internal use can be used for new Pods or Pod Fields. Use with caution.
PODS_SESSION_AUTO_STARTDefault:true- Disables Sessions from starting when Pods is loaded. Sessions are used by Pods for securing usage of public forms visitors who are not logged in.
Security
These constants affect the security of your site, use them according to the level of trust of your WordPress admins and authors.
Improved Security
PODS_DISABLE_EVALDefault:true- Disables PHP eval(), and Pods will not allow PHP code added in the admin interface to be output. No PHP code will be output either, so source code will not be leaked. PHP eval() currently is in use by Pods Templates and Pods Pages (and the deprecated Pods Helpers) components. This was defaulted to true in Pods 3.2.7 and all PHP eval handling will be removed in a future release.
PODS_DISABLE_SHORTCODEDefault:false- Disables Pods shortcodes.
PODS_DISABLE_SHORTCODE_SQLDefault:false- Disables passing SQL directly into Pods Shortcodes. This will disable usage of “orderby”, “where”, “having” , “groupby” and “select” arguments for Pods::find() $params in the shortcodes.
PODS_DISABLE_FILE_UPLOADDefault:false- Disables the ability to upload any files via Pods.
PODS_DISABLE_FILE_BROWSERDefault:false- Disables access to the file browser when uploading files via Pods file fields.
Trusted Admins, Less Secure
PODS_UPLOAD_REQUIRE_LOGINDefault:false- Allow users who are NOT logged in to upload files via Pods file fields. Set to a string with a capability name to restrict by capability. Use this with caution.
PODS_FILES_REQUIRE_LOGINDefault:true- Allow users who are NOT logged in to see the file browser via Pods file fields. Set to a string with a capability name to restrict by capability. Use this with caution.
PODS_SHORTCODE_ALLOW_EVALUATE_TAGSDefault:false- Allows shortcodes to evaluate special magic tags which appear like magic tags, but the values are mapped through pods_v(). Use this with caution.
PODS_SHORTCODE_ALLOW_SUB_SHORTCODESDefault:false- Allows shortcodes to be embedded from within Pods Shortcodes. This is a necessary step to allow shortcodes to be ran within the Pods Templates.
PODS_TEMPLATES_ALLOW_OTHER_SHORTCODESDefault:false- Added in Pods 2.8.6. Allows shortcodes to be embedded from within Pods Template Tags.
PODS_SHORTCODE_ALLOW_BLOG_SWITCHINGDefault:false- Allows the
blog_idparameter in Pods Shortcodes to allow Blog Switching which allows you to run shortcodes against Pods defined in other network sites. PODS_GLOBAL_POD_PAGINATIONDefault:true– Any pod can be paginated- Globally disables pagination from Pods class. Can be overridden in Pods::find() $params.
PODS_GLOBAL_POD_SEARCHDefault:true– Any pod can be searched- Globally disables search in Pods class. Can be overridden in Pods::find() $params.
See PODS_STRICT in the Advanced section above in relation to $_SERVER access in pods_v().
Minimum Requirements
Changing these constants is not recommended; these are the minimum versions Pods is unit tested against and known to work with. If a version does not meet the minimum requirements, Pods will not be loaded and an admin warning notice will be displayed in the WP Admin area. The values defined in these constants are strings, not booleans.
PODS_WP_VERSION_MINIMUMDefault:5.5- The minimum version of WordPress required.
PODS_PHP_VERSION_MINIMUMDefault:5.6- The minimum version of PHP required.
PODS_MYSQL_VERSION_MINIMUMDefault:5.5- The minimum version of MySQL required.
Pods Pages
These are constants specifically related to the Pods Pages component.
PODS_DISABLE_POD_PAGE_CHECKDefault:false- Disables the check that is run before a page loads to see if Pods Pages is being used.
PODS_DISABLE_METADefault:false- Disables output of the $pods->meta / $pods->meta_property data in header of a Pods Page (if they are set).
PODS_DISABLE_VERSION_OUTPUTDefault:false- Disables outputting the current Pods version in head of Pods Pages.
PODS_DISABLE_BODY_CLASSESDefault:false- Disables outputting Pods Pages body classes based on the current pod page.
PODS_DISABLE_DYNAMIC_TEMPLATEDefault:false- Disables checking for $pods->page_template to use for a Pods Page (if it’s set).
Core
These constants cannot be overridden, they are defined by the plugin directly and listed here for informational purposes only.
PODS_VERSION- The version number of the current version of Pods. On upgrade to next PODS_VERSION, may trigger a DB update (see below). Last known PODS_VERSION from an upgrade process is stored in the option pods_framework_version. Previous version installed, when last upgrade ran is stored in the option pods_framework_version_last.
PODS_DB_VERSION- The version of the Pods database configuration. On upgrade to next PODS_VERSION, if the previous version is less than the DB version, it will trigger a database update. Last known PODS_DB_VERSION from an upgrade process is stored in the option pods_framework_db_version.
PODS_SLUGDefault:plugin_basename( __FILE__ )- The slug for the plugin.
PODS_DIRDefault:plugin_dir_path( __FILE__ )- The directory path of the directory Pods is installed in.
PODS_URLDefault:plugin_dir_url( __FILE__ )- The URL of the directory Pods is installed in.