wip: preview

This commit is contained in:
2025-09-24 12:36:12 -04:00
parent cd4cf2e3e3
commit 0bffe2768d
5 changed files with 53 additions and 61 deletions

View File

@@ -1,9 +1,6 @@
<?php
$preview_url = ( defined( 'NUXT_PUBLIC_SITE_URL' ) ? NUXT_PUBLIC_SITE_URL : 'https://cultureat.ca' ) . '/api/acf-preview';
$data = array(
'fieldGroupName' => get_row_layout(),
'value' => ccat_get_graphql_row_value(),
);
$preview_url = ( defined( 'NUXT_PUBLIC_SITE_URL' ) ? NUXT_PUBLIC_SITE_URL : 'https://cultureat.ca' ) . '/api/preview';
$data = ccat_get_graphql_preview_data();
$result = wp_remote_post( $preview_url, array( 'body' => $data ) );
if ( is_wp_error( $result ) ) {
echo '<div style="color: red;">Erreur: ' . esc_html( $result->get_error_message() ) . '</div>';