Pager on Widget Form Query The module is a small custom widget for the entity reference field. It creates a list of nodes that allows for multiple selections. 

Is it possible to paginate the results of the query even though this is a widget for a field?

function outfit_builder_field_widget_form(&amp;$form, &amp;$form_state, $field, $instance, $langcode, $items, $delta, $element) {

///...Additional Code Removed

$query = db_select('node', 'n');
$query-&gt;addTag('node_access');
$query-&gt;join('field_data_' . $instance['widget']['settings']['image_field_' . $type], 'fd', 'fd.entity_id = n.nid');
$query-&gt;fields('n', array('title', 'nid'));
$query-&gt;fields('fd', array($instance['widget']['settings']['image_field_' . $type] . '_fid'));
$query-&gt;condition('n.type', $type, '=');
$query-&gt;condition('fd.delta', 0, '=');
$query-&gt;condition('n.status', 1, '=');
$result = $query-&gt;extend('PagerDefault')-&gt;limit(21)-&gt;execute();
foreach ($result as $node) {
  $options[$node-&gt;nid] = theme('image_style', array(
      'style_name'  =&gt; $instance['widget']['settings']['image_style'],
      'path'        =&gt; file_load($node-&gt;{$instance['widget']['settings']['image_field_' . $type] . '_fid'})-&gt;uri,
      'title'       =&gt; check_plain($node-&gt;title),
    )
  );
}

$element += array(
'#type'             =&gt; 'checkboxes',
'#options'          =&gt; $options,
'#attributes'       =&gt; array(
  'class' =&gt; array('item'),
),


return $element;


}
I figured it out. After you extend your query:

$result = $query-&gt;extend('PagerDefault')-&gt;limit(21)-&gt;execute();


You'll need to also include the pager

// Attach the pager theme
$element['pager_pager'] = array('#theme' =&gt; 'pager',);