将参数发送到wordpress中的回调方法

时间:2015-04-18 14:56:19

标签: php wordpress plugins

所以,我在课堂上有两种方法:

public function addSubpage( $page_title )
{
    $filtered_title = str_replace( " ", "_", strtolower( $page_title ) );
    add_submenu_page(
        $this->_menu_slug,
        $page_title,
        $page_title,
        $this->_capability,
        $filtered_title,
        array( $this, 'renderSubpage' )// Here i need send some data to renderSubpage method
    );
}
public function renderSubpage( $arg )
{
    var_dump( $arg ); // Here i need get this value
    include( 'views/plugin_heading.php' );
    include( 'views/form_create_argue.php' );
}

如何通过回调将一些数据从一种方法发送到另一种方法?

0 个答案:

没有答案