query->all(); foreach ($variables['content'] as $type) { $variables['types'][$type->id()] = array( 'link' => \Drupal::l($type->label(), new Url('block_content.add_form', array('block_content_type' => $type->id()), array('query' => $query))), 'description' => array( '#markup' => $type->getDescription(), ), 'title' => $type->label(), 'localized_options' => array( 'query' => $query, ), ); } }