Plugin Directory

Changeset 3033821


Ignore:
Timestamp:
02/09/2024 09:35:14 PM (2 years ago)
Author:
ginoplusio
Message:

fixed wrong plugin version in css number

Location:
bright-link-previews/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bright-link-previews/trunk/index.php

    r3033812 r3033821  
    44Plugin URI: http://www.barattalo.it/
    55Description: Show previews of links (clear, neat, simple), analyze links and track user behaviour on the links of your site
    6 Version: 1.8
     6Version: 1.81
    77Author: Giulio Pons
    88*/
     
    7272}
    7373
     74function blpwp_get_plugin_version() {
     75    // this plugin version
     76    preg_match_all('/Version:(.*)$/m', file_get_contents( __FILE__ ), $matches );
     77    return $matches[1][0]; 
     78}
     79
    7480
    7581function blpwp_scripts(){
     
    8894        );
    8995
    90         // this plugin data
    91         $data = get_plugin_data(__FILE__, true);
    92 
    93         wp_register_script('blpwp_script_js',plugin_dir_url( __FILE__ ).'script.js',array('jquery'),$data["Version"],true);
     96        // this plugin version
     97        $ver = blpwp_get_plugin_version();
     98
     99        wp_register_script('blpwp_script_js',plugin_dir_url( __FILE__ ).'script.js',array('jquery'),$ver,true);
    94100        wp_enqueue_script('blpwp_script_js');
    95101
    96         wp_register_style( 'blpwp_css', plugin_dir_url( __FILE__ ).'style.css', [],  $data["Version"]);
     102        wp_register_style( 'blpwp_css', plugin_dir_url( __FILE__ ).'style.css', [],  $ver);
    97103        wp_enqueue_style( 'blpwp_css' );
    98104
     
    195201    // admin scripts should be loaded only where they are useful:
    196202
    197     // this plugin data
    198     $data = get_plugin_data(__FILE__, true);
    199    
    200     wp_register_script('blpwp_script_js',plugin_dir_url( __FILE__ ).'admin.js',array('jquery'),$data["Version"],true);
    201     wp_enqueue_style( 'blpwp_css', plugin_dir_url( __FILE__ ).'style.css', [], $data["Version"] );
    202     wp_enqueue_style( 'blpwp_admin_css', plugin_dir_url( __FILE__ ).'admin.css', [], $data["Version"] );
     203    // this plugin version
     204    $ver = blpwp_get_plugin_version();
     205   
     206    wp_register_script('blpwp_script_js',plugin_dir_url( __FILE__ ).'admin.js',array('jquery'),$ver,true);
     207    wp_enqueue_style( 'blpwp_css', plugin_dir_url( __FILE__ ).'style.css', [], $ver );
     208    wp_enqueue_style( 'blpwp_admin_css', plugin_dir_url( __FILE__ ).'admin.css', [], $ver );
    203209    wp_enqueue_script('blpwp_script_js');
    204210
  • bright-link-previews/trunk/readme.txt

    r3033815 r3033821  
    55Requires at least: 6.1
    66Tested up to: 6.4
    7 Stable tag: 1.8
     7Stable tag: 1.81
    88Requires PHP: 7.0
    99License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.