Changeset 3042750
- Timestamp:
- 02/28/2024 05:46:49 PM (2 years ago)
- Location:
- osom-modal-login
- Files:
-
- 22 added
- 2 edited
-
tags/1.4.1 (added)
-
tags/1.4.1/LICENSE (added)
-
tags/1.4.1/README.txt (added)
-
tags/1.4.1/assets (added)
-
tags/1.4.1/assets/css (added)
-
tags/1.4.1/assets/css/admin-osom-modal-login.css (added)
-
tags/1.4.1/assets/css/osom-modal-login.css (added)
-
tags/1.4.1/assets/img (added)
-
tags/1.4.1/assets/img/close.svg (added)
-
tags/1.4.1/assets/img/icon.png (added)
-
tags/1.4.1/assets/img/info.png (added)
-
tags/1.4.1/assets/js (added)
-
tags/1.4.1/assets/js/osom-modal-login.js (added)
-
tags/1.4.1/inc (added)
-
tags/1.4.1/inc/osom-admin.php (added)
-
tags/1.4.1/index.php (added)
-
tags/1.4.1/languages (added)
-
tags/1.4.1/languages/osom-ml-es_ES.mo (added)
-
tags/1.4.1/languages/osom-ml-es_ES.po (added)
-
tags/1.4.1/languages/osom-ml.pot (added)
-
tags/1.4.1/osom-modal-login.php (added)
-
tags/1.4.1/uninstall.php (added)
-
trunk/README.txt (modified) (3 diffs)
-
trunk/osom-modal-login.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
osom-modal-login/trunk/README.txt
r3041924 r3042750 5 5 Requires at least: 5.0 6 6 Tested up to: 6.4 7 Stable tag: 1.4 7 Stable tag: 1.4.1 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 60 60 = Dev Features = 61 61 * 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.63 62 64 63 == Installation == … … 120 119 == Changelog == 121 120 121 = 1.4.1 = 122 * Revert conditional loading of styles and scripts due to some issues on edge cases. 122 123 = 1.4 = 123 124 * 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 6 6 * Plugin URI: https://osompress.com 7 7 * 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 9 9 * Author: OsomPress 10 10 * Author URI: https://osompress.com … … 27 27 } 28 28 29 define( 'OSOM_ML_VERSION', '1.4 ' );29 define( 'OSOM_ML_VERSION', '1.4.1' ); 30 30 31 31 add_action( 'init', __NAMESPACE__ . '\osom_ml_init' ); … … 51 51 } 52 52 53 // Registerfrontend styles54 add_action( ' init', __NAMESPACE__ . '\register_block_style' );55 function register_block_style() {53 // Enqueue frontend styles 54 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\osom_ml_styles' ); 55 function osom_ml_styles() { 56 56 $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 61 62 add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\osom_ml_scripts' ); 62 63 function osom_ml_scripts() { 63 64 $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 77 67 } 78 68 … … 150 140 } 151 141 152 if ( ! is_user_logged_in() ):142 if ( ! is_user_logged_in() ) : 153 143 154 144 $args = array(
Note: See TracChangeset
for help on using the changeset viewer.