开发者

Wordpress add_options_page

I would like to create two plugins for my wordpress blog and I need different admin settings for both.I am trying to adding plugin administration; but which selecting both settings together when select single.What's wrong with me.Here I am attaching what I done

add_action('admin_menu', 'sb_load_featured_slider');

function sb_load_featured_slider() {
$mypage = add_options_page('SB_Featured Slider', 'SB_Featured Slider', 8,   array('sbslider','sbslider1','sbslider2'), 'sb_featured');
add_action( "admin_print_scripts-$mypage", 'sb_loadjs_admin_head' );
 }

and my second plugin says as follows

add_action('admin_menu', 'sb_load_intro');

  function sb_load_intro() 
 {
$mypage = add_options_page('SB Introduction', 'SB Introduction', 9,  array('sbintro','sbjquery'), 'sb_intro');
add_action( "admin_print_scripts-$mypage", 'sb_introjs_admin_h开发者_如何学Cead' );
 }


well I see one similarity between the 2 functions. You use the $mypage variable in both functions and use that for the second add action. try to use different variable names and see if it fix your problem.

eg: $mypage1, $mypage2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜