You are here

function hook_fieldable_panels_pane_content_type_alter in Fieldable Panels Panes (FPP) 7

Allow other modules to modify the Fieldable Panels Pane CTools content type.

Parameters

array $content_type: The individual content type to be returned.

string $subtype_id: The subtype id of the fieldable panel pane being altered for render.

array $plugin: The CTools content type plugin.

1 invocation of hook_fieldable_panels_pane_content_type_alter()
fieldable_panels_panes_fieldable_panels_pane_content_type in plugins/content_types/fieldable_panels_pane.inc
Return an individual FPP.

File

./fieldable_panels_panes.api.php, line 163
Hooks provided by the Fieldable Panels Panes module.

Code

function hook_fieldable_panels_pane_content_type_alter(array &$content_type, $subtype_id, array $plugin) {

  // For button FPP bundles, always show the latest revision.
  if ($content_type['bundle'] == 'button' && substr($subtype_id, 0, 4) === 'vid:') {
    $vid = substr($subtype_id, strpos($subtype_id, ':') + 1);
    $fpid = db_query('SELECT f.fpid FROM {fieldable_panels_panes} f WHERE f.vid = :vid', array(
      ':vid' => $vid,
    ))
      ->fetchField();
    $content_type['name'] = 'fpid:' . $fpid;
    $content_type['entity_id'] = 'fpid:' . $fpid;
  }
}