Changeset 3212348
- Timestamp:
- 12/24/2024 01:07:44 AM (15 months ago)
- Location:
- wp-sns-share-buttons/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-sns-share-buttons.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-sns-share-buttons/trunk/readme.txt
r1865282 r3212348 3 3 Donate link: 4 4 Tags: shortcode, quote, quotation, blockquote 5 Requires at least: 4.06 Tested up to: 4.9.57 Stable tag: 0.1. 85 Requires at least: 6.0 6 Tested up to: 6.7.1 7 Stable tag: 0.1.9 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 == Screenshots == 48 48 49 1. Share Buttons Sample. 50 2. Follow Buttons Sample. 49 1. Quotation sample. 51 50 52 51 == Changelog == 53 52 54 = 0.1. 8=53 = 0.1.9 = 55 54 56 55 * Bug Fix. -
wp-sns-share-buttons/trunk/wp-sns-share-buttons.php
r1865282 r3212348 4 4 Plugin URI: http://e-joint.jp/works/wp-sns-share-buttons/ 5 5 Description: A WordPress plugin that makes SNS Share and Follow Buttons easily. 6 Version: 0.1. 86 Version: 0.1.9 7 7 Author: e-JOINT.jp 8 8 Author URI: http://e-joint.jp … … 44 44 ); 45 45 46 public function __construct() {46 public function __construct() { 47 47 48 48 $this->set_datas(); … … 94 94 <?php 95 95 global $parent_file; 96 if ($parent_file != 'options-general.php') {96 if ($parent_file != 'options-general.php') { 97 97 require(ABSPATH . 'wp-admin/options-head.php'); 98 98 } … … 100 100 101 101 <form method="post" action="options.php"> 102 <?php102 <?php 103 103 settings_fields('wpssb-setting'); 104 104 do_settings_sections('wpssb-setting'); 105 105 submit_button(); 106 ?>106 ?> 107 107 </form> 108 108 … … 113 113 114 114 // 設定画面の初期化 115 public function page_init() {115 public function page_init() { 116 116 register_setting('wpssb-setting', 'wpssb-setting'); 117 117 add_settings_section('wpssb-setting-section-id', '', '', 'wpssb-setting'); … … 303 303 public function twitter_via_callback() { 304 304 $value = isset($this->options['twitter-via']) ? esc_html($this->options['twitter-via']) : ''; 305 ?><input type="text" class="" name="wpssb-setting[twitter-via]" value="<?php echo $value; ?>">305 ?><input type="text" class="" name="wpssb-setting[twitter-via]" value="<?php echo $value; ?>"> 306 306 <small><?php echo __('Enter Twitter account ID without"@"', $this->textdomain); ?></small><br> 307 <?php307 <?php 308 308 } 309 309 310 310 public function facebook_segment_callback() { 311 311 $value = isset($this->options['facebook-segment']) ? esc_html($this->options['facebook-segment']) : ''; 312 ?><input type="text" class="" name="wpssb-setting[facebook-segment]" value="<?php echo $value; ?>">312 ?><input type="text" class="" name="wpssb-setting[facebook-segment]" value="<?php echo $value; ?>"> 313 313 <small><?php echo __('Enter Facebook URL, after "https://www.facebook.com/".', $this->textdomain); ?></small><br> 314 <?php314 <?php 315 315 } 316 316 … … 320 320 $html = '<select name="wpssb-setting[follow-feedly]">'; 321 321 322 foreach ($feeds as $feed) {322 foreach ($feeds as $feed) { 323 323 $html .= sprintf('<option value="%s"%s>%s</option>', $feed, selected($this->options['follow-feedly'], $feed, false), get_bloginfo($feed)); 324 324 } … … 357 357 public function nocss_callback() { 358 358 $checked = isset($this->options['nocss']) ? checked($this->options['nocss'], 1, false) : ''; 359 ?><input type="checkbox" id="nocss" name="wpssb-setting[nocss]" value="1"<?php echo $checked; ?>><?php 359 ?><input type="checkbox" id="nocss" name="wpssb-setting[nocss]" value="1" <?php echo $checked; ?>> 360 <?php 360 361 } 361 362 362 363 // スタイルシートの追加 364 // public function add_styles() { 365 // if(!$this->options['nocss']) { 366 // wp_enqueue_style('wpssb', plugins_url('assets/css/wp-sns-share-buttons.css', __FILE__), array(), $this->version, 'all'); 367 // } 368 // } 363 369 public function add_styles() { 364 if(!$this->options['nocss']) { 365 wp_enqueue_style('wpssb', plugins_url('assets/css/wp-sns-share-buttons.css', __FILE__), array(), $this->version, 'all'); 370 // nocssオプションが未設定またはfalseの場合のみ実行 371 if (empty($this->options['nocss'])) { 372 $style_path = plugins_url('assets/css/wp-sns-share-buttons.css', __FILE__); 373 374 // スタイルファイルが存在する場合のみ読み込む 375 if (file_exists(plugin_dir_path(__FILE__) . 'assets/css/wp-sns-share-buttons.css')) { 376 wp_enqueue_style( 377 'wpssb', // ハンドル名 378 $style_path, // スタイルシートのURL 379 array(), // 依存関係(なし) 380 $this->version, // バージョン 381 'all' // 適用範囲 382 ); 383 } 366 384 } 367 385 } 386 387 368 388 369 389 public function the_content($content) { … … 372 392 $buttons = $buttons->show_all(); 373 393 374 if ($this->options['auto'] === '1') {394 if ($this->options['auto'] === '1') { 375 395 return $buttons . $content; 376 377 } else if($this->options['auto'] === '2') { 396 } else if ($this->options['auto'] === '2') { 378 397 return $content; 379 380 398 } else { 381 399 return $content . $buttons; … … 388 406 function wp_sns_share_buttons() { 389 407 $name = 'wpssb-template.php'; 390 $custom = get_stylesheet_directory() . '/' . $name ;408 $custom = get_stylesheet_directory() . '/' . $name; 391 409 $default = 'template/' . $name; 392 410 393 if (file_exists($custom)) {411 if (file_exists($custom)) { 394 412 include $custom; 395 413 } else {
Note: See TracChangeset
for help on using the changeset viewer.