Home › Forums › Front-end Issues › Problem save meta values › Reply To: Problem save meta values
Hi John.
I use a plugin called Content Crawler that copy products from other stores and publish it on my site. There’re many options, for example how to get titles, content, images, etc, and one of this options is to add post meta key, that I’m using with the ACF plugin. My problem is that some fields are only displayed when I save and publish the post, but no if I publish directly after crawling. For example:
Example 1: Select field called “games” is displayed if the post is published directly with this code:
<?php
if( get_field('games') == 'option1' ): ?>
<a href="https://www.site.com/games/option1/">Option 1</a>
<?php endif; ?>
Example 2: Select field called “company” isn’t displayed if the post is published directly with this code:
<?php
$field = get_field_object('company');
$value = get_field('company');
$label = $field['choices'][ $value ];
echo $label;
?>
Example 3: Text field called “source” isn’t displayed if the post is published directly with this code:
<?php echo the_field('sources'); ?>
In summary, I have draft products created with a crawling plugin that contains meta-keys, and this meta-keys are only displayed when I open each draft product one by one and publish it, If I publish directly without open it or select multiple draft products and I the bulk option to publish it, the fields aren’t displayed. I hope this explanation will be more understandable, sorry for my bad English.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.