I have created a custom form named user_form_expiry, how can I access that form from the admin panel similar to other Drupal's built in forms like user_register_form?

  • how did you create it? give us more Details.
    – shekoufeh
    May 12, 2015 at 7:54

1 Answer 1


You'll need to create a menu hook in your module and give the form name as your callback arg. Something like this:

<?php function MYMODULE_menu(){ $items['admin/my-path'] = array( 'title' => 'User expiry', 'page callback' => 'drupal_get_form', 'page arguments' => array('user_form_expiry'), 'access arguments' => 'access content', // you probably want something more restrictive here 'menu_name' => 'management', //'weight' => 1, ); } function user_form_expiry($form, &$form_state){ // form API code here }

That said, I suspect that your use case would work better using hook_form_alter(). What are you trying to achieve here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.