CPT disappeared after using get_post_meta() and update_post_meta()
-
Hi,
I set up a custom post type a few weeks ago and have entered lots of information against this. Today I have been coding my application and have used the below to get data from my post type and to update my post type. This all seemed to have worked really well, but after going back to my WP control panel I have noticed the icon for the custom post type was missing and so went to the CPT UI under Manage Custom Post Types and it states, “No additional post types found”//get current stock and update with new stock
$stock = get_post_meta( $posttype->plant_id, ‘stock’, true );
update_post_meta($plant->plant_id, ‘stock’, $stock-$posttype->no_of_shelves); `Does anyone know what could have happened to this and how I can get it back?
- The topic ‘CPT disappeared after using get_post_meta() and update_post_meta()’ is closed to new replies.