Forked from maugelves/include-acf-in-plugins-or-themes.php
Created
June 3, 2021 08:30
-
-
Save perezdans/fd085596ddcda89c21e1d706ebd84595 to your computer and use it in GitHub Desktop.
Include ACF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 1. Configurar el PATH hacia la nueva carpeta de ACF | |
function configurar_path_a_acf( $path ) { | |
// actualizar el path | |
$path = get_stylesheet_directory() . '/acf/'; | |
return $path; | |
} | |
add_filter('acf/settings/path', 'configurar_path_a_acf'); | |
// 2. Configurar el nuevo directorio de ACF | |
function configurar_directorio_acf( $dir ) { | |
// actualizar el directorio | |
$dir = get_stylesheet_directory_uri() . '/acf/'; | |
return $dir; | |
} | |
add_filter('acf/settings/dir', 'configurar_directorio_acf'); | |
// 3. (Opcional) Ocultar el menú de ACF en el administrador de WordPress | |
add_filter('acf/settings/show_admin', '__return_false'); | |
// 4. Hacer el include de ACF | |
include_once( get_stylesheet_directory() . '/acf/acf.php' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment