wp_functionality_constants

函式
wp_functionality_constants ( No parameters )

wp_functionality_constants: 這個函式用來定義常量,可以在其他WordPress函式和模板中使用。它通常用於定義與特定外掛或主題有關的常量。

定義了與功能相關的WordPress常量。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_functionality_constants() {
/**
* @since 2.5.0
*/
if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) {
define( 'AUTOSAVE_INTERVAL', MINUTE_IN_SECONDS );
}
/**
* @since 2.9.0
*/
if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) {
define( 'EMPTY_TRASH_DAYS', 30 );
}
if ( ! defined( 'WP_POST_REVISIONS' ) ) {
define( 'WP_POST_REVISIONS', true );
}
/**
* @since 3.3.0
*/
if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) {
define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS );
}
}
function wp_functionality_constants() { /** * @since 2.5.0 */ if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) { define( 'AUTOSAVE_INTERVAL', MINUTE_IN_SECONDS ); } /** * @since 2.9.0 */ if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) { define( 'EMPTY_TRASH_DAYS', 30 ); } if ( ! defined( 'WP_POST_REVISIONS' ) ) { define( 'WP_POST_REVISIONS', true ); } /** * @since 3.3.0 */ if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) { define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS ); } }
function wp_functionality_constants() {
	/**
	 * @since 2.5.0
	 */
	if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) {
		define( 'AUTOSAVE_INTERVAL', MINUTE_IN_SECONDS );
	}

	/**
	 * @since 2.9.0
	 */
	if ( ! defined( 'EMPTY_TRASH_DAYS' ) ) {
		define( 'EMPTY_TRASH_DAYS', 30 );
	}

	if ( ! defined( 'WP_POST_REVISIONS' ) ) {
		define( 'WP_POST_REVISIONS', true );
	}

	/**
	 * @since 3.3.0
	 */
	if ( ! defined( 'WP_CRON_LOCK_TIMEOUT' ) ) {
		define( 'WP_CRON_LOCK_TIMEOUT', MINUTE_IN_SECONDS );
	}
}

常見問題

FAQs
檢視更多 >