Make WordPress Core

Opened 6 years ago

Closed 2 years ago

Last modified 2 years ago

#50654 closed enhancement (fixed)

Fix the filter docs in sanitize_post_field()

Reported by: johnbillion Owned by: DrewAPicture
Priority: normal Milestone: 6.7
Component: Posts, Post Types Version: 2.3
Severity: normal Keywords: has-patch
Cc: Focuses: docs

Description

The sanitize_post_field() function calls nine separate filters on its data depending on various conditions. The documentation for these need improving, and documentation for the missing filters need adding.

Need to be careful about accuracy here because of the very general names of these filters and their dynamic portions.

Attachments (1)

50654.diff​ (6.0 KB ) - added by johnbillion 6 years ago.

Download all attachments as: .zip

Change History (8)

#1 @johnbillion
6 years ago

Partial patch attached. Needs some more work and needs checking for accuracy.

#2 @DrewAPicture
2 years ago

  • Owner set to DrewAPicture
  • Status new → reviewing

#3 @DrewAPicture
2 years ago

  • Milestone Awaiting Review → 6.7
  • Version → 2.3

#4 @DrewAPicture
2 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 59045:

Docs: Add possible filter names to the hook docs for the following filters in sanitize_post_field():

  • 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}

Props johnbillion, DrewAPicture.
Fixes #50654

This ticket was mentioned in ​PR #7393 on ​WordPress/wordpress-develop by ​@mukesh27.


2 years ago
#5

  • Keywords has-patch added; needs-patch removed

Trac ticket: https://core.trac.wordpress.org/ticket/50654

Follow-up to https://core.trac.wordpress.org/changeset/59045, Missed the @since and @param docblock.

#6 @DrewAPicture
2 years ago

In 59050:

Docs: Add missing @since and @param annotations for the edit_post_{$field} hook doc.

Props mukesh27
See #50654

Note: See TracTickets for help on using tickets.