Changeset 3470834
- Timestamp:
- 02/27/2026 05:06:56 AM (5 weeks ago)
- Location:
- syntax-highlight-nano
- Files:
-
- 6 edited
- 1 copied
-
tags/1.1.2 (copied) (copied from syntax-highlight-nano/trunk)
-
tags/1.1.2/includes/admin.php (modified) (10 diffs)
-
tags/1.1.2/readme.txt (modified) (2 diffs)
-
tags/1.1.2/syntax-highlight-nano.php (modified) (4 diffs)
-
trunk/includes/admin.php (modified) (10 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/syntax-highlight-nano.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
syntax-highlight-nano/tags/1.1.2/includes/admin.php
r3447159 r3470834 125 125 'synanoAdmin', 126 126 array( 127 'ajaxUrl' => admin_url( 'admin-ajax.php' ),128 'nonce' => wp_create_nonce( 'synano_reset_settings' ),129 'pluginUrl' => SYNANO_URL,130 'strings' => array(127 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 128 'nonce' => wp_create_nonce( 'synano_reset_settings' ), 129 'pluginUrl' => SYNANO_URL, 130 'strings' => array( 131 131 'confirmReset' => __( 'This will reset all settings to defaults. This action cannot be undone. Continue?', 'syntax-highlight-nano' ), 132 132 'resetSuccess' => __( 'Settings have been reset successfully.', 'syntax-highlight-nano' ), … … 145 145 public function admin_page() { 146 146 // 設定を取得 147 $options = get_option( 'synano_options', $this->get_default_options());147 $options = $this->get_options(); 148 148 ?> 149 149 <div class="wrap"> … … 195 195 */ 196 196 public function theme_field_callback() { 197 $options = get_option( 'synano_options', $this->get_default_options());197 $options = $this->get_options(); 198 198 $themes = $this->get_available_themes(); 199 199 … … 216 216 */ 217 217 public function language_field_callback() { 218 $options = get_option( 'synano_options', $this->get_default_options());218 $options = $this->get_options(); 219 219 $languages = $this->get_available_languages(); 220 220 … … 234 234 */ 235 235 public function show_header_field_callback() { 236 $options = get_option( 'synano_options', $this->get_default_options());236 $options = $this->get_options(); 237 237 $checked = checked( $options['default_show_header'], true, false ); 238 238 … … 248 248 */ 249 249 public function show_line_numbers_field_callback() { 250 $options = get_option( 'synano_options', $this->get_default_options());250 $options = $this->get_options(); 251 251 $checked = checked( $options['default_show_line_numbers'], true, false ); 252 252 … … 320 320 array( 321 321 'message' => __( 'Settings have been reset successfully.', 'syntax-highlight-nano' ), 322 'options' => $default_options,322 'options' => $default_options, 323 323 ) 324 324 ); … … 342 342 343 343 /** 344 * 現在の設定値を取得する(デフォルト値とマージ) 345 * 346 * @return array 設定値の配列 347 */ 348 public function get_options() { 349 $options = get_option( 'synano_options', array() ); 350 if ( ! is_array( $options ) ) { 351 $options = array(); 352 } 353 return wp_parse_args( $options, $this->get_default_options() ); 354 } 355 356 /** 344 357 * 利用可能なテーマのリストを取得する 345 358 * … … 360 373 // 精選されたテーマ(6個) 361 374 $themes = array( 362 'default' => 'Default',363 'github' => 'GitHub',364 'github-dark' => 'GitHub Dark',365 'monokai' => 'Monokai',366 'vs' => 'Visual Studio',375 'default' => 'Default', 376 'github' => 'GitHub', 377 'github-dark' => 'GitHub Dark', 378 'monokai' => 'Monokai', 379 'vs' => 'Visual Studio', 367 380 'atom-one-dark' => 'Atom One Dark', 368 381 ); … … 392 405 393 406 $languages = array( 394 'auto' => __( 'Auto Detect', 'syntax-highlight-nano' ),407 'auto' => __( 'Auto Detect', 'syntax-highlight-nano' ), 395 408 'applescript' => 'AppleScript', 396 'bash' => 'Bash',397 'c' => 'C',398 'cpp' => 'C++',399 'csharp' => 'C#',400 'css' => 'CSS',401 'go' => 'Go',402 'html' => 'HTML',403 'java' => 'Java',404 'javascript' => 'JavaScript',405 'json' => 'JSON',406 'jsx' => 'JSX',407 'kotlin' => 'Kotlin',408 'less' => 'Less',409 'markdown' => 'Markdown',410 'php' => 'PHP',411 'plaintext' => 'Plain Text',412 'powershell' => 'PowerShell',413 'python' => 'Python',414 'ruby' => 'Ruby',415 'rust' => 'Rust',416 'sass' => 'Sass',417 'scss' => 'SCSS',418 'shell' => 'Shell',419 'sql' => 'SQL',420 'swift' => 'Swift',421 'tsx' => 'TSX',422 'typescript' => 'TypeScript',423 'xml' => 'XML',424 'yaml' => 'YAML',409 'bash' => 'Bash', 410 'c' => 'C', 411 'cpp' => 'C++', 412 'csharp' => 'C#', 413 'css' => 'CSS', 414 'go' => 'Go', 415 'html' => 'HTML', 416 'java' => 'Java', 417 'javascript' => 'JavaScript', 418 'json' => 'JSON', 419 'jsx' => 'JSX', 420 'kotlin' => 'Kotlin', 421 'less' => 'Less', 422 'markdown' => 'Markdown', 423 'php' => 'PHP', 424 'plaintext' => 'Plain Text', 425 'powershell' => 'PowerShell', 426 'python' => 'Python', 427 'ruby' => 'Ruby', 428 'rust' => 'Rust', 429 'sass' => 'Sass', 430 'scss' => 'SCSS', 431 'shell' => 'Shell', 432 'sql' => 'SQL', 433 'swift' => 'Swift', 434 'tsx' => 'TSX', 435 'typescript' => 'TypeScript', 436 'xml' => 'XML', 437 'yaml' => 'YAML', 425 438 ); 426 439 -
syntax-highlight-nano/tags/1.1.2/readme.txt
r3447159 r3470834 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 70 70 == Changelog == 71 71 72 = 1.1.2 = 73 * Bug fix: Resolved 500 fatal error on code block save caused by undefined settings array keys in PHP 8.1+. 74 72 75 = 1.1.1 = 73 76 * Bug Fix. -
syntax-highlight-nano/tags/1.1.2/syntax-highlight-nano.php
r3447159 r3470834 4 4 * Plugin URI: https://wordpress.org/plugins/syntax-highlight-nano 5 5 * Description: Adds modern syntax highlighting to the core/code block with highlight.js 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Author: Takashi Fujisaki 8 8 * Author URI: https://yuiami.jp … … 152 152 153 153 // デフォルト設定をJavaScriptに渡す 154 $default_options = get_option( 'synano_options', $this->admin->get_default_options());154 $default_options = $this->admin->get_options(); 155 155 wp_localize_script( 156 156 'synano-editor', … … 221 221 222 222 // 設定されたテーマのCSSを読み込み(ローカルファイルを使用) 223 $default_options = get_option( 'synano_options', $this->admin->get_default_options());223 $default_options = $this->admin->get_options(); 224 224 $theme = $default_options['default_theme']; 225 225 … … 288 288 289 289 // デフォルト設定を取得 290 $default_options = get_option( 'synano_options', $this->admin->get_default_options());290 $default_options = $this->admin->get_options(); 291 291 292 292 // カスタム属性を取得 -
syntax-highlight-nano/trunk/includes/admin.php
r3447159 r3470834 125 125 'synanoAdmin', 126 126 array( 127 'ajaxUrl' => admin_url( 'admin-ajax.php' ),128 'nonce' => wp_create_nonce( 'synano_reset_settings' ),129 'pluginUrl' => SYNANO_URL,130 'strings' => array(127 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 128 'nonce' => wp_create_nonce( 'synano_reset_settings' ), 129 'pluginUrl' => SYNANO_URL, 130 'strings' => array( 131 131 'confirmReset' => __( 'This will reset all settings to defaults. This action cannot be undone. Continue?', 'syntax-highlight-nano' ), 132 132 'resetSuccess' => __( 'Settings have been reset successfully.', 'syntax-highlight-nano' ), … … 145 145 public function admin_page() { 146 146 // 設定を取得 147 $options = get_option( 'synano_options', $this->get_default_options());147 $options = $this->get_options(); 148 148 ?> 149 149 <div class="wrap"> … … 195 195 */ 196 196 public function theme_field_callback() { 197 $options = get_option( 'synano_options', $this->get_default_options());197 $options = $this->get_options(); 198 198 $themes = $this->get_available_themes(); 199 199 … … 216 216 */ 217 217 public function language_field_callback() { 218 $options = get_option( 'synano_options', $this->get_default_options());218 $options = $this->get_options(); 219 219 $languages = $this->get_available_languages(); 220 220 … … 234 234 */ 235 235 public function show_header_field_callback() { 236 $options = get_option( 'synano_options', $this->get_default_options());236 $options = $this->get_options(); 237 237 $checked = checked( $options['default_show_header'], true, false ); 238 238 … … 248 248 */ 249 249 public function show_line_numbers_field_callback() { 250 $options = get_option( 'synano_options', $this->get_default_options());250 $options = $this->get_options(); 251 251 $checked = checked( $options['default_show_line_numbers'], true, false ); 252 252 … … 320 320 array( 321 321 'message' => __( 'Settings have been reset successfully.', 'syntax-highlight-nano' ), 322 'options' => $default_options,322 'options' => $default_options, 323 323 ) 324 324 ); … … 342 342 343 343 /** 344 * 現在の設定値を取得する(デフォルト値とマージ) 345 * 346 * @return array 設定値の配列 347 */ 348 public function get_options() { 349 $options = get_option( 'synano_options', array() ); 350 if ( ! is_array( $options ) ) { 351 $options = array(); 352 } 353 return wp_parse_args( $options, $this->get_default_options() ); 354 } 355 356 /** 344 357 * 利用可能なテーマのリストを取得する 345 358 * … … 360 373 // 精選されたテーマ(6個) 361 374 $themes = array( 362 'default' => 'Default',363 'github' => 'GitHub',364 'github-dark' => 'GitHub Dark',365 'monokai' => 'Monokai',366 'vs' => 'Visual Studio',375 'default' => 'Default', 376 'github' => 'GitHub', 377 'github-dark' => 'GitHub Dark', 378 'monokai' => 'Monokai', 379 'vs' => 'Visual Studio', 367 380 'atom-one-dark' => 'Atom One Dark', 368 381 ); … … 392 405 393 406 $languages = array( 394 'auto' => __( 'Auto Detect', 'syntax-highlight-nano' ),407 'auto' => __( 'Auto Detect', 'syntax-highlight-nano' ), 395 408 'applescript' => 'AppleScript', 396 'bash' => 'Bash',397 'c' => 'C',398 'cpp' => 'C++',399 'csharp' => 'C#',400 'css' => 'CSS',401 'go' => 'Go',402 'html' => 'HTML',403 'java' => 'Java',404 'javascript' => 'JavaScript',405 'json' => 'JSON',406 'jsx' => 'JSX',407 'kotlin' => 'Kotlin',408 'less' => 'Less',409 'markdown' => 'Markdown',410 'php' => 'PHP',411 'plaintext' => 'Plain Text',412 'powershell' => 'PowerShell',413 'python' => 'Python',414 'ruby' => 'Ruby',415 'rust' => 'Rust',416 'sass' => 'Sass',417 'scss' => 'SCSS',418 'shell' => 'Shell',419 'sql' => 'SQL',420 'swift' => 'Swift',421 'tsx' => 'TSX',422 'typescript' => 'TypeScript',423 'xml' => 'XML',424 'yaml' => 'YAML',409 'bash' => 'Bash', 410 'c' => 'C', 411 'cpp' => 'C++', 412 'csharp' => 'C#', 413 'css' => 'CSS', 414 'go' => 'Go', 415 'html' => 'HTML', 416 'java' => 'Java', 417 'javascript' => 'JavaScript', 418 'json' => 'JSON', 419 'jsx' => 'JSX', 420 'kotlin' => 'Kotlin', 421 'less' => 'Less', 422 'markdown' => 'Markdown', 423 'php' => 'PHP', 424 'plaintext' => 'Plain Text', 425 'powershell' => 'PowerShell', 426 'python' => 'Python', 427 'ruby' => 'Ruby', 428 'rust' => 'Rust', 429 'sass' => 'Sass', 430 'scss' => 'SCSS', 431 'shell' => 'Shell', 432 'sql' => 'SQL', 433 'swift' => 'Swift', 434 'tsx' => 'TSX', 435 'typescript' => 'TypeScript', 436 'xml' => 'XML', 437 'yaml' => 'YAML', 425 438 ); 426 439 -
syntax-highlight-nano/trunk/readme.txt
r3447159 r3470834 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 17 Stable tag: 1.1.2 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 70 70 == Changelog == 71 71 72 = 1.1.2 = 73 * Bug fix: Resolved 500 fatal error on code block save caused by undefined settings array keys in PHP 8.1+. 74 72 75 = 1.1.1 = 73 76 * Bug Fix. -
syntax-highlight-nano/trunk/syntax-highlight-nano.php
r3447159 r3470834 4 4 * Plugin URI: https://wordpress.org/plugins/syntax-highlight-nano 5 5 * Description: Adds modern syntax highlighting to the core/code block with highlight.js 6 * Version: 1.1. 16 * Version: 1.1.2 7 7 * Author: Takashi Fujisaki 8 8 * Author URI: https://yuiami.jp … … 152 152 153 153 // デフォルト設定をJavaScriptに渡す 154 $default_options = get_option( 'synano_options', $this->admin->get_default_options());154 $default_options = $this->admin->get_options(); 155 155 wp_localize_script( 156 156 'synano-editor', … … 221 221 222 222 // 設定されたテーマのCSSを読み込み(ローカルファイルを使用) 223 $default_options = get_option( 'synano_options', $this->admin->get_default_options());223 $default_options = $this->admin->get_options(); 224 224 $theme = $default_options['default_theme']; 225 225 … … 288 288 289 289 // デフォルト設定を取得 290 $default_options = get_option( 'synano_options', $this->admin->get_default_options());290 $default_options = $this->admin->get_options(); 291 291 292 292 // カスタム属性を取得
Note: See TracChangeset
for help on using the changeset viewer.