acf_revisions::wp_post_revision_field()
wp_post_revision_field
This filter will load the value for the given field and return it for rendering
@type filter
{} Это метод класса: acf_revisions{}
Хуков нет.
Возвращает
$value
. (string)
Использование
$acf_revisions = new acf_revisions(); $acf_revisions->wp_post_revision_field( $value, $field_name, $post, $direction );
- $value (обязательный)
- -
- $field_name (обязательный)
- -
- $post **
- -
По умолчанию: null - $direction **
- -
По умолчанию: false
Код acf_revisions::wp_post_revision_field() acf revisions::wp post revision field ACF 5.10.2
function wp_post_revision_field( $value, $field_name, $post = null, $direction = false ) { // bail ealry if is empty if ( empty( $value ) ) { return $value; } // value has not yet been 'maybe_unserialize' $value = maybe_unserialize( $value ); // vars $post_id = $post->ID; // load field $field = acf_maybe_get_field( $field_name, $post_id ); // default formatting if ( is_array( $value ) ) { $value = implode( ', ', $value ); } elseif ( is_object( $value ) ) { $value = serialize( $value ); } // image if ( $field['type'] == 'image' || $field['type'] == 'file' ) { $url = wp_get_attachment_url( $value ); $value = $value . ' (' . $url . ')'; } // return return $value; }