WordPress.org

Ready to get started?Download WordPress

Forums

add_submenu_page pass parameters in $function (3 posts)

  1. dashaluna
    Member
    Posted 3 years ago #

    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.

  2. hadvig
    Member
    Posted 3 years ago #

    Hello.

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

  3. yannou974
    Member
    Posted 3 years ago #

    Is it really working like that with create_function ?

Topic Closed

This topic has been closed to new replies.

About this Topic