Opened 5 years ago
Closed 4 years ago
#7094 closed enhancement (invalid)
Filter to allow insertion of messages onto the post edit form
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | needs-patch |
| 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)
simonwheatley — 5 years ago
comment:1
simonwheatley — 5 years ago
- Keywords has-patch needs-testing 2nd-opinion added
- 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
comment:3
janeforshort — 4 years ago
- Milestone changed from 2.8 to Future Release
Punting due to feature freeze. Reconsider with next release.
- Component changed from General to Administration
- Milestone Future Release deleted
- Resolution set to invalid
- Status changed from assigned to closed
see admin_notices
Note: See
TracTickets for help on using
tickets.

Patch adding filter to manipulate user message edit_form_advanced.php