1

I'm using Wordpress and ACF / Advanced Custom Fields to add various fields related to my contact OPTIONS page. I need to retrieve the date the the last time the "UPDATE" button was hit.

I have tried to sue the the_modified_date(); but this give me the date the actual contact page post-type was last updated and not the OPTIONS page was

My ACF field setting rules: Show this field of OPTIONS PAGE is equal to CONTACT

The OPTIONS page is a plugin, so i can add all the ACF fields to the plugin instead of to a page. Code used for adding the options page:

if( function_exists('acf_add_options_page') ) { $contactOrder = get_field('about_order', 'option') + 2; acf_add_options_page(array( 'page_title' => 'Contact', 'menu_title' => 'Contact', 'menu_slug' => 'tsum-contact', 'capability' => 'edit_posts', 'redirect' => false, 'icon_url' => 'dashicons-info', 'position' => $contactOrder )); }

Code to show modified date of a page, but not what i want:

<?php the_modified_date(); ?>

My end goal is to use this time stamp for further calculations, but I just need help to get the timestamp.

Thank you.

Screenshot of my Options Page

Schalk Joubert
  • 398
  • 3
  • 19
  • What do you mean by your "contact OPTIONS" page? Is this a page entitled "Options," or some kind of specialized page, or does the have something to do with backend ACF Options page? – CK MacLeod Sep 17 '19 at 07:59
  • ACF data is stored as metadata. Have you tried to get the right post meta? I think there’s a updated time stamp there. – BugsArePeopleToo Sep 17 '19 at 08:35
  • @CKMacLeod I edited my question to with more detail about the OPTIONS page. It is like a settings page, and all the data entered there are saved in wp_options table. – Schalk Joubert Sep 17 '19 at 08:53
  • @BugsArePeopleToo Since it is an options page, there are now post meta. For instance, this is how I will display a field value: `$email = get_field('contact_email', 'option'); echo $email;` – Schalk Joubert Sep 17 '19 at 09:31
  • Ok so use get_option to retrieve the entry in the options table. ACF stores data in proper WP tables so don’t forget you can always just use the WP way. – BugsArePeopleToo Sep 17 '19 at 10:04

0 Answers0