Opened 17 years ago
Closed 16 years ago
#7094 closed enhancement (invalid)
Filter to allow insertion of messages onto the post edit form
Reported by: | simonwheatley | Owned by: | westi |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | needs-patch |
Focuses: | Cc: |
Description
Currently it's not easily possible to insert a message onto the edit form; for example a plugin might check a post on publication, determine it's unsuitable in some way and need to return the user to their post with a message explaining what's happened.
The attached patch adds a filter hook to allow plugin authors to manipulate the message being displayed on edit_form_advanced.php. Example plugin code shown below:
// Fictional example, for simplicity... // This function triggered by a $_GET param. The $_GET // param is added if the profanity filter detects rudeness. function em_filter_display_message( $display_message ) { // Should we display a message? $em_message = (bool) @ $_GET['em_message']; if ( ! $em_message ) return $display_message; // OK. Let's display one... return 'Hello. This is WordPress speaking... less profanity in your posts, please.'; } // Our message add_filter( 'edit_form_advanced_message', 'em_filter_display_message' );
Attachments (1)
Change History (5)
#2
@
16 years ago
- Keywords needs-patch added; has-patch needs-testing 2nd-opinion removed
- Milestone changed from 2.7 to 2.8
- Owner changed from anonymous to westi
- Status changed from new to assigned
I think an action would be better here to allow a plugin to just output some html instead.
Move to 2.8 for now as we are feature frozen
Note: See
TracTickets for help on using
tickets.
Patch adding filter to manipulate user message edit_form_advanced.php