Make WordPress Core

Ticket #43019: 43019.diff

File 43019.diff, 535 bytes (added by danieltj, 7 years ago)

Pre insert post hook

  • wp-includes/post.php

    diff --git wp-includes/post.php wp-includes/post.php
    index 1dbf0c9..67f1f73 100644
    function wp_insert_post( $postarr, $wp_error = false ) { 
    30683068
    30693069        $postarr = wp_parse_args($postarr, $defaults);
    30703070
     3071        /**
     3072         * Hooks in before insert post is properly run.
     3073         *
     3074         * @since 4.9
     3075         *
     3076         * @param array $postarr An array of raw post data.
     3077         */
     3078        do_action( 'pre_insert_post', $postarr );
     3079
    30713080        unset( $postarr[ 'filter' ] );
    30723081
    30733082        $postarr = sanitize_post($postarr, 'db');