Removing label from settings on a submenu page

  • Unknown's avatar

    Hi, this is quite a dumb question: how do you remove labels when registering settings on a menu page? Here’s my code, the labels are empty, yet I still get an empty <th> on my page.

    function shop_closure_settings_init() {
      register_setting(
        'shop_closure_group', 						// The group name of the settings
        'shop_closure', 							// The name of the option to save
        'sanitize_callback_function' 						// The name of the sanitization callback function
      );
    
    
      // Register a new section in the "shop_closure" page
      add_settings_section(    
        'shop_closure_section',										// The slug of the section    
        '',	// The text to be displayed in the section header    
        'shop_closure_calendar_header',								// The function that will be used to render the section header    
        'shop_closure'												// The slug of the settings page the section should be added to
      );
    
     add_settings_field(
        'shop_closure_calendar',
        '',    
        'shop_closure_calendar_cb',							// The function that will be used to render the field    
        'shop_closure',										// The slug of the settings page the field should be added to
        'shop_closure_section',								// The slug of the section the field should be added to
        
        [// Additional arguments to pass to the callback function
    	  'shop_closure_custom_data' => 'custom',
        ]
      );  
      
      
      add_settings_field(
        'shop_closure_message',
        '',    
        'shop_closure_message_cb',					// The function that will be used to render the field    
        'shop_closure',								// The slug of the settings page the field should be added to
        'shop_closure_section',						// The slug of the section the field should be added to
        
        [// Additional arguments to pass to the callback function
          'shop_closure_custom_data' => 'custom',
        ]
      );
      
    
    }

    The blog I need help with is: (visible only to logged in users)

  • Hey there –

    Thanks for writing to us. I’ve had a look and can see this project is not hosted on WordPress.com. Sadly, that means we don’t have access to help.

    Looks like you are hosted through zxcs.nl which means you’re also set up on the open source WordPress project. Help with that version of WordPress comes from https://wordpress.org/support/forums/

    On WordPress.com our team does the heavy lifting so you dont’ have to fuss with custom code or back end details. We got it. You get to focus on the content. Everything you need to grow is included.

    Hosting starts at $4/month. Let me know if you have any other questions about the hosting features or logistics of moving.

  • The topic ‘Removing label from settings on a submenu page’ is closed to new replies.