Created
October 31, 2025 13:02
-
-
Save pochitax/b61f037957b6f50d3e12434c2876d3f6 to your computer and use it in GitHub Desktop.
para el functions
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
| /** AGREGAR CONFIGURACIÓN DE SECURE CUSTOM FIELDS */ | |
| add_action( 'graphql_register_types', function() { | |
| register_graphql_field( 'Post', 'pelicula', [ | |
| 'type' => 'String', | |
| 'description' => 'Campo Película de SCF', | |
| 'resolve' => function( $post ) { | |
| // Funciona con SCF porque SCF emula ACF | |
| return get_field('pelicula', $post->ID); | |
| // o alternativamente: return get_post_meta($post->ID, 'pelicula', true); | |
| } | |
| ]); | |
| }); | |
| /** término */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment