Skip to content

Commit

Permalink
Footnotes: add missing _ in revision field filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 29, 2023
1 parent eb59f89 commit 2753c11
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function register_block_core_footnotes() {
*
* @param int $revision_id The revision ID.
*/
function wp_save_footnotes_meta( $revision_id ) {
function _wp_save_footnotes_meta( $revision_id ) {
$post_id = wp_is_post_revision( $revision_id );

if ( $post_id ) {
Expand All @@ -102,7 +102,7 @@ function wp_save_footnotes_meta( $revision_id ) {
}
}
}
add_action( 'wp_after_insert_post', 'wp_save_footnotes_meta' );
add_action( 'wp_after_insert_post', '_wp_save_footnotes_meta' );

/**
* Keeps track of the revision ID for "rest_after_insert_{$post_type}".
Expand Down Expand Up @@ -172,7 +172,7 @@ function wp_add_footnotes_revisions_to_post_meta( $post ) {
* @param int $post_id The post ID.
* @param int $revision_id The revision ID.
*/
function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
function _wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
$footnotes = get_post_meta( $revision_id, 'footnotes', true );

if ( $footnotes ) {
Expand All @@ -181,7 +181,7 @@ function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
delete_post_meta( $post_id, 'footnotes' );
}
}
add_action( 'wp_restore_post_revision', 'wp_restore_footnotes_from_revision', 10, 2 );
add_action( 'wp_restore_post_revision', '_wp_restore_footnotes_from_revision', 10, 2 );

/**
* Adds the footnotes field to the revision.
Expand All @@ -191,11 +191,11 @@ function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
* @param array $fields The revision fields.
* @return array The revision fields.
*/
function wp_add_footnotes_to_revision( $fields ) {
function _wp_add_footnotes_to_revision( $fields ) {
$fields['footnotes'] = __( 'Footnotes' );
return $fields;
}
add_filter( '_wp_post_revision_fields', 'wp_add_footnotes_to_revision' );
add_filter( '_wp_post_revision_fields', '_wp_add_footnotes_to_revision' );

/**
* Gets the footnotes field from the revision.
Expand All @@ -208,7 +208,7 @@ function wp_add_footnotes_to_revision( $fields ) {
* @param object $revision The revision object to compare against.
* @return string The field value.
*/
function wp_get_footnotes_from_revision( $revision_field, $field, $revision ) {
function _wp_get_footnotes_from_revision( $revision_field, $field, $revision ) {
return get_metadata( 'post', $revision->ID, $field, true );
}
add_filter( 'wp_post_revision_field_footnotes', 'wp_get_footnotes_from_revision', 10, 3 );
add_filter( 'wp_post_revision_field_footnotes', '_wp_get_footnotes_from_revision', 10, 3 );

0 comments on commit 2753c11

Please sign in to comment.