WordPress.org

Make WordPress Core

Opened 20 months ago

Closed 17 months ago

Last modified 15 months ago

#25375 closed defect (bug) (fixed)

Hook Docs (47): wp-admin/includes/media.php

Reported by: DrewAPicture Owned by: DrewAPicture
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch commit
Focuses: docs Cc:

Description (last modified by DrewAPicture)

Attached patch documents the following hooks:

Filters:

  • media_upload_tabs
  • media_upload_default_tab
  • image_send_to_editor
  • disable_captions
  • image_add_caption_shortcode
  • media_buttons_context
  • $type_upload_iframe_src
  • attachment_fields_to_save
  • media_send_to_editor
  • $type_send_to_editor_url
  • image_send_to_editor_url
  • image_size_names_choose
  • attachment_fields_to_edit
  • get_media_item_args
  • media_meta
  • upload_post_params
  • plupload_init
  • media_upload_form_url
  • type_url_form_media
  • media_upload_mime_type_links

Actions:

  • admin_enqueue_scripts
  • admin_print_styles-media-upload-popup
  • admin_print_styles
  • admin_print_scripts-media-upload-popup
  • admin_print_scripts
  • admin_head-media-upload-popup
  • admin_head
  • admin_head_{$content_func}
  • admin_print_footer_scripts
  • pre-upload-ui
  • pre-plupload-upload-ui
  • post-plupload-upload-ui
  • pre-html-upload-ui
  • post-html-upload-ui
  • post-upload-ui

Attachments (7)

25375.diff (16.4 KB) - added by DrewAPicture 20 months ago.
First pass, missing @since values
25375.2.diff (18.0 KB) - added by DrewAPicture 20 months ago.
Missed a few hooks in the first pass.
25375.3.diff (18.0 KB) - added by kpdesign 20 months ago.
Second pass, all @since tags completed. Minor alignment changes, fix couple typos.
25375.4.diff (18.6 KB) - added by kpdesign 20 months ago.
Alignment fixes for previous patch, per ocean90
25375.5.diff (21.5 KB) - added by kpdesign 19 months ago.
Fixed duplicate hook format, minor docblock changes
25375.6.diff (22.7 KB) - added by DrewAPicture 17 months ago.
Final pass.
25375.7.diff (23.7 KB) - added by DrewAPicture 17 months ago.

Download all attachments as: .zip

Change History (25)

@DrewAPicture20 months ago

First pass, missing @since values

comment:1 @DrewAPicture20 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 3.7

25375.diff takes a first-run at all filters and actions in the file.

Todo:

  • Fill in @since tags
  • Clarify and standardize language on back-compat/legacy hooks
  • Secondary Review

comment:2 @DrewAPicture20 months ago

  • Description modified (diff)

@DrewAPicture20 months ago

Missed a few hooks in the first pass.

@kpdesign20 months ago

Second pass, all @since tags completed. Minor alignment changes, fix couple typos.

comment:3 @kpdesign20 months ago

25375.3.diff completes all @since tags, minor alignment and typo fixes.

Todo: Clarify and standardize language on back-compat/legacy hooks

comment:4 follow-up: @ocean9020 months ago

http://cl.ly/RX6j: Shouldn't the indentation be whitespaces instead of tabs?

comment:5 in reply to: ↑ 4 @kpdesign20 months ago

Replying to ocean90:

http://cl.ly/RX6j: Shouldn't the indentation be whitespaces instead of tabs?

There is 1 tab at the beginning of the line to indent the block to match the indentation of the code.

The block itself uses spaces, including the alignment of the parameters list.

comment:6 follow-up: @ocean9020 months ago

The block itself uses spaces.

Correct. But why there are not aligned, see screenshot? In 25375.2.diff it looks good.

comment:7 in reply to: ↑ 6 @kpdesign20 months ago

Replying to ocean90:

The block itself uses spaces.

Correct. But why there are not aligned, see screenshot? In 25375.2.diff it looks good.

I checked my editor, and realized that I wasn't using a monospace font. Switched to Consolas, and can now see the alignment issue you're referring to. Uploading a new patch with those fixes now. Please let me know if you still see any lingering alignment issues in the new patch.

Thanks for bringing this to my attention. :)

@kpdesign20 months ago

Alignment fixes for previous patch, per ocean90

comment:8 follow-up: @ocean9020 months ago

Please let me know if you still see any lingering alignment issues in the new patch.

Looks good now. :)

Just a question: Why there are some double @since tags?

comment:9 in reply to: ↑ 8 @DrewAPicture20 months ago

Replying to ocean90:

Please let me know if you still see any lingering alignment issues in the new patch.

Looks good now. :)

Just a question: Why there are some double @since tags?

Partly it's a note to myself that its media back-compat, but also because I still need to hunt down whether the hook specifically moved or was just copied there, or the hook changed. On some functions we've done multiple @since lines to show important changes, e.g. @since 2.x.x, @since 3.x.x important thing happened.

They don't have to stay, at this point they're just a placeholder until I can figure the history of the back-compat hooks.

comment:10 @DrewAPicture20 months ago

  • Milestone changed from 3.7 to Awaiting Review
  • Owner set to DrewAPicture
  • Status changed from new to reviewing

comment:11 follow-up: @topdown19 months ago

Are the duplicate mentions in this patch being updated in another ticket? duplicate_hook
To the new standard http://make.wordpress.org/core/handbook/inline-documentation-standards/php-documentation-standards/#4-1-duplicate-hooks

comment:12 in reply to: ↑ 11 @kpdesign19 months ago

Replying to topdown:

Are the duplicate mentions in this patch being updated in another ticket? duplicate_hook
To the new standard http://make.wordpress.org/core/handbook/inline-documentation-standards/php-documentation-standards/#4-1-duplicate-hooks

Those will be handled in this ticket. I'll refresh the patch today.

@kpdesign19 months ago

Fixed duplicate hook format, minor docblock changes

comment:13 @kpdesign19 months ago

Patch updated - fixed duplicate hook format, minor docblock changes.

@todo:

  • Investigate media back compat for some hooks per @DrewAPicture in comment:9.
  • Change keys to $var in @param lines, per documentation standard, for media_submitbox_misc_sections and audio_submitbox_misc_sections hooks. Both were added in 3.7.0 before the standard was changed.

comment:14 @DrewAPicture18 months ago

  • Summary changed from Hook Docs: wp-admin/includes/media.php to Hook Docs (47): wp-admin/includes/media.php

comment:15 @DrewAPicture17 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.9

25375.6.diff finally makes a decision about handling renamed hooks, fixes some version numbers, and tightens up some descriptions.

I opted for the double @since, so as to indicate both original hook names (where changed), and when.

@DrewAPicture17 months ago

Final pass.

@DrewAPicture17 months ago

comment:16 @DrewAPicture17 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 26908:

Inline documentation for hooks in wp-admin/includes/media.php.

Props kpdesign, DrewAPicture.
Fixes #25375.

comment:17 @DrewAPicture15 months ago

  • Focuses docs added

comment:18 @DrewAPicture15 months ago

  • Component changed from Inline Docs to Media
Note: See TracTickets for help on using tickets.