douwen6274 2015-10-21 04:42
浏览 88
已采纳

如何创建一个在wp-admin / post.php页面中工作的wordpress插件

I want to create a wp plugin to show record from database. I have added a table in database and want to fetch and show record in wp-admin post.php page under the post.php page editor.

I have post_id in my table as a foreign key. so I want to fetch record of selected post_id.

This is my plugin code.....

<?php
    /*
        Plugin Name: Kiosk User Info
        Plugin URI: http://pixako.com
        Description: This is Kiosk User Info.
        Author: Muhammad Asfund Yar - Pixako
        Version: 1.0
        Author URI: http://pixako.com
    */

    /* Plugin Main Page/Setting Page*/
    function KioskUserInfo_mainPage(){
        echo "<br />This is main page of plugin<br /> Go to the post page. here we are using it. <br /> Thanks";
    }


    /*Plugin Working Area*/
    function KioskUserInfo_postPage(){
        echo "I want this code to show in wp-admin/post.php page under editor.";
    }
    add_action( 'registered_post_type', 'KioskUserInfo_postPage' );


    /*Menu Links*/
    function KioskUserInfo_menu(){
        add_menu_page('Kiosk User Information Plugin','Kiosk User Info', 'manage_options','kiosk-user-info-mainpage','KioskUserInfo_mainPage');
    }
    add_action('admin_menu','KioskUserInfo_menu');
?>
  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 刚入职被要求写这种文档,应该如何下手
      • ¥15 最优经济尺寸设计问题
      • ¥15 从多元正态分布中生成3维样本
      • ¥15 GEO下载数据的处理报错 :函数‘Meta’标签‘"data.frame"’找不到继承方法,如何解决?
      • ¥15 android object box 一个实体多个表怎么写
      • ¥15 temux 启用docker 服务失败
      • ¥15 Flask 使用celery发送邮件出现‘目标计算机积极拒绝‘
      • ¥15 超时跳出方法代码的返回值问题
      • ¥15 汇编语言程序设计设计,ascii码求数,再求数的BCD码
      • ¥30 Mask rcnn训练自己的数据集出现问题!