sanitize POST arrays

You can use array_map like this: $room_types = isset( $_POST[‘room_types’] ) ? (array) $_POST[‘room_types’] : array(); $room_types = array_map( ‘esc_attr’, $room_types ); // Replace esc_attr with your desire sanitization

Display a CPT based on a metabox selection

I got it to work by using the following code function get_gas_options($a) { $args = array( ‘post_type’ => ‘fleet’, ‘orderby’ => ‘ID’, ‘post_status’ => ‘publish’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1 // this will retrive all the post that is published ); $result = new WP_Query( $args ); $title_list[”] = “Assign a Vehicle”; if ( … Read more

Sorting table function default

You can sort this by adding ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, into the $transaction_params array. and if not working change ‘suppress_filters’ => true, See reference: here Thank you.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)