Customizer Settings in Arrays

The get_theme_mod() function works the following: It fetches the get_theme_mods() function under the hood. This returns the following data $theme_slug = get_option( ‘stylesheet’ ); get_option( “theme_mods_{$theme_slug}” ); So in case you upgrade, write an upgrade function specific for that version of your plugin or theme, that uses one of the following, where the name is … Read more

meta_query issue with multiple numerics

Untested and semi-pseudo code obviously. The idea is that a meta query is already an array of arrays, each field in your form is another nested array. If a value exists we push it onto the array. <?php $_location = $_GET[‘location’] != ” ? $_GET[‘location’] : ”; $_status = $_GET[‘status’] != ” ? $_GET[‘status’] : … Read more

Checking array against author id in loop

You actually want author__in, and you can use the array. You shouldn’t implode it: $query = new WP_Query( array( ‘author__in’ => $friendsIdArray ) ); As far as where in the Loop this goes, I’m not sure I understand. This occurs before creating your a Loop, not in it.

Struggling with array and foreach loop

You can get an array with just the numbers by using array_values($your_array); It will return an array with just the numbers. Is this what you need, or a string with a comma separated list of IDs? If that’s the case, use this: implode(“,”,array_values($your_array)); Hope this helps.