Repeatable field within repeatable group of fields
Use Advanced Custom Fields. I despise using plugins when I can do something myself but ACF has become indispensable for solving code nightmares like this.
Use Advanced Custom Fields. I despise using plugins when I can do something myself but ACF has become indispensable for solving code nightmares like this.
From the codex http://codex.wordpress.org/Class_Reference/WP_Query: $args = array( ‘post_type’ => ‘my_custom_post_type’, ‘meta_key’ => ‘age’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’ => array( array( ‘key’ => ‘age’, ‘value’ => array(3, 4), ‘compare’ => ‘IN’, ) ) ); $query = new WP_Query($args); Look at the meta_query section. you can define the key and then all the possible … Read more
You have the add_action that’s supposed to hook your prfx_meta_save function inside the function itself, so it never gets hooked or called. You need to move the add_action outside the function. This will never work: function prfx_meta_save( $post_id ) { add_action( ‘save_post’, ‘prfx_meta_save’ ); } Move it outside the function: function prfx_meta_save( $post_id ) { … Read more
So I found out the problem was in the database. If I deleted the page, then re-created it then it functioned as it should. I couldn’t narrow down what exactly was wrong with the data, but something was. That page did have a lot of revisions, not that it should matter?
WordPress check if value equals and echo “checked”
Hooking into the Meta Boxes (Name/Web Address/Description) on the ‘Add New Link’ Page
How to add jquery to my custom post type wp plugin
Displaying image from a repeatable group
I figured it out myself so I will post the answer here, please note that the original answer can also be found on StackOverflow. If the mods feel like this should be deleted from here and only remain, please go ahead. I thought it might be useful on both places. First the correct code, then … Read more
add_post_meta not saved