Home › Forums › General Issues › Generate sub field from php – check if content already exists › Reply To: Generate sub field from php – check if content already exists
It this is the case then I would probably add an option when I did it the first time https://codex.wordpress.org/Function_Reference/add_option and check this option to see if it’s already been run. Might be the simplest thing to do.
$option = get_option('my_option');
if (!$option) {
// run setup
add_option('my_option', true);
}
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.