Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this questionI have wordpress Version 5.3 with woocommerce and ACF plugin, I want to make the user change some setting from a page using ACF, i have create the field but I can link the field to the setting like site title , woocommerce Store Address. the theme i use is astra pro
Closed. This question needs details or clarity. It is not currently accepting answers.Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this questionI have wordpress Version 5.3 with woocommerce and ACF plugin, I want to make the user change some setting from a page using ACF, i have create the field but I can link the field to the setting like site title , woocommerce Store Address. the theme i use is astra pro
Share Improve this question edited Dec 10, 2019 at 17:47 butlerblog 5,1213 gold badges28 silver badges44 bronze badges asked Dec 10, 2019 at 16:56 omer khaledomer khaled 111 bronze badge 1- 1 Your question will probably get flagged as off-topic because 3rd party plugins like WooCommerce and ACF are not supported here. But once you have the field setup in ACF you need to find the correct place in your theme (create a child theme to override your main theme) to replace the data with your ACF data. – RiddleMeThis Commented Dec 10, 2019 at 17:59
1 Answer
Reset to default 1I don't think you'll be able to link them directly. However, you can simply hook into when ACF is saving these fields and also have them overwrite the correct option in the options table or whatever you need to overwrite.
Here's the documentation for hooking into ACF saving values (the acf/save_post
hook): https://www.advancedcustomfields/resources/acf-save_post/
You'll probably want to make sure you're saving the correct page (your options page).
You can do that with get_current_screen()
: https://codex.wordpress/Function_Reference/get_current_screen
Then, it would simply be a matter of overriding post_meta ( update_post_meta()
) or options ( update_option()
).