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

file and file_list types work like "Featured Image" #120

Closed
wants to merge 1 commit into from

Conversation

johnsonpaul1014
Copy link
Contributor

Made file and file_list types for images work like the "Featured Image" in Wordpress: clicking on the image brings it up in the Media Manager. I made this change because I knew the user would possibly want to edit meta information for images, and the old version that just saved the URL made it so the user would need to look up the image in the library again. I was unable to get the image uploader to add the image to the search results like the featured image select does, but it will appear in the box on the right.

This is my first pull request on a project on GitHub, so I apologize if anything I did was incorrect. I believe I followed all of your guidelines, but I may have missed something. Hopefully you like the change so I can easily get updates in the future; it's a great extension. Thanks in advance for taking a look.

…e" in Wordpress: clicking on the image brings it up in the Media Manager. I made this change because I knew the user would possibly want to edit meta information for images, and the old version that just saved the URL made it so the user would need to look up the image in the library again. I was unable to get the image uploader to add the image to the search results like the featured image select does, but it will appear in the box on the right.
@jtsternberg
Copy link
Member

Thanks for your PR. I actually tackled this the other day without realizing you had done most of the work already. I gave you props, as you submitted a PR that is close to what I ended up with, and after I found your PR, I was able to improve a couple things in mine. Thanks again!

pluginmirror-worker pushed a commit to wp-plugins/cmb2 that referenced this pull request Feb 15, 2015
### Enhancements

* Use the more appropriate `add_meta_boxes` hook for hooking in metaboxes to post-edit screen. Thanks [@inspiraaz](https://github.com/inspiraaz) for reporting. ([#161](CMB2/CMB2#161))
* Add a `row_classes` field param which allows you to add additional classes to the cmb-row wrap. This parameter can take a string, or array, or can take a callback that returns a string or array. The callback will receive `$field_args` as the first argument, and the CMB2_Field `$field` object as the second argument. Reported/requested in [#68](CMB2/CMB2#68).
* New constant, `CMB2_LOADED`, which you can use to check if CMB2 is loaded for your plugins/themes with CMB2 dependency.
* New hooks, [`cmb2_init_before_hookup` and `cmb2_after_init`](https://github.com/WebDevStudios/CMB2-Snippet-Library/blob/master/filters-and-actions).
* New API for adding metaboxes and fields, demonstrated in [`example-functions.php`](https://github.com/WebDevStudios/CMB2/blob/master/example-functions.php). In keeping with backwards-compatibility, the `cmb2_meta_boxes` filter method will still work, but is not recommended. New API includes `new_cmb2_box` helper function to generate a new metabox, and returns a `$cmb` object to add new fields (via the `CMB2::add_field()` and `CMB2::add_group_field()` methods).
* New CMB2 method, [`CMB2::remove_field()`](https://github.com/WebDevStudios/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_%24cmb_id-remove-field.php).
* New CMB2_Boxes method, [`CMB2_Boxes::remove()`](https://github.com/WebDevStudios/CMB2-Snippet-Library/blob/master/filters-and-actions/cmb2_init_before_hookup-remove-cmb2-metabox.php).
* When clicking on a file/image in the `file`, or `file_list` type, the media modal will open with that image selected. Props [johnsonpaul1014](https://github.com/johnsonpaul1014), ([#120](CMB2/CMB2#120)).

git-svn-id: https://plugins.svn.wordpress.org/cmb2/trunk@1090772 b8457f37-d9ea-0310-8a92-e5e31aec5664
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

Successfully merging this pull request may close these issues.

None yet

2 participants