How can I programmatically populate a drop-down list field's options? I have a paragraph bundle with several fields, on of them being drop-down list.

How would I go about populating this dropdown list via code, programmaticaly?

I don't really know where to begin with this...
Ok, here's what I figured out:

Use hook_field_widget_form_alter()

My case:

function my_module_field_widget_form_alter(&amp;$element, &amp;$form_state, $context) {

  // Check if element is paragraph type, belongs to a specific paragraphs
  // bundle and contains a specific field.
  if (empty($element['#entity']) || $element['#entity_type'] !== 'paragraphs_item' ||
    $element['#bundle'] !== 'content_block' || $element['#field_name'] !== 'field_dropdown_text_single') {
    return;
  }

  // Get entity metadata
  $form_field_wrapper = entity_metadata_wrapper('paragraphs_item', $element['#entity']);

  // Set default value. If there is already a set value use that,
  // else set to '_none'
  $default_value = $form_field_wrapper-&gt;field_dropdown_text_single-&gt;value();
  $element['#default_value'] = !empty($default_value) ? $default_value : '_none';


  // Code to get your custom select options goes here


  // Inject custom options into paragraph's dropdown selector.
  $element['#options'] = $my_options;
}