Skip to content

Instantly share code, notes, and snippets.

@pochitax
Created October 31, 2025 13:02
Show Gist options
  • Select an option

  • Save pochitax/b61f037957b6f50d3e12434c2876d3f6 to your computer and use it in GitHub Desktop.

Select an option

Save pochitax/b61f037957b6f50d3e12434c2876d3f6 to your computer and use it in GitHub Desktop.
para el functions
/** 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