Skip to content

Instantly share code, notes, and snippets.

@opalsignum-snippets
Created June 20, 2013 07:51
Show Gist options
  • Save opalsignum-snippets/5820954 to your computer and use it in GitHub Desktop.
Save opalsignum-snippets/5820954 to your computer and use it in GitHub Desktop.
PHP: Views Embedding in the User Profile Form with hook_form_alter
<?php
/**
* Implements hook_form_alter().
* - Extends the User Profile Form with the calendar view
*/
function pw_profile_extender_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'user_profile_form') {
$form['calendar admin'] = array(
'#type' => 'markup',
'#markup' =>views_embed_view('calendar','calendar_admin_block'),
'#weight' => 1,
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment