| 1 |
<?php |
| 2 |
/** |
| 3 |
* Simple Ticker |
| 4 |
* |
| 5 |
* @package SimpleTicker |
| 6 |
* @subpackage SimpleTicker registered in the database |
| 7 |
Copyright (c) 2016- Katsushi Kawamori (email : dodesyoswift312@gmail.com) |
| 8 |
This program is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; version 2 of the License. |
| 11 |
|
| 12 |
This program is distributed in the hope that it will be useful, |
| 13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
GNU General Public License for more details. |
| 16 |
|
| 17 |
You should have received a copy of the GNU General Public License |
| 18 |
along with this program; if not, write to the Free Software |
| 19 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 |
*/ |
| 21 |
|
| 22 |
$simpletickerregist = new SimpleTickerRegist(); |
| 23 |
|
| 24 |
class SimpleTickerRegist { |
| 25 |
|
| 26 |
/* ================================================== |
| 27 |
* Construct |
| 28 |
* @since 1.06 |
| 29 |
*/ |
| 30 |
public function __construct() { |
| 31 |
|
| 32 |
add_action('admin_init', array($this, 'register_settings')); |
| 33 |
|
| 34 |
} |
| 35 |
|
| 36 |
/* ================================================== |
| 37 |
* Settings register |
| 38 |
* @since 1.0 |
| 39 |
*/ |
| 40 |
public function register_settings(){ |
| 41 |
|
| 42 |
if ( !get_option('simple_ticker') ) { |
| 43 |
$simple_ticker_tbl = array( |
| 44 |
'ticker1' => array( |
| 45 |
'text' => '', |
| 46 |
'color' => '#ff0000' |
| 47 |
), |
| 48 |
'ticker2' => array( |
| 49 |
'text' => '', |
| 50 |
'color' => '#ffff00' |
| 51 |
), |
| 52 |
'ticker3' => array( |
| 53 |
'text' => '', |
| 54 |
'color' => '#008000' |
| 55 |
), |
| 56 |
'sticky_posts' => array( |
| 57 |
'display' => TRUE, |
| 58 |
'title_color' => '#ff0000', |
| 59 |
'content_color' => '#000000' |
| 60 |
) |
| 61 |
); |
| 62 |
update_option( 'simple_ticker', $simple_ticker_tbl ); |
| 63 |
} |
| 64 |
|
| 65 |
} |
| 66 |
|
| 67 |
} |
| 68 |
|
| 69 |
?> |