Changeset 2822895
- Timestamp:
- 11/23/2022 01:23:39 PM (3 years ago)
- Location:
- easy-liveblogs
- Files:
-
- 4 edited
- 1 copied
-
tags/2.3.0 (copied) (copied from easy-liveblogs/trunk)
-
tags/2.3.0/easy-liveblogs.php (modified) (8 diffs)
-
tags/2.3.0/readme.txt (modified) (2 diffs)
-
trunk/easy-liveblogs.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
easy-liveblogs/tags/2.3.0/easy-liveblogs.php
r2797958 r2822895 4 4 Plugin URI: https://vanrossum.dev 5 5 Description: Live blogging made easy with the Easy Liveblogs plugin from vanrossum.dev. 6 Version: 2. 2.06 Version: 2.3.0 7 7 Author: Jeffrey van Rossum 8 8 Author URI: https://www.vanrossum.dev … … 26 26 private $plugin_url; 27 27 private $plugin_name = 'Easy Liveblogs'; 28 private $plugin_version = '2. 2.0';28 private $plugin_version = '2.3.0'; 29 29 private $text_domain = 'easy-liveblogs'; 30 30 … … 111 111 } 112 112 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 113 140 /** 114 141 * Enqueue and register JavaScript files here. … … 118 145 wp_register_script( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.min.js', array( 'jquery' ), '0.12.4' ); 119 146 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() ) { 123 152 wp_register_script( 'elb', $this->get_plugin_url() . 'assets/js/easy-liveblogs.js', array( 'jquery' ), $this->get_plugin_version() ); 124 153 wp_localize_script( … … 136 165 137 166 wp_enqueue_script( 'elb' ); 167 168 return; 138 169 } 139 170 } … … 143 174 */ 144 175 public function register_styles() { 145 146 176 if ( is_admin() ) { 147 148 177 wp_register_style( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.default.css', null, '0.12.4' ); 149 178 wp_register_style( 'elb-admin', $this->get_plugin_url() . 'assets/css/easy-liveblogs-admin.css', null, $this->get_plugin_version() ); … … 151 180 wp_enqueue_style( 'elb-admin' ); 152 181 153 } else { 154 182 return; 183 } 184 185 if ( !is_admin() && self::is_liveblog_detected() ) { 155 186 $theme = elb_get_theme(); 156 187 … … 160 191 161 192 wp_enqueue_style( 'elb-theme-' . $theme ); 193 194 return; 162 195 } 163 196 } -
easy-liveblogs/tags/2.3.0/readme.txt
r2797958 r2822895 6 6 Donate link: https://vanrossum.dev/donate 7 7 Requires at least: 4.4 8 Tested up to: 6. 09 Stable Tag: 2. 2.08 Tested up to: 6.1 9 Stable Tag: 2.3.0 10 10 License: MIT 11 11 … … 39 39 40 40 = Unreleased = 41 42 = 2.3.0, November 23th, 2022 = 43 * Only enqueue scripts when liveblog is active on page. 41 44 42 45 = 2.2.0, October 12th, 2022 = -
easy-liveblogs/trunk/easy-liveblogs.php
r2797958 r2822895 4 4 Plugin URI: https://vanrossum.dev 5 5 Description: Live blogging made easy with the Easy Liveblogs plugin from vanrossum.dev. 6 Version: 2. 2.06 Version: 2.3.0 7 7 Author: Jeffrey van Rossum 8 8 Author URI: https://www.vanrossum.dev … … 26 26 private $plugin_url; 27 27 private $plugin_name = 'Easy Liveblogs'; 28 private $plugin_version = '2. 2.0';28 private $plugin_version = '2.3.0'; 29 29 private $text_domain = 'easy-liveblogs'; 30 30 … … 111 111 } 112 112 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 113 140 /** 114 141 * Enqueue and register JavaScript files here. … … 118 145 wp_register_script( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.min.js', array( 'jquery' ), '0.12.4' ); 119 146 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() ) { 123 152 wp_register_script( 'elb', $this->get_plugin_url() . 'assets/js/easy-liveblogs.js', array( 'jquery' ), $this->get_plugin_version() ); 124 153 wp_localize_script( … … 136 165 137 166 wp_enqueue_script( 'elb' ); 167 168 return; 138 169 } 139 170 } … … 143 174 */ 144 175 public function register_styles() { 145 146 176 if ( is_admin() ) { 147 148 177 wp_register_style( 'selectize', $this->get_plugin_url() . 'assets/selectize/selectize.default.css', null, '0.12.4' ); 149 178 wp_register_style( 'elb-admin', $this->get_plugin_url() . 'assets/css/easy-liveblogs-admin.css', null, $this->get_plugin_version() ); … … 151 180 wp_enqueue_style( 'elb-admin' ); 152 181 153 } else { 154 182 return; 183 } 184 185 if ( !is_admin() && self::is_liveblog_detected() ) { 155 186 $theme = elb_get_theme(); 156 187 … … 160 191 161 192 wp_enqueue_style( 'elb-theme-' . $theme ); 193 194 return; 162 195 } 163 196 } -
easy-liveblogs/trunk/readme.txt
r2797958 r2822895 6 6 Donate link: https://vanrossum.dev/donate 7 7 Requires at least: 4.4 8 Tested up to: 6. 09 Stable Tag: 2. 2.08 Tested up to: 6.1 9 Stable Tag: 2.3.0 10 10 License: MIT 11 11 … … 39 39 40 40 = Unreleased = 41 42 = 2.3.0, November 23th, 2022 = 43 * Only enqueue scripts when liveblog is active on page. 41 44 42 45 = 2.2.0, October 12th, 2022 =
Note: See TracChangeset
for help on using the changeset viewer.