WordPress.org

Plugin Directory

Changeset 1218082


Ignore:
Timestamp:
08/11/15 11:08:27 (2 years ago)
Author:
Access Keys
Message:
  • Done the asynchronous loading of the scripts from the plugin.
Location:
accesspress-pinterest
Files:
44 added
2 edited

Legend:

Unmodified
Added
Removed
  • accesspress-pinterest/trunk/accesspress-pinterest.php

    r1211765 r1218082  
    55Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-pinterest/ 
    66Description: A plugin to add various pinterest widgets and pins to a site with dynamic configuration options. 
    7 Version: 1.1.7 
     7Version: 1.1.8 
    88Author: AccessPress Themes 
    99Author URI: http://accesspressthemes.com 
     
    1515//Decleration of the necessary constants for plugin 
    1616if(!defined ( 'APSP_VERSION' ) ){ 
    17     define ( 'APSP_VERSION', '1.1.7' ); 
     17    define ( 'APSP_VERSION', '1.1.8' ); 
    1818} 
    1919 
     
    6868            add_action( 'admin_post_apsp_save_options', array($this, 'apsp_save_options') ); //save the options in the wordpress options table. 
    6969            add_action( 'admin_post_apsp_restore_default_settings', array($this, 'apsp_restore_default_settings') ); //restores default settings. 
     70            add_filter( 'clean_url', array($this, 'add_async')); //filter the scripts to add async attributes. 
    7071        } 
    7172 
     
    102103            wp_enqueue_style( 'apsp-font-opensans', 'http://fonts.googleapis.com/css?family=Open+Sans', array(), false ); 
    103104            wp_enqueue_style( 'apsp-frontend-css', APSP_CSS_DIR . '/frontend.css', '', APSP_VERSION ); 
    104             wp_enqueue_script( 'masionary-js', APSP_JS_DIR . '/jquery-masionary.js', array('jquery'), APSP_VERSION, true ); 
    105             wp_enqueue_script( 'frontend-js', APSP_JS_DIR . '/frontend.js', array( 'jquery','masionary-js' ), APSP_VERSION, true ); 
     105            wp_enqueue_script( 'masionary-js', APSP_JS_DIR . '/jquery-masionary.js#async', array('jquery'), APSP_VERSION, true ); 
     106            wp_enqueue_script( 'frontend-js', APSP_JS_DIR . '/frontend.js#async', array( 'jquery','masionary-js' ), APSP_VERSION, true ); 
    106107 
    107108            if($this->apsp_settings['js_enabled']=='on'){ 
     
    286287                } 
    287288        } 
     289 
     290        /* 
     291        * Function to add async loading of scripts 
     292        */ 
     293        function add_async ( $url ) { 
     294            if( strpos( $url, "#async" ) === false ) 
     295                return $url; 
     296            else if(is_admin()) 
     297                return str_replace("#async", "", $url); 
     298            else 
     299                return str_replace( "#async", "", "$url' async='async" ); 
     300        } 
     301 
    288302    } 
    289303 
  • accesspress-pinterest/trunk/readme.txt

    r1211765 r1218082  
    55Requires at least: 3.8 
    66Tested up to: 4.2 
    7 Stable tag: 1.1.7 
     7Stable tag: 1.1.8 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    104104 
    105105== Changelog == 
     106= 1.1.8 = 
     107* Done the asynchronous loading of the scripts from the plugin. 
     108 
    106109= 1.1.7 = 
    107110* Done the code fixing for the fetching of the latest pins for board widgets. 
Note: See TracChangeset for help on using the changeset viewer.