Drush subcommands

Examples for calling drush commands as subcommands when needing to split activity into a separate process for memory or other constraint reasons


drush_backend_invoke('command_to_run', drush_redispatch_get_options());

Options can also be adjusted if the subcommand needs to run with different options than the current command


$options = drush_redispatch_get_options();
$options[] = 'add_an_argument';
drush_backend_invoke('command_to_run', $options);

Using JQuery to make field labels appear inside textfields

Sample code is for taking the labels for form elements produced by Drupal and putting them inside of the text based fields as the label. Handles clearing the label from the field when selected and returning it when unselected if it is still empty.

Creating an additional content field in hook update

Very brief code snippet of creating an additional content field in a hook update. This programmatically creates a field as though it were created by hand. This is not the way to allow a module to expose fields for use and placement anywhere.

Syndicate content