Hello,
I am currently editing the site of one of my clients under Oxygen Builder.
I have a “Flash” CPT loop in which I would like to have an invisible form to change the “status” ACF field to “Archived”. So for that I use the ACF Feed extention. In my loop I put my form with a shortcode with values for “Flash_ID” in order to get the ID of the “Flash” and not that of the post to modify the post.
Except that if I go through the shortcode, it understands that “Flash_ID” is null, if I left the form with the parameters in my URL https://monsite.com/? Flash_ID=000 it works.
Did I do something wrong in my code?
<?php
global $current_user;
wp_get_current_user();
?>
<table>
<tr>
<th> ID </th>
<th> Nom du Flash</th>
<th> </th>
<th> </th>
</tr>
<?php
$loop = new WP_Query( array( 'post_type' => 'flash', 'posts_per_page' => '10', 'author_name' => $current_user->user_login, 'meta_key' => 'etat', 'meta_value' => 'Publié')); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<tr>
<td><?php $postid=get_the_ID(); echo $postid; ?></td>
<td><?php the_title(); ?></td>
<td><a href="<?php the_permalink(); ?>">Voir/Modifier le flash</a></td>
<td> <?php
$short = '[gravityform id="8" title="false" description="false" field_values="ID-flash="'.$postid.'"]';
echo do_shortcode($short);
?></td>
</tr>
<?php endwhile; wp_reset_query(); ?>
</table>
Thank you, sorry for my bad english.