Add constant to enable ACF on frontend
This commit is contained in:
parent
9d08978028
commit
5db2295cac
@ -787,3 +787,4 @@ define( 'CONSTANT_NAME', value );
|
||||
| FICTIONEER_DISABLE_ACF_JSON_IMPORT | boolean | Whether to disable the ACF JSON field import. Dangerous. Default `false`.
|
||||
| FICTIONEER_ENABLE_STICKY_CARDS | boolean | Whether to allow sticky cards. Expensive. Default `true`.
|
||||
| FICTIONEER_ENABLE_STORY_DATA_META_CACHE | boolean | Whether to "cache" story data in a meta field. Default `true`.
|
||||
| FICTIONEER_ENABLE_FRONTEND_ACF | boolean | Whether to load ACF on the frontend. Default `false`.
|
||||
|
@ -304,6 +304,11 @@ if ( ! defined( 'FICTIONEER_ENABLE_STORY_DATA_META_CACHE' ) ) {
|
||||
define( 'FICTIONEER_ENABLE_STORY_DATA_META_CACHE', true );
|
||||
}
|
||||
|
||||
// Boolean: Enable ACF on frontend
|
||||
if ( ! defined( 'FICTIONEER_ENABLE_FRONTEND_ACF' ) ) {
|
||||
define( 'FICTIONEER_ENABLE_FRONTEND_ACF', false );
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// GLOBAL
|
||||
// =============================================================================
|
||||
|
@ -48,7 +48,7 @@ function fictioneer_acf_json_save_point( $path ) {
|
||||
// LOAD ACF PLUGIN FROM THEME IF NOT INSTALLED (ADMIN ONLY)
|
||||
// =============================================================================
|
||||
|
||||
if ( ! class_exists('acf') && is_admin() ) {
|
||||
if ( ! class_exists('acf') && ( is_admin() || FICTIONEER_ENABLE_FRONTEND_ACF ) ) {
|
||||
// Define path and URL to the ACF plugin.
|
||||
define( 'FICTIONEER_ACF_PATH', get_template_directory() . '/includes/acf/' );
|
||||
define( 'FICTIONEER_ACF_URL', get_template_directory_uri() . '/includes/acf/' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user