WordPress.org

Ready to get started?Download WordPress

Forums

Plugin development - three questions (1 post)

  1. ssruprai@hotmail.com
    Member
    Posted 4 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 4 years ago by ssruprai@hotmail.com
  • This topic is not resolved
  • WordPress version: 3.0