Plugin Directory

Changeset 3105954


Ignore:
Timestamp:
06/22/2024 08:40:40 AM (21 months ago)
Author:
stockpack
Message:

Removed templates from pages where it was not needed

Location:
stockpack/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stockpack/trunk/readme.txt

    r3104086 r3105954  
    44Requires at least: 4.6
    55Tested up to: 6.5.4
    6 Stable tag: 3.4.0
     6Stable tag: 3.4.1
    77License: GPL
    88License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    134134== Changelog ==
    135135
     136= 3.4.1 =
     137Removed loading templates on pages that did not use them
     138
    136139= 3.4.0 =
    137140Removed enqueue of scripts and styles from admin pages that do not load the media scripts
  • stockpack/trunk/src/class-stockpackadmin.php

    r3100134 r3105954  
    7979        $this->settings_api = new WeDevs_Settings_API();
    8080        // remove settings scripts as we do not use the color picker
    81         remove_action('admin_enqueue_scripts', array($this->settings_api, 'admin_enqueue_scripts'));
     81        if(!(isset($_GET['page']) && $_GET['page'] === 'stockpack')) {
     82            remove_action('admin_enqueue_scripts', array($this->settings_api, 'admin_enqueue_scripts'));
     83        }
    8284
    8385        //set sections and fields
  • stockpack/trunk/src/class-stockpackmedia.php

    r3104086 r3105954  
    228228         */
    229229        public function templates() {
    230             include_once( __DIR__ . '/../templates/attachment.php' );
    231             include_once( __DIR__ . '/../templates/empty.php' );
    232             include_once( __DIR__ . '/../templates/details.php' );
    233             include_once( __DIR__ . '/../templates/downloader.php' );
    234             include_once( __DIR__ . '/../templates/dialog.php' );
    235             include_once( __DIR__ . '/../templates/attribution.php' );
    236             include_once( __DIR__ . '/../templates/no-search.php' );
     230
     231            if (!did_action('wp_enqueue_media') || (isset($_GET['page']) && $_GET['page'] === 'stockpack')) {
     232                return;
     233            }
     234
     235            include_once(__DIR__ . '/../templates/attachment.php');
     236            include_once(__DIR__ . '/../templates/empty.php');
     237            include_once(__DIR__ . '/../templates/details.php');
     238            include_once(__DIR__ . '/../templates/downloader.php');
     239            include_once(__DIR__ . '/../templates/dialog.php');
     240            include_once(__DIR__ . '/../templates/attribution.php');
     241            include_once(__DIR__ . '/../templates/no-search.php');
     242
    237243        }
    238244
Note: See TracChangeset for help on using the changeset viewer.