generated from pascalmartineau/wp-skeleton
wip: pass preview data
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
<?php
|
||||
$preview_url = ( defined( 'NUXT_PUBLIC_SITE_URL' ) ? NUXT_PUBLIC_SITE_URL : 'https://cultureat.ca' ) . '/api/acf-preview';
|
||||
$result = wp_remote_get( $preview_url, array( 'method' => 'POST' ) );
|
||||
?>
|
||||
<pre><?= $result['body'] ?></pre>
|
||||
$data = array(
|
||||
'layout' => get_row_layout(),
|
||||
);
|
||||
$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>';
|
||||
} else {
|
||||
echo $result['body'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user