{"id":645,"date":"2017-11-21T13:14:59","date_gmt":"2017-11-21T04:14:59","guid":{"rendered":"https:\/\/nendeb.com\/?p=645"},"modified":"2018-10-08T10:52:45","modified_gmt":"2018-10-08T01:52:45","slug":"wordpress-%e3%83%91%e3%82%b9%e3%83%af%e3%83%bc%e3%83%89%e4%bf%9d%e8%ad%b7%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ae-%e6%8a%95%e7%a8%bf%e3%83%91%e3%82%b9%e3%83%af%e3%83%bc%e3%83%89-%e3%82%92%e3%80%8c","status":"publish","type":"post","link":"https:\/\/nendeb.com\/645","title":{"rendered":"WordPress \u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u306e \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9 \u3092\u300c\u5168\u8a18\u4e8b\u5171\u901a\u300d\u3067\u8907\u6570\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nendeb.com\/wp-content\/uploads\/main_pluralmultipass.png\" alt=\"\" width=\"800\" height=\"420\" class=\"alignnone size-full wp-image-647\" \/><br \/>\nWordPress 4.7\u304b\u3089\u300cpost_password_required\u300d\u3068\u3044\u3046\u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30a3\u30eb\u30bf\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3092\u4f7f\u3063\u3066 1\u3064\u3057\u304b\u8a2d\u5b9a\u3067\u304d\u306a\u304b\u3063\u305f \u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u306e \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8907\u6570\u767b\u9332\u3057\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>WordPress\u3067\u306f \u6295\u7a3f\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u3068 \u6295\u7a3f\u30da\u30fc\u30b8\u306f\u5185\u5bb9\u306f\u8868\u793a\u3055\u308c\u305a\u306b \u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<br \/>\n\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u300c\u78ba\u5b9a(\u9001\u4fe1)\u300d\u3059\u308b\u3068 \u30d1\u30b9\u30ef\u30fc\u30c9\u306fwp-login.php\u3078\u9001\u3089\u308c \u30af\u30c3\u30ad\u30fc\u306b\u4fdd\u5b58\u3055\u308c\u3066\u304b\u3089\u6295\u7a3f\u30da\u30fc\u30b8\u306b\u623b\u3055\u308c(\u30ea\u30c0\u30a4\u30ec\u30af\u30c8)\u307e\u3059\u3002<br \/>\n\u6295\u7a3f\u30da\u30fc\u30b8\u3067\u306f \u30af\u30c3\u30ad\u30fc\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u7167\u5408\u3057\u3066\u3001\u5408\u3063\u3066\u3044\u308c\u3070 \u6295\u7a3f\u5185\u5bb9\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u3053\u3067\u306f\u7167\u5408\u306e\u4e2d\u306b\u3042\u308b\u300cpost_password_required\u300d\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u4f7f\u3063\u3066 \u5168\u3066\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u8a18\u4e8b \u5171\u901a\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u767b\u9332\u3057\u3066\u7167\u5408\u3059\u308b\u7c21\u6613\u7248\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u8fc4\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u3067\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u30d0\u30e9\u30d0\u30e9\u3067\u3082\u3053\u306e Tips \u3092\u4f7f\u3048\u3070 \u5171\u901a\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9 \u3068\u3057\u3066\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<p>\u6295\u7a3f\u3054\u3068\u306b\u500b\u5225\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8907\u6570\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u300c<a href=\"https:\/\/nendeb.com\/560\" target=\"_blank\">WordPress \u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u306e \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9 \u3092\u300c\u6295\u7a3f\u5225\u300d\u306b\u8907\u6570\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/a>\u300d<\/p>\n<p>\u3000<br \/>\n<br \/>\n\u3000<\/p>\n<h2 id=\"password_required\">\u30b3\u30fc\u30c9<\/h2>\n<p>\u7ba1\u7406\u753b\u9762\u306e\u8a2d\u5b9a\u2192\u5171\u901a\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u5168\u3066\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u306e\u8a18\u4e8b\u3067\u6709\u52b9\u306a \u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8907\u6570\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/nendeb.com\/wp-content\/uploads\/common_multi_post_password_01.png\" alt=\"\" width=\"800\" height=\"410\" class=\"alignnone size-full wp-image-646\" \/><br \/>\n\u3053\u306e\u4ed5\u7d44\u307f\u3092\u4f7f\u3046\u3068\u3001\u5f8c\u3067\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u5165\u308a\u306e\u8a18\u4e8b\u3092\u8ffd\u52a0\u3057\u3066\u3082\u81ea\u52d5\u3067\u300c\u5171\u901a \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u300d\u3067\u95b2\u89a7\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u307e\u305f\u671f\u9650\u30c1\u30a7\u30c3\u30af\u3082\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5408\u3063\u3066\u3044\u3066\u3082\u671f\u9650\u304c\u904e\u304e\u3066\u3044\u305f\u3089NG\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u203b\u5171\u901a\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f7f\u308f\u306a\u3044\u6295\u7a3f\u3092\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3082\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092 <a href=\"https:\/\/nendeb.com\/1\" target=\"blank\">my-plugin.php<\/a> \u306b\u5f35\u308a\u4ed8\u3051\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\/**\r\n * \u5171\u901a \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\r\n *\r\n * @since WordPress 4.7.0\r\n * License: GPLv2 or later\r\n *\/\r\nif( is_admin() ){\r\n\tnew nendebcom_Common_Multi_Post_Password();\r\n}\r\nclass nendebcom_Common_Multi_Post_Password {\r\n\r\n\t\/**\r\n\t * Start up\r\n\t *\/\r\n\tfunction __construct() {\r\n\t\tadd_action( 'admin_menu', array( $this, 'admin_menu' ) );\r\n\t}\r\n\r\n\t\/**\r\n\t * Add options page\r\n\t *\/\r\n\tfunction admin_menu () {\r\n\t\tadd_options_page( 'common_multi_post_password', '\u5171\u901a\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9', 'edit_posts', __FILE__, array( $this, 'form' ) );\r\n\t}\r\n\r\n\t\/**\r\n\t * Saves Multi Post Password.\r\n\t *\/\r\n\tfunction save_common_multi_post_password() {\r\n\r\n\t\trequire_once ABSPATH . '\/wp-includes\/pluggable.php';\r\n\r\n\t\t\/\/ Check if our nonce is set.\r\n\t\tif ( !isset( $_POST[ 'admin_nendebcom_multi_postpass_nonce' ] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t\/\/ Verify that the nonce is valid.\r\n\t\tif ( !wp_verify_nonce( $_POST['admin_nendebcom_multi_postpass_nonce'], 'admin_nendebcom_multi_postpass_nonce' ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t\/\/ Make sure that it is set.\r\n\t\tif ( !isset( $_POST['max_id'] ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t\/\/ \u767b\u9332\u30d1\u30b9\u30ef\u30fc\u30c9\u6570\r\n\t\t$max_id = isset( $_POST['max_id'] ) ? $_POST['max_id'] : 0;\r\n\r\n\t\t$multi_postpass_data = array();\r\n\r\n\t\t$j = 0;\r\n\t\tfor ( $i = 0; $i &lt;= $max_id; $i++ ) {\r\n\t\t\t$postpass_kigen\t = isset( $_POST[ 'postpass_kigen_' . $i ] ) ? sanitize_text_field( $_POST[ 'postpass_kigen_' . $i ] ) : '';\r\n\t\t\t$postpass_pass\t = isset( $_POST[ 'postpass_pass_' . $i ] )  ? sanitize_text_field( $_POST[ 'postpass_pass_' . $i ] ) : '';\r\n\t\t\t$postpass_memo\t = isset( $_POST[ 'postpass_memo_' . $i ] )  ? sanitize_text_field( $_POST[ 'postpass_memo_' . $i ] ) : '';\r\n\t\t\t$postpass_date\t = isset( $_POST[ 'postpass_date_' . $i ] )  ? sanitize_text_field( $_POST[ 'postpass_date_' . $i ] ) : current_time( 'timestamp' );\r\n\r\n\t\t\t\/\/ Postpass Max255\u6587\u5b57\r\n\t\t\t$postpass_pass = substr( $postpass_pass, 0, 255 );\r\n\r\n\t\t\tif ( $postpass_pass ) {\r\n\t\t\t\t$multi_postpass_data[ $j ][ 'postpass_kigen' ]\t = $postpass_kigen;\r\n\t\t\t\t$multi_postpass_data[ $j ][ 'postpass_pass' ]\t = $postpass_pass;\r\n\t\t\t\t$multi_postpass_data[ $j ][ 'postpass_memo' ]\t = $postpass_memo;\r\n\t\t\t\t$multi_postpass_data[ $j ][ 'postpass_date' ]\t = $postpass_date;\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\/\/ Update the meta field in the database.\r\n\t\tupdate_option( 'multi_postpass', $multi_postpass_data );\r\n\r\n\r\n\t\t\/\/ \u9664\u5916\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\r\n\t\t$postpass_exclude_post = isset( $_POST['postpass_exclude_post'] ) ? $_POST['postpass_exclude_post'] : '';\r\n\t\tupdate_option( 'postpass_exclude_post', $postpass_exclude_post );\r\n\r\n\t\treturn '\u4fdd\u5b58\u3057\u307e\u3057\u305f\u3002';\r\n\t}\r\n\r\n\r\n\t\/\/\u30d7\u30e9\u30b0\u30a4\u30f3\u8a2d\u5b9a\u30d5\u30a9\u30fc\u30e0\r\n\tfunction form() {\r\n\r\n\t\t$save_valu = $this-&gt;save_common_multi_post_password();\r\n\r\n\t\techo '&lt;div class=&quot;wrap&quot;&gt;';\r\n\t\techo '&lt;h1 class=&quot;wp-heading-inline&quot;&gt;\u5171\u901a\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9&lt;\/h1&gt;';\r\n\t\techo '&lt;hr class=&quot;wp-header-end&quot;&gt;';\r\n\r\n\t\tif( $save_valu ){\r\n\t\t\techo '&lt;div id=&quot;setting-error-settings_updated&quot; class=&quot;updated settings-error notice is-dismissible&quot;&gt;';\r\n\t\t\techo '&lt;p&gt;&lt;strong&gt;' . $save_valu . '&lt;\/strong&gt;&lt;\/p&gt;';\r\n\t\t\techo '&lt;\/div&gt;';\r\n\t\t}\r\n\r\n\r\n\t\techo '&lt;form method=&quot;post&quot; action=&quot;&quot;&gt;';\r\n\r\n\t\t\t\/\/ Add a nonce field so we can check for it later.\r\n\t\t\twp_nonce_field( 'admin_nendebcom_multi_postpass_nonce', 'admin_nendebcom_multi_postpass_nonce' );\r\n\r\n\t\t\t\/\/ \u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30b9\u30ef\u30fc\u30c9\u671f\u9650 ( \u4eca\u65e5\u304b\u30893\u30ab\u6708\u5f8c )\r\n\t\t\t$kijitsu = date( 'Y\/m\/d', strtotime( date( 'Y\/m\/d', strtotime( date_i18n( 'Y\/m\/d' ) . '+3 month' ) ) . ' -1 day' ) );\r\n\r\n\t\t\t\/\/ \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u53d6\u5f97(\u914d\u5217)\r\n\t\t\t$multi_postpass_data = maybe_unserialize( get_option( 'multi_postpass', false ) );\r\n\r\n\t\t\tif ( !$multi_postpass_data ) {\r\n\t\t\t\t$multi_postpass_data = array();\r\n\t\t\t}else{\r\n\t\t\t\t\/\/\u767b\u9332\u65e5\u3067\u30bd\u30fc\u30c8\r\n\t\t\t\tforeach ( $multi_postpass_data as $key =&gt; $value ){\r\n\t\t\t\t\t$key_id[$key] = $value['postpass_date'];\r\n\t\t\t\t}\r\n\t\t\t\tarray_multisort ( $key_id , SORT_DESC , $multi_postpass_data );\r\n\t\t\t}\r\n\r\n\t\t\t\/\/ \u767b\u9332\u30d1\u30b9\u30ef\u30fc\u30c9\u6570\r\n\t\t\t$tmp_max_id = count( $multi_postpass_data );\r\n\r\n\t\t\techo '&lt;input type=&quot;hidden&quot; name=&quot;max_id&quot; value=&quot;' . $tmp_max_id . '&quot;&gt;';\r\n\r\n\r\n\t\t\t\/\/ CSS \u8868\u793a\u30c6\u30fc\u30d6\u30eb\u7528\r\n\t\t\t?&gt;\r\n\t\t\t&lt;style type=&quot;text\/css&quot;&gt;\r\n\t\t\t\tdiv#multi_postpass {\r\n\t\t\t\t\tbackground-color: #fff;\r\n\t\t\t\t\tpadding: 10px;\r\n\t\t\t\t\tmargin: 30px 0 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table{\r\n\t\t\t\t\twidth: 100%;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table tr.header {\r\n\t\t\t\t\tbackground: #f3f3f3 none repeat scroll 0 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table th {\r\n\t\t\t\t\ttext-align: left;\r\n\t\t\t\t\tpadding: 3px 5px;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table td input[type=&quot;text&quot;] {\r\n\t\t\t\t\twidth: 100%;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table td.kigen {\r\n\t\t\t\t\twidth: 15%;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table td.pass {\r\n\t\t\t\t\twidth: 30%;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table td.memo {\r\n\t\t\t\t\twidth: 40%;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttable.multi_postpass_table td.date {\r\n\t\t\t\t\twidth: 15%;\r\n\t\t\t\t\ttext-align: center;\r\n\t\t\t\t}\r\n\t\t\t&lt;\/style&gt;\r\n\t\t\t&lt;?php\r\n\r\n\t\t\t\/\/ \u8868\u793a\u30c6\u30fc\u30d6\u30eb\r\n\t\t\techo '&lt;div id=&quot;multi_postpass&quot;&gt;';\r\n\t\t\techo '\u5168\u3066\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u8a18\u4e8b\u3067\u6709\u52b9\u306a\u3000\u30e6\u30fc\u30b6\u30fc\u500b\u5225\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002';\r\n\t\t\techo '&lt;table class=&quot;multi_postpass_table&quot;&gt;';\r\n\t\t\techo '&lt;tr class=&quot;header&quot;&gt;';\r\n\t\t\techo '&lt;th&gt;\u671f\u9650&lt;\/th&gt;';\r\n\t\t\techo '&lt;th&gt;\u30d1\u30b9\u30ef\u30fc\u30c9&lt;\/th&gt;';\r\n\t\t\techo '&lt;th&gt;\u30e1\u30e2&lt;\/th&gt;';\r\n\t\t\techo '&lt;th&gt;\u767b\u9332\u65e5&lt;\/th&gt;';\r\n\t\t\techo '&lt;\/tr&gt;';\r\n\r\n\t\t\t\/\/\u65b0\u898f\r\n\t\t\techo '&lt;tr&gt;';\r\n\t\t\techo '&lt;td class=&quot;kigen&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;postpass_kigen_' . $tmp_max_id . '&quot; value=&quot;' . $kijitsu . '&quot; size=&quot;10&quot; autocomplete=&quot;off&quot;&gt;&lt;\/td&gt;';\r\n\t\t\techo '&lt;td class=&quot;pass&quot; &gt;&lt;input type=&quot;text&quot; name=&quot;postpass_pass_'  . $tmp_max_id . '&quot; value=&quot;&quot; size=&quot;20&quot; autocomplete=&quot;off&quot;&gt;&lt;\/td&gt;';\r\n\t\t\techo '&lt;td class=&quot;memo&quot; &gt;&lt;input type=&quot;text&quot; name=&quot;postpass_memo_'  . $tmp_max_id . '&quot; value=&quot;&quot; size=&quot;60&quot; autocomplete=&quot;off&quot;&gt;&lt;\/td&gt;';\r\n\t\t\techo '&lt;td class=&quot;date&quot;&gt;\u65b0\u898f&lt;\/td&gt;';\r\n\t\t\techo '&lt;\/tr&gt;';\r\n\r\n\t\t\t\/\/\u4fee\u6b63\u30fb\u524a\u9664\r\n\t\t\tif ( !empty( $multi_postpass_data ) ) {\r\n\r\n\t\t\t\t$i = 0;\r\n\t\t\t\tforeach ( $multi_postpass_data as $data ) {\r\n\t\t\t\t\techo '&lt;tr&gt;';\r\n\t\t\t\t\techo '&lt;td class=&quot;kigen&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;postpass_kigen_'  . $i . '&quot; value=&quot;' . $data[ 'postpass_kigen' ] . '&quot; size=&quot;10&quot;&gt;&lt;\/td&gt;';\r\n\t\t\t\t\techo '&lt;td class=&quot;pass&quot; &gt;&lt;input type=&quot;text&quot; name=&quot;postpass_pass_'   . $i . '&quot; value=&quot;' . $data[ 'postpass_pass' ] . '&quot; size=&quot;20&quot;&gt;&lt;\/td&gt;';\r\n\t\t\t\t\techo '&lt;td class=&quot;memo&quot; &gt;&lt;input type=&quot;text&quot; name=&quot;postpass_memo_'   . $i . '&quot; value=&quot;' . $data[ 'postpass_memo' ] . '&quot; size=&quot;60&quot;&gt;&lt;\/td&gt;';\r\n\t\t\t\t\techo '&lt;td class=&quot;date&quot; &gt;&lt;input type=&quot;hidden&quot; name=&quot;postpass_date_' . $i . '&quot; value=&quot;' . $data[ 'postpass_date' ] . '&quot;&gt;' . date('Y\/m\/d', $data[ 'postpass_date' ] ) . '&lt;\/td&gt;';\r\n\r\n\t\t\t\t\techo '&lt;\/tr&gt;';\r\n\t\t\t\t\t$i++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\techo '&lt;\/table&gt;';\r\n\t\t\techo ' \u203b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092 \u7a7a\u6b04\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3068\u3001\u305d\u306e\u884c\u306f\u524a\u9664\u3055\u308c\u307e\u3059\u3002';\r\n\r\n\t\t\techo '&lt;br&gt;';\r\n\t\t\techo '&lt;br&gt;';\r\n\r\n\r\n\t\t\t\/\/ \u9664\u5916\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u53d6\u5f97\r\n\t\t\t$postpass_exclude_post = get_option( 'postpass_exclude_post', false );\r\n\t\t\techo '&lt;table class=&quot;multi_postpass_table&quot;&gt;';\r\n\t\t\techo '&lt;tr class=&quot;header&quot;&gt;';\r\n\t\t\techo '&lt;th&gt;\u9664\u5916\u5171\u901a\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9&lt;\/th&gt;';\r\n\t\t\techo '&lt;\/tr&gt;';\r\n\t\t\techo '&lt;tr&gt;';\r\n\t\t\techo '&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;postpass_exclude_post&quot; value=&quot;' . $postpass_exclude_post . '&quot; autocomplete=&quot;off&quot;&gt;&lt;\/td&gt;';\r\n\t\t\techo '&lt;\/tr&gt;';\r\n\t\t\techo '&lt;\/table&gt;';\r\n\t\t\techo ' \u203b\u5171\u901a\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u4f7f\u308f\u306a\u3044\u6295\u7a3fID\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002( post_id \u30ab\u30f3\u30de\u533a\u5207\u308a )';\r\n\r\n\r\n\t\t\techo '&lt;p class=&quot;submit&quot;&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; id=&quot;submit&quot; class=&quot;button-primary&quot; value=&quot;\u5909\u66f4\u3092\u4fdd\u5b58&quot;  \/&gt;&lt;\/p&gt;';\r\n\t\t\techo '&lt;\/div&gt;';\r\n\r\n\r\n\t\techo '&lt;\/form&gt;';\r\n\t\techo '&lt;\/div&gt;';\r\n\t}\r\n}\r\n\r\n\r\n\/**\r\n * \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u5165\u308c\u305f \u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u8a8d\u8a3c\u3059\u308b\r\n * Filters whether a post requires the user to supply a password.\r\n *\r\n * @since WordPress 4.7.0\r\n * post-template.php\r\n *\r\n * @param bool    $required Whether the user needs to supply a password. True if password has not been\r\n *                          provided or is incorrect, false if password has been supplied or is not required.\r\n * @param WP_Post $post     Post data.\r\n * License: GPLv2 or later\r\n *\/\r\nfunction nendebcom_common_multi_post_password_required( $required, $post ) {\r\n\r\n\tif ( !$required ) {\r\n\t\treturn $required;\r\n\t}\r\n\r\n\t\/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u30c7\u30fc\u30bf\u8aad\u8fbc\r\n\t$multi_postpass_data = maybe_unserialize( get_option( 'multi_postpass', false ) );\r\n\t\/\/ \u9664\u5916\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u53d6\u5f97\r\n\t$postpass_exclude_post = get_option( 'postpass_exclude_post', false );\r\n\t$postpass_exclude_post_array = explode( ',', $postpass_exclude_post );\r\n\r\n\t$hasher = new PasswordHash( 8, true );\r\n\r\n\t\/\/ \u8ffd\u52a0\u7167\u5408\r\n\t$hash = isset( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) ? wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] ) : '';\r\n\tif ( 0 !== strpos( $hash, '$P$B' ) ) {\r\n\t\t$required = true;\r\n\t} else {\r\n\t\tif ( !empty( $multi_postpass_data ) ) {\r\n\t\t\t\/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u30c1\u30a7\u30c3\u30af\r\n\t\t\tforeach ( $multi_postpass_data as $passdata ) {\r\n\t\t\t\tif ( $hasher-&gt;CheckPassword( $passdata[ 'postpass_pass' ], $hash ) ) {\r\n\r\n\t\t\t\t\t\/\/ \u9664\u5916\u6295\u7a3fID\r\n\t\t\t\t\tforeach ( $postpass_exclude_post_array as $exclude_post_id ) {\r\n\t\t\t\t\t\tif( $exclude_post_id == $post-&gt;ID ){\r\n\t\t\t\t\t\t\treturn $required;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\/\/\u671f\u9650\u30c1\u30a7\u30c3\u30af\r\n\t\t\t\t\tif ( strtotime( date_i18n( &quot;Y\/m\/d&quot; ) ) &lt;= strtotime( $passdata[ 'postpass_kigen' ] ) ) {\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn $required;\r\n}\r\nadd_filter( 'post_password_required', 'nendebcom_common_multi_post_password_required', 11, 2 );\r\n\r\n<\/pre>\n<p>\u203b\u3053\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u89e6\u308c\u308b\u6a29\u9650\u306f\u300cedit_posts\u300d\u306b\u3057\u3066\u307e\u3059\u304c\u3001\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f add_options_page\u306e\u6240\u3067\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u203b\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u30d5\u30a9\u30fc\u30e0\u306e\u3044\u3061\u3070\u3093\u4e0a\u306e\u884c\u304c\u65b0\u898f\u767b\u9332\u7528\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u203b\u6d88\u3057\u305f\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u3042\u308b\u5834\u5408\u3001\u8a72\u5f53\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092 \u7a7a\u6b04\u306b\u3057\u3066\u4fdd\u5b58\u3059\u308b\u3068\u3001\u305d\u306e\u884c\u306f\u524a\u9664\u3055\u308c\u307e\u3059\u3002<br \/>\n\u203b\u30c7\u30d5\u30a9\u30eb\u30c8\u30d1\u30b9\u30ef\u30fc\u30c9\u671f\u9650\u306f\u4f7f\u3046\u7528\u9014\u3067\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u203bWordPress\u306e\u6a19\u6e96\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u3059\u3002\u3053\u308c\u3092\u3057\u306a\u3044\u3068 \u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u6a5f\u80fd\u81ea\u4f53 \u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u3000<br \/>\n\u3000<\/p>\n<h2>\u3042\u3068\u304c\u304d<\/h2>\n<p>\u3053\u3053\u307e\u3067\u51fa\u6765\u305f\u3089\u3001\u904b\u7528\u3057\u3060\u3044\u3067\u3044\u308d\u3044\u308d\u306a\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001WordPress\u306e\u6a19\u6e96\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u3001\u5168\u3066\u540c\u3058\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u3044\u308c\u3066\u3001\u30b9\u30fc\u30d1\u30fc\u30e6\u30fc\u30b6\u30fc\u7528\u3068\u304b\u78ba\u8a8d\u7528\u3068\u304b\u306b\u4f7f\u3063\u305f\u3089\u3069\u3046\u3067\u3057\u3087\u3046\u304b?<br \/>\n\u305d\u3093\u306a\u5834\u5408\u306e\u5168\u3066\u540c\u3058\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u7c21\u5358\u306b\u8a2d\u5b9a\u3067\u304d\u308b\u65b9\u6cd5\u306f\u3053\u3061\u3089\u306b\u3042\u308a\u307e\u3059\u3002<br \/>\n\u300c<a href=\"https:\/\/nendeb.com\/559\" target=\"_blank\">\u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u306e \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9 \u3092 \u4e00\u62ec\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/a>\u300d<\/p>\n<p>\u6295\u7a3f\u3054\u3068\u306b\u500b\u5225\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8907\u6570\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u300c<a href=\"https:\/\/nendeb.com\/560\" target=\"_blank\">WordPress \u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u306e \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9 \u3092\u300c\u6295\u7a3f\u5225\u300d\u306b\u8907\u6570\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/a>\u300d<\/p>\n<p>\u3042\u307e\u308a\u30d1\u30b9\u30ef\u30fc\u30c9\u6570\u304c\u591a\u304f\u306a\u308b\u3068\u3001\u4f7f\u3044\u306b\u304f\u304f\u306a\u308a\u307e\u3059\u306e\u3067 \u5b9f\u7528\u7684\u306b\u5909\u66f4\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002<br \/>\n\u8ffd\u52a0\u7528\u306e\u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u60c5\u5831\u306f\u6295\u7a3f\u3054\u3068\u306b 1\u3064\u306e\u30ab\u30b9\u30bf\u30e0\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u307e\u3068\u3081\u3066\u5165\u308b\u3088\u3046\u306b\u3057\u3066\u307e\u3059\u3002<br \/>\n\u3082\u3057\u304b\u3057\u305f\u3089 \u30d1\u30b9\u30ef\u30fc\u30c9\u60c5\u5831\u3092 \u65b0\u3057\u3044\u5225\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u6301\u305f\u305b\u308b\u3088\u3046\u306b\u3057\u305f\u65b9\u304c\u5b89\u5fc3\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u3000<br \/>\n\u3000<\/p>\n<h2 id=\"sankou\">\u53c2\u8003<\/h2>\n<p>post_password_required | Hook | WordPress Developer Resources<br \/>\n<a href=\"https:\/\/developer.wordpress.org\/reference\/hooks\/post_password_required\/\" target=\"_blank\"  rel=\"noopener nofollow\">https:\/\/developer.wordpress.org\/reference\/hooks\/post_password_required\/<\/a><\/p>\n<p>\u7ba1\u7406\u30e1\u30cb\u30e5\u30fc\u306e\u8ffd\u52a0 &#8211; WordPress Codex \u65e5\u672c\u8a9e\u7248<br \/>\n<a href=\"https:\/\/wpdocs.osdn.jp\/%E7%AE%A1%E7%90%86%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%81%AE%E8%BF%BD%E5%8A%A0\" target=\"_blank\"  rel=\"noopener nofollow\">https:\/\/wpdocs.osdn.jp\/%E7%AE%A1%E7%90%86%E3%83%A1%E3%83%8B%E3%83%A5%E3%83%BC%E3%81%AE%E8%BF%BD%E5%8A%A0<\/a><\/p>\n<p>\u95a2\u6570\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\/add options page &#8211; WordPress Codex \u65e5\u672c\u8a9e\u7248<br \/>\n<a href=\"https:\/\/wpdocs.osdn.jp\/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9\/add_options_page\" target=\"_blank\"  rel=\"noopener nofollow\">https:\/\/wpdocs.osdn.jp\/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9\/add_options_page<\/a><\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u306e\u7a2e\u985e\u3068\u6a29\u9650 &#8211; WordPress Codex \u65e5\u672c\u8a9e\u7248<br \/>\n<a href=\"https:\/\/wpdocs.osdn.jp\/%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E7%A8%AE%E9%A1%9E%E3%81%A8%E6%A8%A9%E9%99%90\" target=\"_blank\"  rel=\"noopener nofollow\">https:\/\/wpdocs.osdn.jp\/%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E7%A8%AE%E9%A1%9E%E3%81%A8%E6%A8%A9%E9%99%90<\/a><\/p>\n<p><!--\n<a href=\"\" target=\"_blank\"  rel=\"noopener nofollow\"><\/a>\npost_password_required,WordPress 4.7\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress 4.7\u304b\u3089\u300cpost_password_required\u300d\u3068\u3044\u3046\u30a2\u30af\u30b7\u30e7\u30f3\u30d5\u30a3\u30eb\u30bf\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u308c\u3092\u4f7f\u3063\u3066 1\u3064\u3057\u304b\u8a2d\u5b9a\u3067\u304d\u306a\u304b\u3063\u305f \u30d1\u30b9\u30ef\u30fc\u30c9\u4fdd\u8b77\u30da\u30fc\u30b8\u306e \u6295\u7a3f\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8907\u6570\u767b\u9332\u3057\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3067\u304d\u305d\u3046\u3067\u3059\u3002 WordPress\u3067\u306f \u6295\u7a3f\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u3068 \u6295\u7a3f\u30da\u30fc\u30b8\u306f&hellip;<\/p>\n","protected":false},"author":1,"featured_media":647,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[141,142,124,98],"class_list":["post-645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","tag-add_options_page","tag-admin_menu","tag-post_password_required","tag-wordpress4-7"],"jetpack_featured_media_url":"https:\/\/nendeb.com\/wp-content\/uploads\/main_pluralmultipass.png","_links":{"self":[{"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/posts\/645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/comments?post=645"}],"version-history":[{"count":0,"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/posts\/645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/media\/647"}],"wp:attachment":[{"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/media?parent=645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/categories?post=645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nendeb.com\/wp-json\/wp\/v2\/tags?post=645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}