Make WordPress Core


Ignore:
Timestamp:
11/04/2015 09:48:43 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Themes: Add a Favorites tab to the Add Themes screen.

You can now browse and install your wordpress.org theme favorites from the theme installer, just like with plugins.

Props swissspidy.
Fixes #34206.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/theme-install.php

    r35273 r35527  
    140140            <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
    141141            <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
     142            <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li>
    142143        </ul>
    143144
     
    145146
    146147        <div class="search-form"></div>
     148
     149        <div class="favorites-form">
     150            <?php
     151            $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
     152            update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
     153            ?>
     154            <p class="install-help"><?php _e( 'If you have marked themes as favorites on WordPress.org, you can browse them here.' ); ?></p>
     155
     156            <p>
     157                <label for="user"><?php _e( 'Your WordPress.org username:' ); ?></label>
     158                <input type="search" id="wporg-username-input" value="<?php echo esc_attr( $user ); ?>" />
     159                <input type="button" class="button button-secondary favorites-form-submit" value="<?php esc_attr_e( 'Get Favorites' ); ?>" />
     160            </p>
     161        </div>
    147162
    148163        <div class="filter-drawer">
Note: See TracChangeset for help on using the changeset viewer.