Plugin Directory

Changeset 3042750


Ignore:
Timestamp:
02/28/2024 05:46:49 PM (2 years ago)
Author:
osompress
Message:

update to 1.4.1

Location:
osom-modal-login
Files:
22 added
2 edited

Legend:

Unmodified
Added
Removed
  • osom-modal-login/trunk/README.txt

    r3041924 r3042750  
    55Requires at least: 5.0
    66Tested up to: 6.4
    7 Stable tag: 1.4
     7Stable tag: 1.4.1
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    6060= Dev Features =
    6161* The plugin uses Vanilla JavaScript so you can use it even if you dequeue WordPress jQuery. It's always nice to keep the dependencies to the minimum.
    62 * Conditional asset loading. In block themes, the plugin only loads the script and the css styles if the login/out block it's present.
    6362
    6463== Installation ==
     
    120119== Changelog ==
    121120
     121= 1.4.1 =
     122* Revert conditional loading of styles and scripts due to some issues on edge cases.
    122123= 1.4 =
    123124* Improve conditional loading of styles and scripts. On block themes it will only load the style and script files if the login/out block is present.
  • osom-modal-login/trunk/osom-modal-login.php

    r3032806 r3042750  
    66 * Plugin URI:        https://osompress.com
    77 * Description:       Osom Modal Login lets you easily create a modal box displaying the WordPress login form. It automatically adds a menu item named "Login" at the end of the selected menu which will launch the login modal box one you click on it.
    8  * Version:           1.4
     8 * Version:           1.4.1
    99 * Author:            OsomPress
    1010 * Author URI:        https://osompress.com
     
    2727}
    2828
    29 define( 'OSOM_ML_VERSION', '1.4' );
     29define( 'OSOM_ML_VERSION', '1.4.1' );
    3030
    3131add_action( 'init', __NAMESPACE__ . '\osom_ml_init' );
     
    5151}
    5252
    53 // Register frontend styles
    54 add_action( 'init', __NAMESPACE__ . '\register_block_style' );
    55 function register_block_style() {
     53// Enqueue frontend styles
     54add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\osom_ml_styles' );
     55function osom_ml_styles() {
    5656    $plugin_url = plugin_dir_url( __FILE__ );
    57     wp_register_style( 'osom-ml-style', $plugin_url . '/assets/css/osom-modal-login.css', OSOM_ML_VERSION, true );
    58 }
    59 
    60 // Register frontend scripts
     57    wp_enqueue_style( 'osom-ml-style', $plugin_url . '/assets/css/osom-modal-login.css', OSOM_ML_VERSION, true );
     58    wp_enqueue_style( 'dashicons' );
     59}
     60
     61// Enqueue scripts
    6162add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\osom_ml_scripts' );
    6263function osom_ml_scripts() {
    6364    $plugin_url = plugin_dir_url( __FILE__ );
    64     wp_register_script( 'osom-ml-script', $plugin_url . '/assets/js/osom-modal-login.js', '', OSOM_ML_VERSION, true );
    65 }
    66 
    67 // Enqueue frontend styles and scripts only when it's necessary
    68 add_filter( 'render_block', __NAMESPACE__ . '\enqueue_block_style', 10, 2 );
    69 function enqueue_block_style( $block_content, $block ) {
    70     $theme_type = wp_is_block_theme();
    71 
    72     if ( false === $theme_type || true === $theme_type && 'core/loginout' === $block['blockName'] ) {
    73         wp_enqueue_style( 'osom-ml-style' );
    74         wp_enqueue_script( 'osom-ml-script' );
    75     }
    76     return $block_content;
     65    wp_enqueue_script( 'osom-ml-script', $plugin_url . '/assets/js/osom-modal-login.js', '', OSOM_ML_VERSION, true );
     66
    7767}
    7868
     
    150140    }
    151141
    152     if ( !is_user_logged_in() ):
     142    if ( ! is_user_logged_in() ) :
    153143
    154144        $args = array(
Note: See TracChangeset for help on using the changeset viewer.