79404846

Date: 2025-02-01 11:04:15
Score: 0.5
Natty:
Report link

Ok, I have found a workaround. Answering here, to add the code I updated. I am not using the style attribute anymore, I am just adding a class if I need to hide a specific tab.

$tab_main = $_GET['tab'] === 'tab_main' ? '' : 'team-hide';
$tab_dest = $_GET['tab'] === 'tab_destination' ? '' : 'team-hide';
add_settings_section(
    'team_section_main',
    '',
    '',
    'team_searchbox',
    array(
        'before_section' => '<div class="tab-content '.$tab_main.'">',
        'after_section' => '</div>'
    )
);
add_settings_section(
    'team_section_destination',
    '',
    '',
    'team_searchbox',
    array(
        'before_section' => '<div class="tab-content '.$tab_dest.'">',
        'after_section' => '</div>'
    )
);

And then just using css on the team-hide class. This does the trick.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: udarts