Plugin Directory

Changeset 2822895


Ignore:
Timestamp:
11/23/2022 01:23:39 PM (3 years ago)
Author:
jeffreyvr
Message:

Update to version 2.3.0 from GitHub

Location:
easy-liveblogs
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • easy-liveblogs/tags/2.3.0/easy-liveblogs.php

    r2797958 r2822895  
    44Plugin URI: https://vanrossum.dev
    55Description: Live blogging made easy with the Easy Liveblogs plugin from vanrossum.dev.
    6 Version: 2.2.0
     6Version: 2.3.0
    77Author: Jeffrey van Rossum
    88Author URI: https://www.vanrossum.dev
     
    2626        private $plugin_url;
    2727        private $plugin_name    = 'Easy Liveblogs';
    28         private $plugin_version = '2.2.0';
     28        private $plugin_version = '2.3.0';
    2929        private $text_domain    = 'easy-liveblogs';
    3030
     
    111111        }
    112112
     113        /**
     114         * Check if liveblog is active on page.
     115         *
     116         * @return boolean
     117         */
     118        public static function is_liveblog_detected() {
     119            global $post, $wp_query;
     120
     121            if ( is_singular() ) {
     122                $content = elb_maybe_add_liveblog( do_shortcode( $post->post_content ) );
     123
     124                return strpos( $content, 'elb-liveblog' ) !== false || strpos( $content, 'elb_liveblog' ) !== false;
     125            }
     126
     127            $posts = $wp_query->posts ?? [];
     128
     129            foreach ( $posts as $post ){
     130                $content = elb_maybe_add_liveblog( do_shortcode( $post->post_content ) );
     131
     132                if ( strpos( $content, 'elb-liveblog' ) !== false || strpos( $content, 'elb_liveblog' ) !== false) {
     133                    return true;
     134                }
     135            }
     136
     137            return false;
     138        }
     139
    113140        /**
    114141         * Enqueue and register JavaScript files here.
     
    118145                wp_register_script( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.min.js', array( 'jquery' ), '0.12.4' );
    119146                wp_register_script( 'elb-admin', $this->get_plugin_url() . 'assets/js/easy-liveblogs-admin.js', array( 'jquery', 'selectize' ), $this->get_plugin_version() );
    120             }
    121 
    122             if ( ! is_admin() ) {
     147
     148                return;
     149            }
     150
     151            if ( ! is_admin() && self::is_liveblog_detected() ) {
    123152                wp_register_script( 'elb', $this->get_plugin_url() . 'assets/js/easy-liveblogs.js', array( 'jquery' ), $this->get_plugin_version() );
    124153                wp_localize_script(
     
    136165
    137166                wp_enqueue_script( 'elb' );
     167
     168                return;
    138169            }
    139170        }
     
    143174         */
    144175        public function register_styles() {
    145 
    146176            if ( is_admin() ) {
    147 
    148177                wp_register_style( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.default.css', null, '0.12.4' );
    149178                wp_register_style( 'elb-admin', $this->get_plugin_url() . 'assets/css/easy-liveblogs-admin.css', null, $this->get_plugin_version() );
     
    151180                wp_enqueue_style( 'elb-admin' );
    152181
    153             } else {
    154 
     182                return;
     183            }
     184
     185            if ( !is_admin() && self::is_liveblog_detected() ) {
    155186                $theme = elb_get_theme();
    156187
     
    160191
    161192                wp_enqueue_style( 'elb-theme-' . $theme );
     193
     194                return;
    162195            }
    163196        }
  • easy-liveblogs/tags/2.3.0/readme.txt

    r2797958 r2822895  
    66Donate link: https://vanrossum.dev/donate
    77Requires at least: 4.4
    8 Tested up to: 6.0
    9 Stable Tag: 2.2.0
     8Tested up to: 6.1
     9Stable Tag: 2.3.0
    1010License: MIT
    1111
     
    3939
    4040= Unreleased =
     41
     42= 2.3.0, November 23th, 2022 =
     43* Only enqueue scripts when liveblog is active on page.
    4144
    4245= 2.2.0, October 12th, 2022 =
  • easy-liveblogs/trunk/easy-liveblogs.php

    r2797958 r2822895  
    44Plugin URI: https://vanrossum.dev
    55Description: Live blogging made easy with the Easy Liveblogs plugin from vanrossum.dev.
    6 Version: 2.2.0
     6Version: 2.3.0
    77Author: Jeffrey van Rossum
    88Author URI: https://www.vanrossum.dev
     
    2626        private $plugin_url;
    2727        private $plugin_name    = 'Easy Liveblogs';
    28         private $plugin_version = '2.2.0';
     28        private $plugin_version = '2.3.0';
    2929        private $text_domain    = 'easy-liveblogs';
    3030
     
    111111        }
    112112
     113        /**
     114         * Check if liveblog is active on page.
     115         *
     116         * @return boolean
     117         */
     118        public static function is_liveblog_detected() {
     119            global $post, $wp_query;
     120
     121            if ( is_singular() ) {
     122                $content = elb_maybe_add_liveblog( do_shortcode( $post->post_content ) );
     123
     124                return strpos( $content, 'elb-liveblog' ) !== false || strpos( $content, 'elb_liveblog' ) !== false;
     125            }
     126
     127            $posts = $wp_query->posts ?? [];
     128
     129            foreach ( $posts as $post ){
     130                $content = elb_maybe_add_liveblog( do_shortcode( $post->post_content ) );
     131
     132                if ( strpos( $content, 'elb-liveblog' ) !== false || strpos( $content, 'elb_liveblog' ) !== false) {
     133                    return true;
     134                }
     135            }
     136
     137            return false;
     138        }
     139
    113140        /**
    114141         * Enqueue and register JavaScript files here.
     
    118145                wp_register_script( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.min.js', array( 'jquery' ), '0.12.4' );
    119146                wp_register_script( 'elb-admin', $this->get_plugin_url() . 'assets/js/easy-liveblogs-admin.js', array( 'jquery', 'selectize' ), $this->get_plugin_version() );
    120             }
    121 
    122             if ( ! is_admin() ) {
     147
     148                return;
     149            }
     150
     151            if ( ! is_admin() && self::is_liveblog_detected() ) {
    123152                wp_register_script( 'elb', $this->get_plugin_url() . 'assets/js/easy-liveblogs.js', array( 'jquery' ), $this->get_plugin_version() );
    124153                wp_localize_script(
     
    136165
    137166                wp_enqueue_script( 'elb' );
     167
     168                return;
    138169            }
    139170        }
     
    143174         */
    144175        public function register_styles() {
    145 
    146176            if ( is_admin() ) {
    147 
    148177                wp_register_style( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.default.css', null, '0.12.4' );
    149178                wp_register_style( 'elb-admin', $this->get_plugin_url() . 'assets/css/easy-liveblogs-admin.css', null, $this->get_plugin_version() );
     
    151180                wp_enqueue_style( 'elb-admin' );
    152181
    153             } else {
    154 
     182                return;
     183            }
     184
     185            if ( !is_admin() && self::is_liveblog_detected() ) {
    155186                $theme = elb_get_theme();
    156187
     
    160191
    161192                wp_enqueue_style( 'elb-theme-' . $theme );
     193
     194                return;
    162195            }
    163196        }
  • easy-liveblogs/trunk/readme.txt

    r2797958 r2822895  
    66Donate link: https://vanrossum.dev/donate
    77Requires at least: 4.4
    8 Tested up to: 6.0
    9 Stable Tag: 2.2.0
     8Tested up to: 6.1
     9Stable Tag: 2.3.0
    1010License: MIT
    1111
     
    3939
    4040= Unreleased =
     41
     42= 2.3.0, November 23th, 2022 =
     43* Only enqueue scripts when liveblog is active on page.
    4144
    4245= 2.2.0, October 12th, 2022 =
Note: See TracChangeset for help on using the changeset viewer.