Make WordPress Core

Ticket #28587: 28587.patch

File 28587.patch, 1.5 KB (added by gauravmittal1995, 12 years ago)

Displays the Not found message.

  • wp-admin/themes.php

     
    122122                <a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js add-new-h2"><?php echo esc_html( _x( 'Add New', 'Add new theme' ) ); ?></a>
    123123        <?php endif; ?>
    124124        </h2>
     125<div id="notfoundmessage" class="updated"></div>
    125126<?php
    126127if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?>
    127128<div id="message1" class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
  • wp-admin/js/theme.js

     
    922922                        this.renderThemes( this.parent.page );
    923923                }
    924924
    925                 // Display a live theme count for the collection
    926                 this.count.text( this.collection.count ? this.collection.count : this.collection.length );
     925                // Display a live theme count for the collection.
     926                // Display a No Themes Found message if live theme count is 0
     927                var livecounter = this.collection.count ? this.collection.count : this.collection.length
     928                var message = document.getElementById("notfoundmessage");               
     929                if ( 0 === livecounter ) {
     930                        message.style.display="block";                 
     931                        message.innerHTML="<p>No Themes Found</p>";
     932                } else {
     933                        message.style.display="none";
     934                }               
     935                this.count.text( livecounter );
    927936        },
    928937
    929938        // Iterates through each instance of the collection