ACF & PHP-API (WordPress): verschil tussen versies

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
Regel 1: Regel 1:
Hoe kun je geautomatiseerd ACF-velden bewerken? Ihb, invullen en bijwerken?
+
How can you automatically manage ACF fields? In particular, fill in, delete and edit?
  
== Niet rechtstreeks op database-niveau ==
+
== Not directly at database level ==
  
Om met slecht nieuws te beginnen: Welliswaar worden ACF-velden opgeslagen in tabellen <code>wp_options</code> of <code>wp_postmeta</code>, maar je kunt niet rechtstreeks in deze tabellen schrijven om ACF-velden aan te maken. Dan ontbreekt namelijk de 'context', bv. een repeater. Je moet het dus via een API-call doen.
+
To start with some bad news: While ACF fields are stored in tables <code>wp_options</code> or <code>wp_postmeta</code>, you cannot write directly to these tables to create ACF fields. Then the 'context' is missing, eg a repeater. So you have to do it via an API call.
  
== Zie ook ==
+
== See also ==
  
 
* [[ACF (Advanced Custom Fields, WordPress)]]
 
* [[ACF (Advanced Custom Fields, WordPress)]]
  
== Bronnen ==
+
== Sources ==
  
 
* https://www.advancedcustomfields.com/resources/
 
* https://www.advancedcustomfields.com/resources/
* https://www.advancedcustomfields.com/resources/#functions - Alle PHP-functies bij elkaar!
+
* https://www.advancedcustomfields.com/resources/#functions - All PHP functions together. It's not complete, though!
 
* https://www.advancedcustomfields.com/resources/code-examples/
 
* https://www.advancedcustomfields.com/resources/code-examples/

Versie van 1 aug 2022 10:00

How can you automatically manage ACF fields? In particular, fill in, delete and edit?

Not directly at database level

To start with some bad news: While ACF fields are stored in tables wp_options or wp_postmeta, you cannot write directly to these tables to create ACF fields. Then the 'context' is missing, eg a repeater. So you have to do it via an API call.

See also

Sources