Hot answers tagged

2

Storing of your own meta fields is typically a custom process, more so if you are using a third party framework. Technically it's possible, but clunky: Hooking into save_post would allow you to check if meta is added to it If so you can immediately query for previous (if any) post that had it and unset the meta for it However I concur with the comment ...


1

You need to get the title for each post ID in your array. The straightforward way is this: $procedure_title_list = array(); $procedure_list = get_post_meta($patient_story->ID, 'Procedure', false); foreach ( $procedure_list as $procedure ) { $procedure_title_list[] = get_the_title( $procedure ); } echo implode( ', ', $procedure_title_list );


1

Are you outputting the saved data to the edit post page before saving the post? If not you may be getting a empty $_POST['collection-topics'] data and then saving empty or null data. I would do a check before doing add_post_meta() if ( empty($_POST['collection-topics']) ) return;


1

This is how meta_key/_values work. How you store your values is case sensitive. Example meta_key = 'foo' and meta_value = 'Bar' Would return the result you are looking for: $posts = new WP_Query( 'post_type=post&meta_key=foo&meta_value=Bar' ); Would not return the result you are looking for: $posts = new WP_Query( 'post_type=post&meta_key=...


1

While you can't edit the dropdown list, you can achieve what you want as long as you are able to edit your theme or if your theme uses the standard the_author() template tag. To recast your question, you want: Editor's names to show as Name + nickname + surname Other names to show as nickname No-one to be able to change this except Admins I'm assuming ...



Only top voted, non community-wiki answers of a minimum length are eligible