Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: content_save_pre

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
708           // Apply the same filters as when calling wp_insert_post().
709
710           /** This filter is documented in wp-includes/post.php */
711           $menu_item_value['title'] = wp_unslash( apply_filters( 'title_save_pre', wp_slash( $menu_item_value['title'] ) ) );
712
713           /** This filter is documented in wp-includes/post.php */
714           $menu_item_value['attr_title'] = wp_unslash( apply_filters( 'excerpt_save_pre', wp_slash( $menu_item_value['attr_title'] ) ) );
715
716           /** This filter is documented in wp-includes/post.php */
717           $menu_item_value['description'] = wp_unslash( apply_filters( 'content_save_pre', wp_slash( $menu_item_value['description'] ) ) );
718
719           if ( '' !== $menu_item_value['url'] ) {
720                $menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] );
721                if ( '' === $menu_item_value['url'] ) {
722                     return new WP_Error( 'invalid_url', __( 'Invalid URL.' ) ); // Fail sanitization if URL is invalid.
723                }
724           }
725           if ( 'publish' !== $menu_item_value['status'] ) {
726                $menu_item_value['status'] = 'draft';