Why are array_slice() and array_chunk() not working?

You need to do the slice on the results, not the arguments to the function. So: $arr = array( //$section_top_parent is the top parent of the custom post type “section” ‘child_of’ => $section_top_parent, ‘post_type’ => ‘section’, ‘title_li’ => NULL, ‘depth’ => 1, ‘sort_order’ => ‘asc’, ); $result = wp_list_pages($arr); $sliced = array_slice($result, 3, 5); wp_list_pages($sliced);

Adding an item to an anonymous array inside a filter?

I added the capabilities now through this code. I’m not happy with my solution and it would be great if someone could find a proper way to add to the filter. I would be honestly interested to know how to make it properly work. add_action( ‘admin_init’, ‘jp_add_atum_caps_to_shop_manager’); function jp_add_atum_caps_to_shop_manager() { if(!user_can( 217 , ‘atum_read_inbound_stock’)) { … Read more

Access to numerically indexed array in wpdb Class and undefined offset

var_dump($einzel); array(10) { [0]=> string(3) “144” [1]=> string(10) “21.05.2020” [2]=> string(10) “00.00.0000” [3]=> string(30) “Zugtag der Königsgilde Voitze” [4]=> string(14) ” ab 10.00 Uhr ” [5]=> string(0) “” [6]=> string(41) “Schützenhaus Voitze, Salzwedeler Straße” [7]=> string(6) “Voitze” [8]=> string(11) “Gaede,Joerg” [9]=> string(23) “[email protected]” } There are two same column names: ‘id’ and ‘name’. I worked … Read more