WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#25376 closed defect (bug) (fixed)

Hook Docs (82): wp-includes/post.php

Reported by: DrewAPicture Owned by: DrewAPicture
Milestone: 3.9 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch commit dev-reviewed
Focuses: docs Cc:

Description (last modified by DrewAPicture)

Attached patch documents the following hooks (all):

Actions:

  • registered_post_type
  • before_delete_post
  • delete_post
  • deleted_post
  • after_delete_post
  • wp_trash_post
  • trashed_post
  • untrash_post
  • untrashed_post
  • trash_post_comments
  • trashed_post_comments
  • untrash_post_comments
  • untrashed_post_comments
  • pre_post_update
  • edit_post
  • post_updated
  • save_post_$post_type
  • save_post
  • wp_insert_post
  • edit_post
  • save_post_$post_type (duplicate)
  • save_post (duplicate)
  • wp_insert_post (duplicate)
  • transition_post_status
  • $old_status_to_$new_status
  • $new_status_to_$post_type
  • edit_attachment
  • add_attachment
  • delete_attachment
  • delete_post
  • deleted_post
  • clean_post_cache
  • clean_page_cache
  • clean_attachment_cache
  • private_to_published
  • xmlrpc_publish_post

Filters:

  • get_attached_file
  • update_attached_file
  • _wp_relative_upload_path
  • post_type_labels_$post_type
  • edit_$field
  • $field_no_prefix_edit_pre
  • edit_post_$field
  • pre_$field
  • $field_no_prefix_save_pre
  • pre_post_$field
  • $field_pre
  • $field
  • post_$field
  • wp_count_posts (existing)
  • wp_count_attachments (existing)
  • post_mime_types
  • wp_insert_post_empty_content
  • wp_insert_post_parent
  • wp_insert_post_data
  • wp_unique_post_slug_is_bad_attachment_slug
  • wp_unique_post_slug_is_bad_hierarchical_slug
  • wp_unique_post_slug_is_bad_flat_slug
  • wp_unique_post_slug
  • add_ping
  • get_enclosed
  • get_pung
  • get_to_ping
  • get_pages
  • get_pages (duplicate)
  • get_pages (duplicate)
  • wp_delete_file
  • wp_delete_file (duplicate)
  • wp_delete_file (duplicate)
  • wp_delete_file (duplicate)
  • wp_get_attachment_metadata
  • wp_update_attachment_metadata
  • wp_get_attachment_url
  • wp_get_attachment_thumb_file
  • wp_get_attachment_thumb_url
  • icon_dir
  • icon_dir_uri
  • icon_dirs
  • wp_mime_type_icon
  • get_lastpostdate
  • get_lastpostmodified

Attachments (8)

25376.diff (42.9 KB) - added by DrewAPicture 8 years ago.
First pass (all hooks)
25376.2.diff (42.2 KB) - added by DrewAPicture 8 years ago.
w/ @since + 'enclosure' clarifications
25376.3.diff (42.2 KB) - added by DrewAPicture 8 years ago.
typo
25376.4.diff (10.7 KB) - added by DrewAPicture 7 years ago.
Second pass: Part I.
25376-sanitize.diff (4.6 KB) - added by DrewAPicture 7 years ago.
25376-sanitize.2.diff (4.5 KB) - added by DrewAPicture 7 years ago.
25376.5.diff (34.0 KB) - added by DrewAPicture 7 years ago.
Second pass: Part II.
25376.6.diff (34.0 KB) - added by DrewAPicture 7 years ago.
Third pass: Part II.

Download all attachments as: .zip

Change History (23)

#1 @DrewAPicture
8 years ago

  • Summary changed from Hood Docs: wp-includes/post.php to Hook Docs: wp-includes/post.php

@DrewAPicture
8 years ago

First pass (all hooks)

#2 @DrewAPicture
8 years ago

  • Description modified (diff)
  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 3.7

25376.diff documents all actions and filters in the file.

TODO:

  • @since versions for all of the above
  • Clarify 'enclosure'-related hook docs

@DrewAPicture
8 years ago

w/ @since + 'enclosure' clarifications

@DrewAPicture
8 years ago

typo

#3 @DrewAPicture
8 years ago

  • Milestone changed from 3.7 to Awaiting Review

This needs some work yet following feedback from nacin and adamsilverstein. Backing off the milestone for the time being.

#4 @kpdesign
8 years ago

#25505 was marked as a duplicate.

#5 @DrewAPicture
8 years ago

  • Summary changed from Hook Docs: wp-includes/post.php to Hook Docs (82): wp-includes/post.php

#6 @jeremyfelt
8 years ago

  • Component changed from Inline Docs to Post Types
  • Focuses docs added

@DrewAPicture
7 years ago

Second pass: Part I.

#7 @DrewAPicture
7 years ago

In 28041:

Part I of inline documenation for hooks in wp-includes/post.php.

Adds docs for the following hooks:

  • get_attached_file
  • update_attached_file
  • _wp_relative_upload_path
  • post_type_labels_{$post_type}
  • edit_{$field}
  • {$field_no_prefix}_edit_pre
  • edit_post_{$field}
  • pre_{$field}
  • {$field_no_prefix}_save_pre
  • pre_post_{$field}
  • {$field}_pre
  • $field
  • post_{$field}
  • wp_count_posts
  • wp_count_attachments
  • post_mime_types
  • wp_insert_post_empty_content

See #25376.

This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.


7 years ago

#9 @DrewAPicture
7 years ago

In 28042:

Clarify documentation for hooks in sanitize_post_field().

  • edit_post_{$field} pairs with edit_{$field}
  • pre_post_{$field} pairs with pre_{$field}
  • post_{$field} pairs with {$field}

As the above pairs' docs are unnecessarily duplicative, the second sets of docs have been removed. Also, the "duplicates" are purposely not marked as such in this case as the hook names differ. Also remove @deprecated tags mistakenly left in in [28041].

See #25376.

#10 @DrewAPicture
7 years ago

  • Owner set to DrewAPicture
  • Status changed from new to assigned

@DrewAPicture
7 years ago

Second pass: Part II.

This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.


7 years ago

#12 @DrewAPicture
7 years ago

  • Keywords dev-feedback added
  • Milestone changed from Awaiting Review to 3.9

25376.5.diff should cover the rest of wpinc/post.php.

@DrewAPicture
7 years ago

Third pass: Part II.

#13 @DrewAPicture
7 years ago

  • Keywords commit added; dev-feedback removed

25376.6.diff incorporates feedback from nacin in IRC

untrash_post_comments and untrashed_post_comments filters:

  • Comments are being restored for *a post*

wp_unique_post_slug_is_bad_attachment_slug, wp_unique_post_slug_is_bad_hierarchical_slug, and wp_unique_post_slug_is_bad_flat_slug filters:

  • Standardizes on "bad" terminology instead of "poor"

#14 @nacin
7 years ago

  • Keywords dev-reviewed added

#15 @DrewAPicture
7 years ago

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

In 28106:

Part II of inline documentation for hooks in wp-includes/post.php.

Documents all remaining hooks following [28041] and [28042]. Also updates the hash notation style for wp_insert_post().

Props nacin for several hook descriptions.

Fixes #25376.

Note: See TracTickets for help on using tickets.