php - $_POST in array? -


i have script put terms array , database. below find snippet. working fine, cannot $post code work correctly. need contains value of 'app' combined $album['id'] submitted form. pretty sure doing wrong here. can me out? thanks.

global $wpdb; $post_id = get_queried_object_id(); $post_author_id = get_post_field( 'post_author', $post_id );  $albums = $wpdb->get_results( $wpdb->prepare( 'select * wp_wppa_albums owner = "' . get_author_name( $post_author_id ) .'"' ), array_a ); $input_terms = array();  if ( $albums ) foreach( $albums $album ) {  $input_terms[] = 'app_'.$_post[$album['id']]; //this goes wrong   } 

whoops, bad. easy fix

$input_terms[] = sanitize_text_field($_post['app_'.$album['id']]); 

worked me!


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -