Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2022
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. /plugins/non-ja-slug/
  2.  
  3. + non-ja-slug.php
  4. + readme.txt
  5.  
  6. // non-ja-slug.php
  7.  
  8. <?php
  9. /**
  10. * @package non-ja-slug
  11. */
  12. /*
  13. /*
  14. Plugin Name: パーマリンク日本語防止プラグイン
  15. Plugin URI: http://example.com/
  16. Description: タイトルに日本語が含まれる場合、スラッグを半角英数のみに自動変換します。
  17. Version: 1.0
  18. Author: unknown coder and hcc_dtp
  19. Author URI: http://example.com/
  20. License: Unlicense
  21. Text Domain: non-ja-slug
  22. */
  23. add_filter('sanitize_title','sanitize_title_numalpha_only',9);
  24. function sanitize_title_numalpha_only($title) {
  25. return preg_replace('/[^%a-zA-Z0-9 \(\)_-]/', '-', $title);
  26. }
  27. ?>
  28.  
  29. // readme.txt
  30.  
  31. === パーマリンク日本語防止プラグイン ===
  32. Contributors: unknown coder, hcc_dtp
  33. Tags: permalink,permanent link,slug
  34. Requires at least: 6.0
  35. Tested up to: 6.1
  36. Stable tag: 1.0
  37. License: Unlicense
  38. License URI: http://example.com/
  39. Requires PHP: 5.4 or later
  40. Donate link:
  41.  
  42. == Description ==
  43. 記事タイトルに日本語が含まれる場合、保存時にスラッグを半角英数のみに自動変換します。
  44.  
  45. = Features =
  46.  
  47. == Installation ==
  48.  
  49. 1. Upload 'plugin-notes-label' folder to the `/wp-content/plugins/` directory.
  50. 2. Activate the plugin through the 'Plugins' menu in WordPress.
  51. 3. If you have any problems - please ask for support.
  52.  
  53. == Frequently Asked Questions ==
  54.  
  55. == Screenshots ==
  56.  
  57. == Changelog ==
  58. = 1.0 =
  59. 2022.09.22
  60. * Initial release
  61.  
  62. == Upgrade Notice ==
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement