Non-array argument in array_merge()-function [closed]

Just make sure it’s definitely an array before you try to merge it: function minevalg_hent_innstillinger() { $defaults = array(); // define this somewhere; reference it here if ( is_array( $options = get_option( ‘minevalg’ ) ) ) $options = array_merge( $defaults, $options ); else $options = $defaults; return $options; }

Create Customization Controls from Array

Please add “;” after $i = $i++ and see if that fixes your issue foreach ($socialIcons as $icon) { $i = $i++; $wp_customize->add_setting( ‘pxk_href_’ . $icon[‘name’], // use this in twig file call to theme_mod array( ‘default’ => ”, ‘transport’ => ‘postMessage’, ‘priority’ => $i ) );

how to query for meta_value have array

No, you can’t do that via a query. You can request everything then manually filter out items via PHP, but that would be slow. Instead, you need to address the root problem, that you’re storing serialised PHP data in a single field, rather than multiple fields, e.g. you should have an option1 meta key/value and … Read more