[wp-hackers] Three Plugin development questions

Sukhwinder Singh ssruprai at hotmail.com
Fri Jul 9 13:47:40 UTC 2010


Hello,

I had posted this at wordpress.org forum but haven't received any reply since yesterday so I subscribed to this mailing list to try to get any help.


			I am developing a plugin and I have following 
code:



add_action('admin_menu','businesses_navigation');

function businesses_navigation()

{

	add_object_page("Firms Manager", "Firms", 8, 'firm_listing', 
"business_listings"); 

	add_submenu_page('firm_listing', 'Add Firm' , 'Add Firm', 8, 'firm, 
'add_firm' );

}

function business_listings()

{

	global $wpdb;

	include('firm_listing.php');

}

function add_firm()

{

	global $wpdb;

	include('firm.php');

}



Problems:


1. Main menu 'Firms' item also appears in submenu.



2. The submenu page 'Add Firm' is used to add/edit a firm. But when 
after adding a firm I try to redirect to 'firm listing' page I get the 
headers already sent error. "Warning: Cannot modify header information -
 headers already sent by (output started at 
<path>\wordpress3\wp-admin\admin-header.php:19)". JavaScript 
redirect is an option but I don't want to use it.



3. I want to change the page/title header dynamically when user is 
'editing' the firm rather than 'adding'. Right now it always shows 'Add 
Firm'.

Please let me know how I can achieve the above.



Thanks


		
 		 	   		  
_________________________________________________________________
The latest in fashion and style in MSN Lifestyle
http://lifestyle.in.msn.com/


More information about the wp-hackers mailing list