Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_save_post_revision_post_has_changed

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
168                 * This filter allows for additional checks to determine if there were changes.
169                 *
170                 * @since 4.1.0
171                 *
172                 * @param bool    $post_has_changed Whether the post has changed.
173                 * @param WP_Post $last_revision    The last revision post object.
174                 * @param WP_Post $post             The post object.
175                 *
176                 */
177                $post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $last_revision, $post );
178
179                //don't save revision if post unchanged
180                if ( ! $post_has_changed ) {
181                     return;
182                }
183           }
184      }
185
186      $return = _wp_put_post_revision( $post );