Plugin Directory

Changeset 3025514


Ignore:
Timestamp:
01/23/2024 06:18:59 AM (2 years ago)
Author:
web83info
Message:

Add: Plugin original CSS.

Location:
login-by-referer
Files:
20 added
3 edited

Legend:

Unmodified
Added
Removed
  • login-by-referer/trunk/class/class-loginbyreferer-core.php

    r3024843 r3025514  
    2323     * Plugin constant.
    2424     */
    25     const PLUGIN_VERSION = '1.0.1';
     25    const PLUGIN_VERSION = '1.0.2';
    2626    const PLUGIN_PREFIX  = 'login-by-referer';
    2727    const PLUGIN_GITHUB  = 'https://github.com/web83info/login-by-referer';
     
    5858        add_action( 'admin_menu', array( $this, 'load_textdomain' ) );
    5959
     60        // Load CSS and JS.
     61        add_action( 'wp_enqueue_scripts', array( $this, 'load_css_js' ) );
     62
    6063        // Auto login.
    6164        add_action( 'init', array( $this, 'auto_login' ) );
    6265
    63         // Subscriber go to dashboard.
    64         add_action( 'auth_redirect', array( $this, 'subscriber_no_dashboard' ) );
     66        // Auto login user can't go to dashboard.
     67        add_action( 'auth_redirect', array( $this, 'auto_login_user_no_dashboard' ) );
    6568
    6669        // Add logout button on admin bar.
     
    7578    public function load_textdomain() {
    7679        load_plugin_textdomain( self::PLUGIN_PREFIX );
     80    }
     81
     82    public function load_css_js() {
     83        // CSS.
     84        wp_enqueue_style(
     85            self::PLUGIN_PREFIX . '-css',
     86            plugins_url( 'assets/login-by-referer.min.css', dirname( __FILE__ ) ),
     87            array(),
     88            self::PLUGIN_VERSION
     89        );
    7790    }
    7891
     
    110123
    111124    /**
    112      * Subscriber go to dashboard.
     125     * Auto login user can't go to dashboard.
    113126     *
    114127     * @param int $user_id User ID.
    115128     * @return void
    116129     */
    117     public function subscriber_no_dashboard( $user_id ) {
     130    public function auto_login_user_no_dashboard( $user_id ) {
    118131        if ( $this->is_autologin_user() ) {
    119132            wp_safe_redirect( get_home_url() );
     
    147160            $nodes = $wp_admin_bar->get_nodes();
    148161            foreach ( $nodes as $node ) {
    149                 // 'top-secondary' is located on roght top.
     162                // 'top-secondary' is located on right top.
    150163                if ( ! $node->parent || 'top-secondary' === $node->parent ) {
    151164                    $wp_admin_bar->remove_menu( $node->id );
     
    155168            $wp_admin_bar->add_menu(
    156169                array(
    157                     'id'    => 'new-item-in-admin-bar',
     170                    'id'    => 'loginbyreferer-logout',
    158171                    'title' => __( 'Logout', 'login-by-referer' ),
    159172                    'href'  => wp_logout_url(),
  • login-by-referer/trunk/login-by-referer.php

    r3024843 r3025514  
    1212 * Plugin URI:
    1313 * Description:         This plugin allows a user to login by specific referer.
    14  * Version:             1.0.1
     14 * Version:             1.0.2
    1515 * Requires at least:   6.0
    16  * Tested up to:        6.4.1
     16 * Tested up to:        6.4.2
    1717 * Requires PHP:        7.4
    1818 * Author:              web83info <[email protected]>
  • login-by-referer/trunk/readme.txt

    r3024843 r3025514  
    44Tags: login, referer
    55Requires at least: 6.2
    6 Tested up to: 6.4.1
     6Tested up to: 6.4.2
    77Requires PHP: 7.4
    8 Stable tag: 1.0.1
     8Stable tag: 1.0.2
    99License: GPL v2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2121== Changelog ==
    2222
     23= 1.0.2 - 2024-01-23 =
     24* Add: Plugin original CSS.
     25* Tested up to: 6.4.2.
     26
    2327= 1.0.1 - 2024-01-15 =
    24 * Fix: Clarify lisense.
     28* Fix: Clarify license.
    2529
    2630= 1.0.0 - 2023-11-26 =
Note: See TracChangeset for help on using the changeset viewer.