回答編集履歴

2

コードイメージ追記

2017/01/05 09:49

投稿

退会済みユーザー
test CHANGED
@@ -15,3 +15,25 @@
15
15
 
16
16
 
17
17
  [https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title](https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title)
18
+
19
+
20
+
21
+ ```PHP
22
+
23
+ function my_the_title( $title, $id ) {
24
+
25
+
26
+
27
+ // $idをもとにして、限定記事が調べる処理
28
+
29
+ // ex) データベースをたたいて調べる……など
30
+
31
+
32
+
33
+ return '[会員限定]' . $title;
34
+
35
+ }
36
+
37
+ add_filter( 'the_title', 'my_the_title', 10, 2 );
38
+
39
+ ```

1

参考URL追記

2017/01/05 09:49

投稿

退会済みユーザー
test CHANGED
@@ -11,3 +11,7 @@
11
11
  パラメータの投稿IDをもとに限定記事かを調べて、
12
12
 
13
13
  関数の戻り値で、[会員限定]などの文言を付加する……みたいな感じかなあと想像しました。
14
+
15
+
16
+
17
+ [https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title](https://codex.wordpress.org/Plugin_API/Filter_Reference/the_title)