I don’t disagree. At the moment it’s rather clumsy and inefficient to use, plus it’s not especially time-saving to have styling available for lots of different options when I have to rewrite and update many of those styles to actually use them. But is this approach sustainable?
I’d assumed you’d output XML directly on the page request, but sending it to a separate file works too.
If WordPress’ settings aren’t getting you the output you need on the archive page, you could do a call to wp_query before your XML output.
Specifically, I think you want to set ‘posts_per_page’ to -1 to override the pagination.
Exporting XML should be fairly straightforward if you’re comfortable writing PHP. You can create a page template for your custom post type, (like single-custom.php,) and omit all of the HTML output from that template (such as the get_header/get_footer calls). Write your PHP to output XML instead; possibly using a PHP library and HTTP header. There are plenty of tutorials on writing XML with PHP available by search.
Yeah, I completely understand. This isn’t directly an ACF issue. One of the reasons I’ve used ACF extensively over the last few years though is that it has always allowed me to keep the admin UX simple and painless for my clients, even when building fairly complex systems. I was hoping for a similar clean solution here, but it seems a little complexity for the client may be inevitable this time.
Thanks for the suggestion, I’ll see where it leads. I’m open to hearing if anyone else has had experience with this as well.
I see why those are there and it makes sense. But in my case, I have several different field groups with fields that have the same name and I’m styling them all the same way. In this example, they each require a physical address.
If I could write: “.acf-field-name-city” and style all of my “city” fields across all of my forms at once, that would be great. It also makes my CSS much more readable, and applies the style to additional forms I might make in the future.
I realize I could specifically add a class to the field data, but that’s an extra step and I’m duplicating data I’ve already entered.
As for the field name changing: sure it could change, but that also means changing the PHP code supporting it. (I’m asking for the name to be output here, not the label.)
I’ll echo support for this as well. It’s really common for me to set up a ‘quick links’ list which mostly is internal pages, but one or two links must be external. That one link lessens to overall usability if I make it a generic text field or have to have multiple ‘internal’ and ‘external’ fields. Something like the default WP link dialog would be excellent.
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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.