dongshenjie3055 2013-10-10 22:35
浏览 77

用iframe创建一个简单的Wordpress插件页面?

I am creating a plugin page for Wordpress. This plugin page contains an iframe. But a suggested php method (instead of iframe html method) of yours would be nice too.

What is a problem is that this plugin page not responding. Because this plugin page has not created its own admin menu. What is wrong with this plugin page?

Here is code:

<?php
/*
Plugin Name: Leo
Plugin URI: http://www.example.com
Description: Blabla
Author: Leo
Version: 1.1
Author URI: http://www.example.com

function schedule() {
  ?>
    <h1>schedule</h1>
    <a href="/wp-admin/admin.php?page=schedulesite">Show schedule</a><br />
  <?PHP
}

function schedulesite() {
  echo "<iframe style="width:100%;height:800px;border=0;"
src="http://www.example.com/schedule.php"></iframe>";
}


function scheduleAddMenu() {
  add_menu_page('schedule', 'schedule', 10, __FILE__, 'schedule');
  add_submenu_page(__FILE__, 'Show schedule', 'Show schedule', 10, 'schedulesite', 'schedulesite');
}
?>
  • 写回答

3条回答 默认 最新

  • dongnigeng1295 2013-10-10 23:48
    关注

    Your function scheduleAddMenu() is never called. You can just add a statement to call it at the end of the file.

    评论

报告相同问题?

悬赏问题

  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图