Save data from a checkbox to a wpdb array

This isn’t a WordPress question this is a PHP question. Your foreach loops through all the $checkboxes putting one in the $check variable each time, so your insert() call only inserts the last value for $check, because it’s not inside that foreach loop. You probably want: global $wpdb; foreach( $checkboxes as $check ) { $wpdb->insert(‘data’,array(‘fruit’ … Read more

What form should the $query media query array have for an Elementor page builder function? [closed]

Preface There’s no WordPress-specific stuff in this answer, but I’m just trying to help since the official documentation is (as of writing) not very helpful.. But as I said in the comments, I don’t use Elementor, which means I don’t know much about Elementor’s technical stuff. ( Even the non-technical ones, actually.. 🙂 ) The … Read more

Foreach loop inside an array_merge

Someting like this? foreach ($subscribers as $user) { $users[] = array( ‘label’ => $user->display_name, ‘value’ => $user->display_name ); } Then do the array_merge with $users

How to print Array values of custom Fields Meta?

Based on the screenshot I assumed is var_dump of your $item The code should look like <?php $item = get_post_meta($post->ID, ‘occupationalCategory’, false); ?> <?php print_r( $item[‘occupationalCategory’][0] ); ?>; <?php print_r( $item[‘occupationalCategory’][1] ); ?> $item contains array, with a element which key is ‘occupationalCategory’, this element points to other array with two elements

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