I am trying to add access callback to already existing access callback for a menu item.

For eg,

path = [node/nid/edit] with access callback 'AC1'.

Now is it possible for us to add another access callback to the existing AC1? I am thinking of hook menu alter but it wont overwrite the AC1.


No, it isn't. Drupal wouldn't know how to treat contradictory results*.

On the other hand, nothing stops you from calling original function inside your own. If you are unsure what is it, copy it's name to access arguments and use it inside your callback. Don't forget to back up original access arguments in sub array, if needed.

* Or rather Drupal devs would need to agree how to treat them, and have a will to bother at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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