最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Change WordPress Site Title and Tagline and WooCommerce settings using ACF

programmeradmin1浏览0评论
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 question

I 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 question

I 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
Add a comment  | 

1 Answer 1

Reset to default 1

I 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() ).

发布评论

评论列表(0)

  1. 暂无评论