最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Creating template page for my plugin in WordPress

programmeradmin0浏览0评论

I was following a tutorial, but when they have done it, there was an option for the plugin and the form page was showing, but in my case it did not work. Do I need to add action hook?

The code is as follows:

/*
Plugin Name: Login Form Plugin
Author: Mitaly
version: 0.0.3
Description: This is a custom plugin
*/
<?php
//add custom page fanction
function DBP_add_front_page(){
  //include insertion code
  include_once("form_template.php");
  DBP_insert_data();
}
//define absolute path to avoid direct ArrayAccess
 if(!defined('ABSPATH'))
 {
   define('ABSPATH',dirname(__FILE__) . '/');

 }

 //including database files

 include_once("employess-form.php");

 //register hook

 register_activation_hook(__FILE__,"DBP_tb_create");

 //filter
 add_filter('page_template','DBP_add_front_page');
  ?>
发布评论

评论列表(0)

  1. 暂无评论