Skip to content

Instantly share code, notes, and snippets.

@barrykooij
Last active December 15, 2017 12:21
Show Gist options
  • Save barrykooij/94e380e81fc02cfd04a9 to your computer and use it in GitHub Desktop.
Save barrykooij/94e380e81fc02cfd04a9 to your computer and use it in GitHub Desktop.
function custom_rp4wp_add_meta_fields( $meta_fields, $post_id, $post ) {
// replace my_post_type with your post type
if ( 'my_post_type' === $post->post_type ) {
// replace my_post_meta_field with your meta key. You can add as many as you like
$meta_fields[] = 'my_post_meta_field';
}
return $meta_fields;
}
add_filter( 'rp4wp_related_meta_fields', 'custom_rp4wp_add_meta_fields', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment