Skip to content

Instantly share code, notes, and snippets.

@angry-dan
Created November 13, 2014 13:00
Show Gist options
  • Select an option

  • Save angry-dan/539203466e769942c599 to your computer and use it in GitHub Desktop.

Select an option

Save angry-dan/539203466e769942c599 to your computer and use it in GitHub Desktop.
<?php
// If you are unfortunate enough to still be using nodequeues (see entity queue)
// this will should work for creating new queues:
// Note I built the array from a drupal_var_export and a nodequeue load operation
// Then I added the add_subqueue argument and removed the qid (both mandatory).
function mymodule_update_N() {
$queue = (object) array(
'name' => 'machine_name',
'title' => 'Queue name',
'subqueue_title' => '',
'size' => '0', // For infinate
'link' => 'Link title when adding to the queue',
'link_remove' => 'Link title when removing from queue',
'owner' => 'nodequeue',
'show_in_ui' => '1',
'show_in_tab' => '1',
'show_in_links' => '1',
'reference' => '0',
'reverse' => '1',
'i18n' => '0',
'subqueues' => '1',
'types' => array(
'applicable_content_type_machine_names',
),
'roles' => array(
'4', // Allowed role IDs
),
'count' => 0,
'add_subqueue' => array(0 => 'Promotions'),
);
nodequeue_save($queue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment