Discussion:
3.5 and attachment_fields_to_edit (custom fields for media)
Steve Taylor
2012-10-09 12:31:52 UTC
Permalink
Hi,

A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.

Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.

I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?

Cheers,

Steve Taylor
Marko Heijnen
2012-10-09 13:05:33 UTC
Permalink
Hey Steve,

The best way would be asking at that ticket. Or even better put it on the agenda tomorrow when the blog post is get added on http://make.wordpress.org/core/.

I would say your plugin will not be needed anymore. If you want to add support it seems better for you to add legacy support to your plugin to be sure everything still works.

Marko
Post by Steve Taylor
Hi,
A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.
Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.
I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?
Cheers,
Steve Taylor
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Steve Taylor
2012-10-09 13:35:25 UTC
Permalink
Thanks.

Not sure what makes you say the plugin won't be needed. Is 3.5 adding
a new API for custom fields? Support for Google maps, date/time
pickers, media selection in custom fields? It'd be great if the plugin
is made redundant by core features, but I don't see anything like a
significant chunk of the plugin's features in 3.5.
Post by Marko Heijnen
Hey Steve,
The best way would be asking at that ticket. Or even better put it on the agenda tomorrow when the blog post is get added on http://make.wordpress.org/core/.
I would say your plugin will not be needed anymore. If you want to add support it seems better for you to add legacy support to your plugin to be sure everything still works.
Marko
Post by Steve Taylor
Hi,
A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.
Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.
I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?
Cheers,
Steve Taylor
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Marko Heijnen
2012-10-09 13:46:22 UTC
Permalink
Ah I see it know. Wasn't really clear at first impression.
I guess some of those features will never be in core maybe some should but then more in an improved settings API you can also use in a metabox.
Post by Steve Taylor
Thanks.
Not sure what makes you say the plugin won't be needed. Is 3.5 adding
a new API for custom fields? Support for Google maps, date/time
pickers, media selection in custom fields? It'd be great if the plugin
is made redundant by core features, but I don't see anything like a
significant chunk of the plugin's features in 3.5.
Post by Marko Heijnen
Hey Steve,
The best way would be asking at that ticket. Or even better put it on the agenda tomorrow when the blog post is get added on http://make.wordpress.org/core/.
I would say your plugin will not be needed anymore. If you want to add support it seems better for you to add legacy support to your plugin to be sure everything still works.
Marko
Post by Steve Taylor
Hi,
A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.
Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.
I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?
Cheers,
Steve Taylor
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Andrew Nacin
2012-10-14 16:39:36 UTC
Permalink
Post by Steve Taylor
Hi,
A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.
Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.
I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?
Two things:

- Your plugin will probably become a lot simpler if it is updated to use
the newer post type UI/API.

- We are still doing backwards compatibility sweeps. We will continue to
support attachment_fields_to_edit in a backwards compatible, deprecated
fashion, it just doesn't yet. Thanks for the reminder on this hook in
particular.

Nacin
Steve Taylor
2012-10-14 23:13:40 UTC
Permalink
Hi, thanks for the response.

I've updated the plugin (on GitHub, not yet wordpress.org) to work
with the new API. Yes, much easier :-) Just a few tweaks and the code
I've got in place for post screen meta boxes works fine for 3.5
attachments.

I left my old code in for backwards compatibility. I'm checking on the
actual WP version, not on the existence of a hook. Maybe not always
the best way around, but I guess this means now I don't have to worry
about when you re-implement attachment_fields_to_edit for your
backwards compatibility...

Steve
Post by Andrew Nacin
Post by Steve Taylor
Hi,
A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.
Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.
I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?
- Your plugin will probably become a lot simpler if it is updated to use
the newer post type UI/API.
- We are still doing backwards compatibility sweeps. We will continue to
support attachment_fields_to_edit in a backwards compatible, deprecated
fashion, it just doesn't yet. Thanks for the reminder on this hook in
particular.
Nacin
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Davit Barbakadze
2013-08-17 15:26:02 UTC
Permalink
Hi guys,

Is there a writeup about "the newer post type UI/API" anywhere? It is hard
to find to say at least.

Davit Barbakadze
Post by Steve Taylor
Hi, thanks for the response.
I've updated the plugin (on GitHub, not yet wordpress.org) to work
with the new API. Yes, much easier :-) Just a few tweaks and the code
I've got in place for post screen meta boxes works fine for 3.5
attachments.
I left my old code in for backwards compatibility. I'm checking on the
actual WP version, not on the existence of a hook. Maybe not always
the best way around, but I guess this means now I don't have to worry
about when you re-implement attachment_fields_to_edit for your
backwards compatibility...
Steve
Post by Andrew Nacin
Post by Steve Taylor
Hi,
A plugin of mine
(http://wordpress.org/extend/plugins/developers-custom-fields/)
involves adding custom fields to media attachments via the
attachment_fields_to_edit hook. It looks like this method is broken in
the current beta of 3.5 due to moving media editing to post.php.
Has anyone worked with this / posted about it? I've looked through the
Trac ticket (http://core.trac.wordpress.org/ticket/21391) and there
don't seem to be any hints for devs whose stuff this breaks.
I'm ploughing into it now, just wondered if anyone else was ahead of
me! I'm guessing the new approach will be even easier to hook into
(using standard meta boxes) - but does legacy support just involve
leaving attachment_fields_to_edit stuff in place?
- Your plugin will probably become a lot simpler if it is updated to use
the newer post type UI/API.
- We are still doing backwards compatibility sweeps. We will continue
to
Post by Andrew Nacin
support attachment_fields_to_edit in a backwards compatible, deprecated
fashion, it just doesn't yet. Thanks for the reminder on this hook in
particular.
Nacin
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Helen Hou-Sandi
2013-08-17 15:50:40 UTC
Permalink
http://make.wordpress.org/core/2012/12/12/attachment-editing-now-with-full-post-edit-ui/
Davit Barbakadze
2013-08-17 17:28:04 UTC
Permalink
Thanks Helen. That helped.

Davit Barbakadze
Post by Helen Hou-Sandi
http://make.wordpress.org/core/2012/12/12/attachment-editing-now-with-full-post-edit-ui/
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...