forked from laraish/laraish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.php
209 lines (177 loc) · 5.6 KB
/
theme.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php
return [
/*
|--------------------------------------------------------------------------
| Add theme support
|--------------------------------------------------------------------------
|
| Arrays passed to the add_theme_support function.
|
*/
'add_theme_support' => [
[
'feature' => 'post-thumbnails',
'options' => ['post']
],
],
/*
|--------------------------------------------------------------------------
| Register custom post types
|--------------------------------------------------------------------------
| A series of array taking the form of:
|
*/
//'post_types' => [
// 'post_type' => [
// 'label' => 'Post Type Label'
// ],
//],
/*
|--------------------------------------------------------------------------
| Register custom taxonomies
|--------------------------------------------------------------------------
| A series of array taking the form of:
|
*/
//'taxonomies' => [
// 'taxonomy' => [
// 'label' => 'Taxonomy Label'
// 'object_type' => 'post'
// ],
//],
/*
|--------------------------------------------------------------------------
| Editor Styles
|--------------------------------------------------------------------------
|
| CSS for WordPress's rich editor.
|
*/
//'editor_styles' => 'public/css/article-style.css',
/*
|--------------------------------------------------------------------------
| Title Placeholder
|--------------------------------------------------------------------------
|
| Set the tile-placeholder for Custom-Post-Type
| key is the slug of custom post type
| value is the placeholder text
|
*/
//'title_placeholder' => [
// 'author' => 'Author Name',
// 'books' => 'Book Title',
//],
/*
|--------------------------------------------------------------------------
| Remove Menu Page
|--------------------------------------------------------------------------
|
| remove unused page from admin page.
|
*/
//'remove_menu_page' => ['edit.php', 'edit-comments.php'],
/*
|---------------------------------------------------------------------------
| Navigation menus
|---------------------------------------------------------------------------
|
| Register navigation menus for a theme
|
*/
//'menus' => ['menu_location' => 'menu_description'],
/*
|--------------------------------------------------------------------------
| Image Sizes
|--------------------------------------------------------------------------
|
| Set image-size for custom-post-type
|
*/
//'image_sizes' => [
// ['single--blog', 655, 368, true],
//],
/*
|--------------------------------------------------------------------------
| Excerpt Length
|--------------------------------------------------------------------------
|
| Set the length of excerpt
|
*/
//'excerpt_length' => 100,
/*
|--------------------------------------------------------------------------
| Excerpt More String
|--------------------------------------------------------------------------
|
| Excerpt More String
|
*/
//'excerpt_more' => '...',
/*
|--------------------------------------------------------------------------
| Remove Version
|--------------------------------------------------------------------------
|
| If remove the WordPress version meta tag inside <head>
|
*/
'remove_version' => true,
/*
|--------------------------------------------------------------------------
| Page Templates
|--------------------------------------------------------------------------
|
| Register your page templates.
| You can refer the template name by `$post->page_template`.
| Chances are that you are going to lookup `$post->page_template` in
| controllers to determine which view is going to be used.
|
*/
//'page_templates' => [
// [
// 'post_type' => ['page', 'post'],
// 'name' => 'Template Name'
// ],
// [
// 'post' => [$post_id, $post_object],
// 'name' => 'Template Name'
// ]
//],
/*
|--------------------------------------------------------------------------
| Admin Page Assets
|--------------------------------------------------------------------------
|
| Enqueuing both scripts and styles to admin page.
|
*/
//'admin_page_assets' => [
// 'scripts' => [],
// 'styles' => [],
// 'hook' => ''
//],
/*
|--------------------------------------------------------------------------
| Format ACF Value
|--------------------------------------------------------------------------
|
| Format value got from ACF.
| Value can be a class name or a closure which returns the class name.
|
*/
'format_acf_value' => [
'post' => function (WP_Post $post) {
$modelName = \ucfirst(\Illuminate\Support\Str::camel($post->post_type));
$modelClassName = "\\App\\Models\\Wp\\Post\\$modelName";
if (class_exists($modelClassName)) {
return $modelClassName;
}
return \App\Models\Wp\Post\Post::class;
},
'term' => \Laraish\Support\Wp\Model\Term::class,
'user' => \Laraish\Support\Wp\Model\User::class,
'assoc_array_to_object' => true,
],
];