Plugin Directory

Changeset 3104086


Ignore:
Timestamp:
06/18/2024 12:44:25 PM (22 months ago)
Author:
stockpack
Message:

Removed enqueue of scripts and styles from admin pages that do not load the media scripts

Location:
stockpack/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stockpack/trunk/readme.txt

    r3100134 r3104086  
    44Requires at least: 4.6
    55Tested up to: 6.5.4
    6 Stable tag: 3.3.9
     6Stable tag: 3.4.0
    77License: GPL
    88License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    134134== Changelog ==
    135135
     136= 3.4.0 =
     137Removed enqueue of scripts and styles from admin pages that do not load the media scripts
     138
    136139= 3.3.9 =
    137140Removed extra loaded scripts and wp query from admin settings thanks to @mathieu discovering it here https://wordpress.org/support/topic/is-there-an-utility-for-admin_enqueue_scripts-in-class-settings-api-php/#post-17809387
  • stockpack/trunk/src/class-stockpackmedia.php

    r2815781 r3104086  
    6262         */
    6363        public function enqueue( $admin = true, $no_dialog = false ) {
    64             $this->enqueue_script( $admin );
    65             $this->enqueue_style( $no_dialog );
     64            global $pagenow;
     65            if(did_action('wp_enqueue_media') || (isset($_GET['page']) && $_GET['page'] === 'stockpack')) {
     66                $this->enqueue_scripts($admin);
     67                $this->enqueue_styles($no_dialog);
     68            }
    6669            $this->enqueue_settings( $admin );
    6770        }
    6871
    69         public function enqueue_script( $admin ) {
     72        public function enqueue_scripts( $admin ) {
    7073            $name = 'stockpack-load-admin.js';
    7174            $script = 'stockpack';
     
    110113        }
    111114
    112         public function enqueue_style( $no_dialog ) {
     115        public function enqueue_styles( $no_dialog ) {
    113116            global $wp_version;
    114117
  • stockpack/trunk/stockpack.php

    r3100134 r3104086  
    66 * Author: Derikon Development
    77 * Author URI: https://derikon.com/
    8  * Version: 3.3.9
     8 * Version: 3.4.0
    99 * Text Domain: stockpack
    1010 * Domain Path: /languages
     
    136136    function stockpack_register_plugin() {
    137137        $load_stockpack = true;
    138         if ( ! is_admin() ) {
     138        if ( ! is_admin()) {
    139139            $load_stockpack = false;
    140140        }
Note: See TracChangeset for help on using the changeset viewer.