(WP) Save post title as meta that can be filtered (checkbox, dropdown)

66 Views Asked by At

Simple dumb question in bad english. I need to save/update post title as metafield in a way can be filtered (by Jetsmatrfilter or others filter)

I've some custom post that contains text, text area, checkbox and radio built with JetEngine (but compatible with acf).

Now i'm trying to build some visual filter for this custom posts. The problem is that filter (dropdown) works only with value added with checkbox, radio or select field.

I've added a script that save post title as post meta but it's a text field, so filter doesnt work.

function wpse_275785_save_title_as_meta( $post_id, $post, $update ) {
    update_post_meta( $post_id, 'post_title', $post->post_title );
}
add_action( 'save_post', 'wpse_275785_save_title_as_meta', 99, 3 );

is there a way to save post title automatically as checked radio, or checkbox? a way that works if i update the post too.

is there another way to save post title as a field that can be filtered?

0

There are 0 best solutions below