wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_check_revisioned_meta_fields_have_changed › WordPress Function

Seit6.4.0
Veraltetn/v
wp_check_revisioned_meta_fields_have_changed ( $post_has_changed, $last_revision, $post )
Parameter: (3)
  • (bool) $post_has_changed Whether the post has changed.
    Erforderlich: Ja
  • (WP_Post) $last_revision The last revision post object.
    Erforderlich: Ja
  • (WP_Post) $post The post object.
    Erforderlich: Ja
Gibt zurück:
  • (bool) Whether the post has changed.
Definiert in:
Codex:

Check whether revisioned post meta fields have changed.



Quellcode

function wp_check_revisioned_meta_fields_have_changed( $post_has_changed, WP_Post $last_revision, WP_Post $post ) {
	foreach ( wp_post_revision_meta_keys( $post->post_type ) as $meta_key ) {
		if ( get_post_meta( $post->ID, $meta_key ) !== get_post_meta( $last_revision->ID, $meta_key ) ) {
			$post_has_changed = true;
			break;
		}
	}
	return $post_has_changed;
}