質問編集履歴
1
テキストのコード追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -25,3 +25,37 @@
|
|
25
25
|
|
26
26
|
|
27
27
|
![イメージ説明](6090beec0eb3aeb86ec57528dcba7aad.png)
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
#実際のコード
|
32
|
+
|
33
|
+
```php
|
34
|
+
|
35
|
+
function auto_post_slug( $slug, $post_ID, $post_status, $post_type ) {
|
36
|
+
|
37
|
+
if ( $post_type=='list' ) {
|
38
|
+
|
39
|
+
$slug = 'list-' . $post_ID;
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
return $slug;
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
add_filter( 'wp_unique_post_slug', 'auto_post_slug', 10, 4 );
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
function new_excerpt_length($length) {
|
54
|
+
|
55
|
+
return 100;
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
add_filter( 'excerpt_length', 'new_excerpt_length');
|
60
|
+
|
61
|
+
```
|