Newpost Catch - Version 1.2.7

Version Description

  • The css reading order adjustment.
Download this release

Release Info

Developer s56bouya
Plugin Icon wp plugin Newpost Catch
Version 1.2.7
Comparing to
See all releases

Code changes from version 1.2.6 to 1.2.7

Files changed (3) hide show
  1. class.php +11 -10
  2. newpost-catch.php +2 -2
  3. readme.txt +4 -1
class.php CHANGED
@@ -5,7 +5,7 @@
5
  if ( !class_exists('NewpostCatch') ) {
6
  class NewpostCatch extends WP_Widget {
7
  /*** variables ***/
8
- var $version = "1.2.6";
9
  var $pluginDir = "";
10
 
11
  /*** structure ***/
@@ -26,10 +26,10 @@ if ( !class_exists('NewpostCatch') ) {
26
  $this->charset = get_bloginfo('charset');
27
 
28
  /** print stylesheet **/
29
- add_action( 'wp_head', array(&$this, 'NewpostCatch_print_stylesheet') );
30
 
31
  /** activate textdomain for translations **/
32
- add_action( 'init', array(&$this, 'NewpostCatch_textdomain') );
33
  }
34
 
35
  /** plugin localization **/
@@ -37,8 +37,8 @@ if ( !class_exists('NewpostCatch') ) {
37
  load_plugin_textdomain ( 'newpost-catch', false, basename( rtrim(dirname(__FILE__), '/') ) . '/languages' );
38
  }
39
 
40
- /** plugin insert header stylesheet **/
41
- function NewpostCatch_print_stylesheet() {
42
  if( get_option( 'widget_newpostcatch' ) ){
43
  $options = array_filter( get_option( 'widget_newpostcatch' ) );
44
  unset( $options['_multiwidget'] );
@@ -46,13 +46,14 @@ if ( !class_exists('NewpostCatch') ) {
46
  $options[$key] = $val['css']['active'];
47
  }
48
  if( in_array('on' , $options) ){
49
- $css_path = plugin_dir_url( __FILE__ ) . 'style.css';
50
  } else {
51
- $css_path = ( @file_exists(STYLESHEETPATH.'/css/newpost-catch.css') ) ? get_stylesheet_directory_uri().'/css/newpost-catch.css' : "" ;
52
- }
53
- if( $css_path ){
54
- echo "\n"."<!-- Newpost Catch ver".$this->version." -->"."\n".'<link rel="stylesheet" href="' . $css_path . '" type="text/css" media="screen" />'."\n"."<!-- End Newpost Catch ver".$this->version." -->"."\n";
55
  }
 
 
 
 
56
  }
57
  }
58
 
5
  if ( !class_exists('NewpostCatch') ) {
6
  class NewpostCatch extends WP_Widget {
7
  /*** variables ***/
8
+ var $version = "1.2.7";
9
  var $pluginDir = "";
10
 
11
  /*** structure ***/
26
  $this->charset = get_bloginfo('charset');
27
 
28
  /** print stylesheet **/
29
+ add_action( 'get_header', array( &$this, 'enqueue_stylesheet' ) );
30
 
31
  /** activate textdomain for translations **/
32
+ add_action( 'init', array( &$this, 'NewpostCatch_textdomain') );
33
  }
34
 
35
  /** plugin localization **/
37
  load_plugin_textdomain ( 'newpost-catch', false, basename( rtrim(dirname(__FILE__), '/') ) . '/languages' );
38
  }
39
 
40
+ /** plugin enqueue_stylesheet **/
41
+ function enqueue_stylesheet() {
42
  if( get_option( 'widget_newpostcatch' ) ){
43
  $options = array_filter( get_option( 'widget_newpostcatch' ) );
44
  unset( $options['_multiwidget'] );
46
  $options[$key] = $val['css']['active'];
47
  }
48
  if( in_array('on' , $options) ){
49
+ $css_path = plugins_url('newpost-catch/style.css');
50
  } else {
51
+ $css_path = ( @file_exists(STYLESHEETPATH.'/css/newpost-catch.css') ) ? get_stylesheet_directory_uri() . '/css/newpost-catch.css' : "" ;
 
 
 
52
  }
53
+
54
+ // register CSS
55
+ wp_register_style( 'newpost-catch', $css_path, array(), $this->version );
56
+ wp_enqueue_style( 'newpost-catch' );
57
  }
58
  }
59
 
newpost-catch.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Newpost Catch
4
  Plugin URI: http://www.imamura.biz/blog/newpost-catch/
5
  Description: Thumbnails in new articles setting widget.
6
- Version: 1.2.6
7
  Author: Tetsuya Imamura
8
  Text Domain: newpost-catch
9
  Author URI: http://www.imamura.biz/blog/
@@ -32,7 +32,7 @@ function npc_options_page() {
32
  require('npc_admin.php');
33
  }
34
 
35
- /* Copyright 2012-2014 Tetsuya Imamura (@s56bouya)
36
 
37
  This program is free software; you can redistribute it and/or modify
38
  it under the terms of the GNU General Public License, version 2, as
3
  Plugin Name: Newpost Catch
4
  Plugin URI: http://www.imamura.biz/blog/newpost-catch/
5
  Description: Thumbnails in new articles setting widget.
6
+ Version: 1.2.7
7
  Author: Tetsuya Imamura
8
  Text Domain: newpost-catch
9
  Author URI: http://www.imamura.biz/blog/
32
  require('npc_admin.php');
33
  }
34
 
35
+ /* Copyright 2012-2015 Tetsuya Imamura (@s56bouya)
36
 
37
  This program is free software; you can redistribute it and/or modify
38
  it under the terms of the GNU General Public License, version 2, as
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.imamura.biz/blog/newpost-catch
4
  Tags: widget, plugin, posts, sidebar, image, images, thumb, thumbnail
5
  Requires at least: 3.3.1
6
  Tested up to: 4.1
7
- Stable tag: 1.2.6
8
 
9
  Thumbnails in new articles setting widget.
10
 
@@ -93,6 +93,9 @@ When the post other than, post_type of the current page is the value of the prio
93
 
94
  == Changelog ==
95
 
 
 
 
96
  = 1.2.6 =
97
  * Compatibility check with WP 4.1 and Twenty Fifteen Theme.
98
 
4
  Tags: widget, plugin, posts, sidebar, image, images, thumb, thumbnail
5
  Requires at least: 3.3.1
6
  Tested up to: 4.1
7
+ Stable tag: 1.2.7
8
 
9
  Thumbnails in new articles setting widget.
10
 
93
 
94
  == Changelog ==
95
 
96
+ = 1.2.7 =
97
+ * The css reading order adjustment.
98
+
99
  = 1.2.6 =
100
  * Compatibility check with WP 4.1 and Twenty Fifteen Theme.
101