Jump to content

Recommended Posts

Posted

I'd like to use the API to get all fields that are tagged with XXX. I can't find anywhere that tells me what selectors can be can used with $fields. I suspect this isn't possible?

I've realised a way to work around this - just get all the fields, and then filter them by prefix of name. But it wouldn't be quite as neat.

Posted

You're not clear in your question. Are we talking about namespaces (a_title, a_body, c_body) or tagged fields, as of the tags to group fields in the backend? 

Posted

You're not clear in your question. Are we talking about namespaces (a_title, a_body, c_body) or tagged fields, as of the tags to group fields in the backend? 

The tags to group fields in the backend. (I was considering a namespace style method as a workaround.)

Posted

You can try this:

$fields->find("tags*=XXX");

That worked! Thanks :)

(Am I missing somewhere where this sort of thing is documented?)

Posted

This in not documented, as I doubt this is meant to be often used by the enduser, but the source-code is quite fast to scan if you know the overall structure. Most of the seasoned pw users are simply using github or a local installation to lookup things.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...