0
votes

I am writing a plugin for wordpress.

function dbpresent_admin() {  
include('default.php');  
}
function dbpresent_admin_actions() {  
add_management_page("DB Presentor", "DB Presentor", 1, "db_presentator", "dbpresent_admin");
}  
add_action('admin_menu', 'dbpresent_admin_actions');

it is the portion of the code where I am trying to diplay content from default.php file but when I click on the menu item in wordpress it opens the page but does not display any data, kindly help me out

1
your codes seems to working fine, have you checked the path is correct of the included file?jogesh_pi
yes I did, actually I am integrating jqSuite as a plugin in wordpress and this snippet is supposed to display the content on db_presentator page but it is not doing so.Anfal
what is containing your default.php file, can you show us in pastebin.comjogesh_pi
take a look at this file pastebin.com/aA8cADuUAnfal
when i try to run default.php file locally on localhost it gives me no error and displays data correctly. But when I called the same file to display its data on wordpress page it returns a blank pageAnfal

1 Answers

0
votes

The include path looks wrong to me - change it to require and you should see the error.

Most likely you want to use something like

include( plugin_dir_path( __FILE__ ) . 'default.php' );

Or, require if it is a required file.

require( plugin_dir_path( __FILE__ ) . 'default.php' );