How to build widget with arrays inside arrays?

get_field_id prepare prefix for field id, within one widget instance it’s always the same. Your form fields probably look similar to these: // — $element[0] — // $field[icontxt] <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][0]” value=”%4$s”> // $field[iconlnk] <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][0]” value=”%4$s”> //$field[iconlnktrgt] <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][0]” value=”%4$s”> // — $element[1] — <input class=”widefat” id=”widget-baseid-instance-inner_elements” name=”widget-baseid[instance][inner_elements][1]” value=”%4$s”> … Read more

Metabox repeating fields – radio buttons not saving correctly

So I came back to this after practice and implemented some of the Alchemy setup, meaning all the inputs have names like name=”_movies[3]Metabox repeating fields – radio buttons not saving correctly” where 3 is the iteration we’re on in the loop. Create the Metabox // metaboxes should be registered on the add_meta_boxes hook add_action(‘add_meta_boxes’, ‘add_meta_boxes’ … Read more

get_option function

You are using get_option() wrong, first variant, so take another look at the get_option() documentation. Basically you can’t directly access an array element with the function, it just doesn’t support it. The second variant should be possible, but you need at least PHP 5.4 – if I’m not totally mistaken; I don’t know anything about … Read more

What kind of object type is WP_Query?

I’m not sure you understand the logic of WP_Query. Rather than explain in words, here’s a code example; $query = new WP_Query( array( ‘meta_key’ => ‘Old ID’, ‘meta_value’ => $atts[‘oldid’] ) ); if ( $query->have_posts() ) return $query->posts[0]->post_title; return ”; Check out the codex on interacting with WP_Query. UPDATE: To use the query as you … Read more

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