Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Posts, attachment limits and attaching Terms #7

Closed
lmartins opened this issue Feb 7, 2015 · 6 comments
Closed

Search Posts, attachment limits and attaching Terms #7

lmartins opened this issue Feb 7, 2015 · 6 comments

Comments

@lmartins
Copy link
Contributor

lmartins commented Feb 7, 2015

While really useful as it is, I believe it could really improve with a few changes:

  1. Search posts
    I've noticed theres a field dedicated to that functionality, but something in the lines of what ACF does would be really awesome. When you have a lot of posts, the current presentation won't scale well, hence the need for some sort of search functionality.
  2. Limit Attachments
    Would be possible to limit ao many attachments the user can add?
  3. Attaching Terms
    It would be very useful if we could attach other types of contents, such as categories, custom post-types, etc.

Thank you CMB2 and this useful extension.

@jtsternberg
Copy link
Member

  1. My goal is to eventually combine this library with the
    CMB2 Post Search field type
    .
  2. Interesting idea. It'll likely sit on the back-burner till we need it for a certain project, but if you care to submit a PR, we'd be happy to look at it.
  3. You can definitely modify the query args if you follow the example and have it use any post-type you want. That being said, other types of data would be a cool option.

@chriscoyier
Copy link

Yeah! Combining this with "Post Search Field Type" would be reallllllly useful.

I just got this installed, in which to attempt to create kind of curated/arranged "guides" of existing posts/pages/etc, but it's not really possible because I can't find the content in which to add. And it doesn't look like I can switch to "Post Search" field type, because then I lose the ability to re-arrange.

@jtsternberg
Copy link
Member

Let's see if I can whip something up

@jtsternberg
Copy link
Member

Ok, the deed is done. Let me know how it works for you guys.

If you're familiar with the pre_get_posts hook, and the $query object, you can modify the search modal's results by specifying a callback on the 'attached_posts_search_query_cb' field parameter. (similar to other *_cb parameters). The callback gets the $query object passed to it.

@chriscoyier
Copy link

this is sweet - best of both worlds. Now we can set up queries to prefill the list with relevant stuff on load AND use search.

@monecchi
Copy link

monecchi commented Jan 9, 2017

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants