Plugin Directory

Changeset 1063465


Ignore:
Timestamp:
01/08/2015 10:20:09 PM (11 years ago)
Author:
hidaka.bizplugin
Message:

1.11.0

Location:
whats-new-genarator/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • whats-new-genarator/trunk/admin-ui.php

    r851866 r1063465  
    3434    }
    3535
     36    private function is_color( $code ) {
     37        if( preg_match('/^#[a-f0-9]{6}$/i', $code ) ){
     38            return true;
     39        }
     40        return false;
     41    }
     42
    3643    function validate($input) {
    37         if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_font_color'])){
    38             $input['wng_font_color'] = "#000";
     44        $this->is_color( $input['wng_font_color'] ) or $input['wng_font_color'] = "#000";
     45        $this->is_color( $input['wng_background_color'] ) or $input['wng_background_color'] = "#f1f5f5";
     46        if ( !is_numeric( $input['wng_number']) || $input['wng_number'] < 1 || $input['wng_number'] > 30){
     47            $input['wng_number'] = 10;
    3948        }
    40         if(!preg_match('/^#[a-f0-9]{6}$/i', $input['wng_background_color'])){
    41             $input['wng_background_color'] = "#f5f5f5";
    42         }
    43         if ( !is_numeric( $input['wng_newmark']) || $input['wng_newmark'] < 0){
     49        if ( !is_numeric( $input['wng_newmark']) || $input['wng_newmark'] < 0 || $input['wng_newmark'] > 30){
    4450            $input['wng_newmark'] = 0;
    45         }
    46         if ($input['wng_newmark'] > 30 ){
    47             $input['wng_newmark'] = 30;
    4851        }
    4952        $input['wng_title'] = esc_html( $input['wng_title'] );
     
    101104    function  setting_number() {
    102105        $options = WNG::get_option();
    103         $items = array("3", "5", "7","10", "15", "20");
    104         echo "<select id='wng_number' name='whats_new_options[wng_number]'>";
    105         foreach($items as $item) {
    106             $selected = ($options['wng_number']==$item) ? 'selected="selected"' : '';
    107             echo "<option value='$item' $selected>$item</option>";
    108         }
    109         echo "</select>";
     106        $value = $options["wng_number"];
     107        echo "<input id='wng_number' name='whats_new_options[wng_number]' size='2' type='text' value='{$value}' />個";
    110108    }
    111109
  • whats-new-genarator/trunk/readme.txt

    r851866 r1063465  
    44Tags: what's new, update Post page
    55Requires at least: 3.5
    6 Tested up to: 3.8.1
    7 Stable tag: 1.10.0
     6Tested up to: 4.1
     7Stable tag: 1.11.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3939
    4040== Changelog ==
     41
     42= 1.11.0 =
     43* 最新記事の件数を1-30まで設定できるようにしました
    4144
    4245= 1.10.0 =
  • whats-new-genarator/trunk/whats-new-generator.php

    r851866 r1063465  
    44Plugin URI: http://residentbird.main.jp/bizplugin/
    55Description: What's New(新着情報)を指定した固定ページや投稿に自動的に表示するプラグインです。
    6 Version: 1.10.0
    7 Author:WordPress Biz Plugin
     6Version: 1.11.0
     7Author:Hideki Tanaka
    88Author URI: http://residentbird.main.jp/bizplugin/
    99*/
     
    1414class WNG
    1515{
    16     const VERSION = "1.10.0";
     16    const VERSION = "1.11.0";
    1717    const SHORTCODE = "showwhatsnew";
    1818    const OPTIONS = "whats_new_options";
     
    5252        add_action( 'admin_init', array(&$this,'on_admin_init') );
    5353        add_action( 'admin_menu', array(&$this, 'on_admin_menu'));
    54         add_action( 'wp_enqueue_scripts', array(&$this,'on_enqueue_scripts'));
     54        add_action( 'wp_enqueue_scripts', array(&$this,'on_enqueue_css_js'));
    5555        add_shortcode( WNG::SHORTCODE, array(&$this,'show_shortcode'));
    5656        add_filter( 'widget_text', 'do_shortcode');
     
    8787    }
    8888
    89     function on_enqueue_scripts() {
     89    function on_enqueue_css_js() {
    9090        if ( is_admin() ){
    9191            return;
     
    123123        $this->background_color = isset($options['wng_background_color']) ? $options['wng_background_color'] : "#f5f5f5";
    124124        $this->font_color = isset($options['wng_font_color']) ? $options['wng_font_color'] : "#000000";
    125         $this->postlist_url = $options['wng_postlist_url'];
     125        $this->postlist_url = esc_url( $options['wng_postlist_url'] );
    126126
    127127        $condition = array();
  • whats-new-genarator/trunk/whats-new.css

    r851866 r1063465  
    3434  float: left;
    3535  overflow: hidden;
     36  width: auto;
    3637}
    3738div.wn-head .wn-postlist {
    3839  background: transparent url("./image/list.png") left center no-repeat;
    39   padding-left: 1.3em;
    4040  font-weight: normal;
    4141  font-size: 90%;
     
    4343  cursor: pointer;
    4444  float: right;
     45  width: 4em;
    4546}
    4647
     
    5657  border: 0;
    5758  float: left;
    58   width: 8.7em;
     59  width: 8.1em;
    5960  font-weight: normal;
    6061  overflow: hidden;
     62  white-space: nowrap;
    6163}
    6264div.wn-item .wn-article {
    63   margin: 0;
     65  margin: 0 0 0 8.1em;
    6466  padding: 0 2px;
    6567  overflow: hidden;
Note: See TracChangeset for help on using the changeset viewer.