Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: edit_{$field}

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
798      if ( false !== strpos($field, 'post_') ) {
799           $prefixed = true;
800           $field_no_prefix = str_replace('post_', '', $field);
801      }
802
803      if ( 'edit' == $context ) {
804           $format_to_edit = array('post_content', 'post_excerpt', 'post_title', 'post_password');
805
806           if ( $prefixed ) {
807                $value = apply_filters("edit_$field", $value, $post_id);
808                // Old school
809                $value = apply_filters("${field_no_prefix}_edit_pre", $value, $post_id);
810           } else {
811                $value = apply_filters("edit_post_$field", $value, $post_id);
812           }
813
814           if ( in_array($field, $format_to_edit) ) {
815                if ( 'post_content' == $field )
816                     $value = format_to_edit($value, user_can_richedit());