回答編集履歴
2
回答の推敲
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
```php
|
4
4
|
|
5
|
-
add_action('p
|
5
|
+
add_action('wp_insert_post_data', 'my_same_term');
|
6
6
|
|
7
7
|
```
|
8
8
|
|
1
回答欄推敲
test
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
wp_insert_post_dataというフックがあり、「publish_投稿2」の代わりにこちらを使用することで解決しました。
|
2
2
|
|
3
|
+
```php
|
3
4
|
|
5
|
+
add_action('publish_投稿2', 'my_same_term');
|
6
|
+
|
7
|
+
```
|
8
|
+
|
9
|
+
##参考
|
4
10
|
|
5
11
|
[https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_insert_post_data](https://codex.wordpress.org/Plugin_API/Filter_Reference/wp_insert_post_data)
|