WordPress.org

Make WordPress Core

Ticket #19827: core-ticket19827.diff

File core-ticket19827.diff, 1.5 KB (added by tfnab, 17 months ago)
  • wp-admin/includes/screen.php

     
    606606                if ( ! $args['id'] || ! $args['title'] ) 
    607607                        return; 
    608608 
    609                 $this->_help_tabs[] = $args; 
     609                $this->_help_tabs[$args['id']] = $args; 
    610610        } 
    611611 
    612612        /** 
     
    686686                                <div id="contextual-help-columns"> 
    687687                                        <div class="contextual-help-tabs"> 
    688688                                                <ul> 
    689                                                 <?php foreach ( $this->_help_tabs as $i => $tab ): 
     689                                                <?php $i=0; foreach ( $this->_help_tabs as $tab ): 
    690690                                                        $link_id  = "tab-link-{$tab['id']}"; 
    691691                                                        $panel_id = "tab-panel-{$tab['id']}"; 
    692692                                                        $classes  = ( $i == 0 ) ? 'active' : ''; 
     
    697697                                                                        <?php echo esc_html( $tab['title'] ); ?> 
    698698                                                                </a> 
    699699                                                        </li> 
    700                                                 <?php endforeach; ?> 
     700                                                <?php $i++; endforeach; ?> 
    701701                                                </ul> 
    702702                                        </div> 
    703703 
     
    708708                                        <?php endif; ?> 
    709709 
    710710                                        <div class="contextual-help-tabs-wrap"> 
    711                                                 <?php foreach ( $this->_help_tabs as $i => $tab ): 
     711                                                <?php $i=0; foreach ( $this->_help_tabs as $tab ): 
    712712                                                        $panel_id = "tab-panel-{$tab['id']}"; 
    713713                                                        $classes  = ( $i == 0 ) ? 'active' : ''; 
    714714                                                        $classes .= ' help-tab-content'; 
     
    724724                                                                        call_user_func_array( $tab['callback'], array( $this, $tab ) ); 
    725725                                                                ?> 
    726726                                                        </div> 
    727                                                 <?php endforeach; ?> 
     727                                                <?php $i++; endforeach; ?> 
    728728                                        </div> 
    729729                                </div> 
    730730                        </div>