Support » Plugins and Hacks » add_submenu_page pass parameters in $function

  • Hello,

    I was wondering if it is possible somehow to pass parameters to $function in the <?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function); ?>

    For example:

    add_submenu_page(“productions”, ‘Edit’, ‘Edit’, ‘read’, “add-productions”, ‘production_content_page(true)’);

    function production_content_page($is_add = false){ … }

    I tried to find how to pass params to $function, but with no luck. Is it possible? How do I do it?

    Many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello.

    Try to use something like this:
    add_submenu_page("productions", 'Edit', 'Edit', 'read', "add-productions", create_function('', 'production_content_page(true);'));

    Is it really working like that with create_function ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add_submenu_page pass parameters in $function’ is closed to new replies.