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

added wp_post_revision_meta_value filter #25

Closed
wants to merge 1 commit into from
Closed

added wp_post_revision_meta_value filter #25

wants to merge 1 commit into from

Conversation

petenelson
Copy link

For issue #24, sample of using the new filter

add_filter( 'wp_post_revision_meta_keys', function( $keys ) {
    $keys[] = 'preview_twitter_description';
    return $keys;
} );

add_filter( 'wp_post_revision_meta_value', function( $meta_value, $meta_key, $new_autosave, $posted_data ) {

    // Save the preview Twitter description as a separate piece of post meta
    if ( 'preview_twitter_description' === $meta_key && isset( $posted_data['yoast_wpseo_twitter-description'] ) ) {
        $meta_value = 'Twitter: ' . sanitize_text_field( $posted_data['yoast_wpseo_twitter-description'] );
    }

    return $meta_value;
}, 10, 4 );

@adamsilverstein adamsilverstein deleted the branch adamsilverstein:master September 24, 2021 05:08
grappler added a commit to wearerequired/wp-post-meta-revisions that referenced this pull request Sep 24, 2021
@grappler
Copy link

grappler commented Sep 24, 2021

@adamsilverstein Did you close this PR by mistake?

I think this is a needed addition. I have named the filter wp_post_revision_autosave_meta_value in my fork of the plugin.

@adamsilverstein
Copy link
Owner

It was closed because I renamed the master branch to main, apologies. Reopening and will work on this soon!

@adamsilverstein
Copy link
Owner

@grappler when I tried to re-open it says "the repository that submitted this pull request has been deleted. " I can probably reconstruct from the diff here, but feel free to reopen or open a replacement PR.

I'll also try to review any PRs that were closed by my changing the base branch and reopen those.

@grappler
Copy link

grappler commented Oct 5, 2021

I can open a replacement PR once #61 is merged as the changes are need in the same lines.

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