custom field in admin columns

Try replacing everything from the comment downwards with this. Basically you seemed to have a function in there that wasn’t getting called, and you need to add the case “incr_number” test to the woo_supportpress_ticket_custom_columns function: /*———————————————————————————–*/ /* Admin columns for post types */ /*———————————————————————————–*/ function woo_supportpress_ticket_columns( $old_columns ){ $columns = array( ‘cb’ => ‘<input type=\”checkbox\” … Read more

How can I change the publish date based on a custom field?

I don’t know how your front end form saves its data, but presumably it is using wp_insert_post and wp_update_post. If so, there is a filter called wp_insert_post_data that can be used to alter the post data before the post is inserted or updated. function reset_post_date_wpse_100021($data,$postarr) { var_dump($data,$postarr); die; //debug // your code return $data; } … Read more

How to calculate custom field value (average)

You can try this to fetch the custom values: $c1 = get_post_meta( get_the_ID(), ‘custom1’, TRUE ); $c2 = get_post_meta( get_the_ID(), ‘custom2’, TRUE ); $c3 = get_post_meta( get_the_ID(), ‘custom3’, TRUE ); $c4 = get_post_meta( get_the_ID(), ‘custom4’, TRUE ); Then to calculate the average: // check if c1, c2, c3 and c4 are all set: if( strlen($c1) … Read more

Meta value Array

If I understand you correctly, I don’t think this is a WordPress issue, just PHP. When you var_export into the textarea, then submit that via POST, what you then have is not an array but a string. You can check is_string instead of is_array to confirm this. If you want it to be an array … Read more