i want to add more rows to array if statement is true: i tried to add with the code below but without any success.
- how to add this row in the right way?
- how can i set the order for all the rows that i will add by code?
this is the array:
$pages = array(
'visit' => array('url' => ''),
'dashboard' => array('url' => 'index.php'),
'posts' => array('url' => 'edit.php', 'permission' => 'edit_posts'),
'pages' => array('url' => 'edit.php?post_type=page', 'permission' => 'edit_pages'),
'comments' => array('url' => 'edit-comments.php', 'permission' => 'edit_posts'),
'users' => array('url' => 'users.php', 'permission' => 'list_users'),
);
// now here i want to add this row to array if somthing is true...
if ($page_gallery) {
$gallery_page_id = $page_gallery->ID;
$pages['gallery'] => array ('url' => 'post.php?post='. $gallery_page_id .'&action=edit');
}