WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years 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 3 years ago.
First pass, missing @since values
25375.2.diff (18.0 KB) - added by DrewAPicture 3 years ago.
Missed a few hooks in the first pass.
25375.3.diff (18.0 KB) - added by kpdesign 3 years ago.
Second pass, all @since tags completed. Minor alignment changes, fix couple typos.
25375.4.diff (18.6 KB) - added by kpdesign 3 years ago.
Alignment fixes for previous patch, per ocean90
25375.5.diff (21.5 KB) - added by kpdesign 3 years ago.
Fixed duplicate hook format, minor docblock changes
25375.6.diff (22.7 KB) - added by DrewAPicture 2 years ago.
Final pass.
25375.7.diff (23.7 KB) - added by DrewAPicture 2 years ago.

Download all attachments as: .zip

Change History (25)

@DrewAPicture
3 years ago

First pass, missing @since values

#1 @DrewAPicture
3 years 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

#2 @DrewAPicture
3 years ago

  • Description modified (diff)

@DrewAPicture
3 years ago

Missed a few hooks in the first pass.

@kpdesign
3 years ago

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

#3 @kpdesign
3 years ago

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

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

#4 follow-up: @ocean90
3 years ago

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

#5 in reply to: ↑ 4 @kpdesign
3 years 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.

#6 follow-up: @ocean90
3 years ago

The block itself uses spaces.

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

#7 in reply to: ↑ 6 @kpdesign
3 years 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. :)

@kpdesign
3 years ago

Alignment fixes for previous patch, per ocean90

#8 follow-up: @ocean90
3 years 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?

#9 in reply to: ↑ 8 @DrewAPicture
3 years 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.

#10 @DrewAPicture
3 years ago

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

#11 follow-up: @topdown
3 years 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

#12 in reply to: ↑ 11 @kpdesign
3 years 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.

@kpdesign
3 years ago

Fixed duplicate hook format, minor docblock changes

#13 @kpdesign
3 years 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.

#14 @DrewAPicture
2 years ago

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

#15 @DrewAPicture
2 years 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.

@DrewAPicture
2 years ago

Final pass.

@DrewAPicture
2 years ago

#16 @DrewAPicture
2 years 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.

#17 @DrewAPicture
2 years ago

  • Focuses docs added

#18 @DrewAPicture
2 years ago

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