Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision diff UI #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Revision diff UI #2

wants to merge 2 commits into from

Conversation

mattheu
Copy link
Contributor

@mattheu mattheu commented Oct 26, 2014

Revisioned meta fields should show in the revision diff UI.

Changes

  • Filter the fields that show in the UI - note requires updated patch that makes this possible
  • Use singleton pattern for plugin as need to store the registered revisioned meta fields.
  • Change the way revisioned meta fields are added. This is because extra args are now required - key, label and display callback (to format the raw metadata for display in the UI)
  • If no display callback is provided it will simply do a recursive implode using a line break to ensure the diff tool is passed a string and is still functional

@shefik
Copy link

shefik commented Aug 24, 2015

This commit doesn't appear to be working. Are there any updates?

$meta_2 = get_metadata( 'post', $compare_to->ID, $key, false );

if ( ! empty( $this->revisioned_meta[ $key ]['display_callback'] ) ) {
$meta_1 = call_user_func( $this->revisioned_meta[ $key ]['display_callback'], $meta_1, $field, $compare_from, $compare_to );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like how this incorporates a potential display callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants