Skip to content

Commit 88b55c8

Browse files
Merge pull request #103 from creativecommons/faq-groups
add `faq-groups`, relevant templates, contexts, and stylings to render and input `FAQs`
2 parents badd787 + d71a7e5 commit 88b55c8

12 files changed

+1036
-16
lines changed

src/functions.php

+10
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,13 @@ function person_disable_redirect_canonical($redirect_url) {
276276
if (is_paged() && is_singular()) $redirect_url = false;
277277
return $redirect_url;
278278
}
279+
280+
// remove edit_post_link from non-editors
281+
function remove_get_edit_post_link( $link ) {
282+
if ( current_user_can( 'edit_posts' ) ) {
283+
return $link;
284+
}
285+
return null;
286+
}
287+
288+
add_filter( 'get_edit_post_link', 'remove_get_edit_post_link' );
+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"key": "group_66e1dc8531b97",
3+
"title": "FAQs Index Settings",
4+
"fields": [
5+
{
6+
"key": "field_67cf512a1feef",
7+
"label": "Top Group",
8+
"name": "top_group",
9+
"aria-label": "",
10+
"type": "post_object",
11+
"instructions": "",
12+
"required": 0,
13+
"conditional_logic": 0,
14+
"wrapper": {
15+
"width": "",
16+
"class": "",
17+
"id": ""
18+
},
19+
"post_type": [
20+
"faqs-group"
21+
],
22+
"post_status": [
23+
"publish"
24+
],
25+
"taxonomy": "",
26+
"return_format": "object",
27+
"multiple": 0,
28+
"allow_null": 0,
29+
"allow_in_bindings": 1,
30+
"bidirectional": 0,
31+
"ui": 1,
32+
"bidirectional_target": []
33+
},
34+
{
35+
"key": "field_67cf52dc0a1e3",
36+
"label": "Featured Areas",
37+
"name": "featured_areas",
38+
"aria-label": "",
39+
"type": "group",
40+
"instructions": "",
41+
"required": 0,
42+
"conditional_logic": 0,
43+
"wrapper": {
44+
"width": "",
45+
"class": "",
46+
"id": ""
47+
},
48+
"layout": "block",
49+
"sub_fields": [
50+
{
51+
"key": "field_67cf539a533f3",
52+
"label": "Groups",
53+
"name": "groups",
54+
"aria-label": "",
55+
"type": "relationship",
56+
"instructions": "",
57+
"required": 0,
58+
"conditional_logic": 0,
59+
"wrapper": {
60+
"width": "",
61+
"class": "",
62+
"id": ""
63+
},
64+
"post_type": [
65+
"faqs-group"
66+
],
67+
"post_status": [
68+
"publish"
69+
],
70+
"taxonomy": "",
71+
"filters": [
72+
"search"
73+
],
74+
"return_format": "object",
75+
"min": "",
76+
"max": "",
77+
"allow_in_bindings": 0,
78+
"elements": "",
79+
"bidirectional": 0,
80+
"bidirectional_target": []
81+
},
82+
{
83+
"key": "field_67cf53430a1e4",
84+
"label": "Link Type",
85+
"name": "link_type",
86+
"aria-label": "",
87+
"type": "select",
88+
"instructions": "Should Questions perform an anchor jump (same page), or open the group in a new page?",
89+
"required": 0,
90+
"conditional_logic": 0,
91+
"wrapper": {
92+
"width": "",
93+
"class": "",
94+
"id": ""
95+
},
96+
"choices": {
97+
"to-anchor": "to Anchor",
98+
"to-page": "to Page"
99+
},
100+
"default_value": "to-anchor",
101+
"return_format": "value",
102+
"multiple": 0,
103+
"allow_null": 0,
104+
"allow_in_bindings": 1,
105+
"ui": 0,
106+
"ajax": 0,
107+
"placeholder": ""
108+
}
109+
]
110+
},
111+
{
112+
"key": "field_66e1dc85364e7",
113+
"label": "Closing",
114+
"name": "closing",
115+
"aria-label": "",
116+
"type": "wysiwyg",
117+
"instructions": "",
118+
"required": 0,
119+
"conditional_logic": 0,
120+
"wrapper": {
121+
"width": "",
122+
"class": "",
123+
"id": ""
124+
},
125+
"default_value": "",
126+
"allow_in_bindings": 1,
127+
"tabs": "all",
128+
"toolbar": "basic",
129+
"media_upload": 0,
130+
"delay": 0
131+
}
132+
],
133+
"location": [
134+
[
135+
{
136+
"param": "post_type",
137+
"operator": "==",
138+
"value": "page"
139+
},
140+
{
141+
"param": "page_template",
142+
"operator": "==",
143+
"value": "page_faqs.php"
144+
}
145+
]
146+
],
147+
"menu_order": 0,
148+
"position": "acf_after_title",
149+
"style": "seamless",
150+
"label_placement": "top",
151+
"instruction_placement": "label",
152+
"hide_on_screen": [
153+
"the_content",
154+
"excerpt",
155+
"discussion",
156+
"comments"
157+
],
158+
"active": true,
159+
"description": "",
160+
"show_in_rest": 0,
161+
"modified": 1741640959
162+
}
+124
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"key": "group_66e1e37b02817",
3+
"title": "FAQs Groupings Settings",
4+
"fields": [
5+
{
6+
"key": "field_67d33cfe81fb5",
7+
"label": "Summary",
8+
"name": "summary",
9+
"aria-label": "",
10+
"type": "text",
11+
"instructions": "",
12+
"required": 0,
13+
"conditional_logic": 0,
14+
"wrapper": {
15+
"width": "",
16+
"class": "",
17+
"id": ""
18+
},
19+
"default_value": "",
20+
"maxlength": "",
21+
"allow_in_bindings": 0,
22+
"placeholder": "",
23+
"prepend": "",
24+
"append": ""
25+
},
26+
{
27+
"key": "field_66e1e37b0d3a0",
28+
"label": "Introduction",
29+
"name": "introduction",
30+
"aria-label": "",
31+
"type": "textarea",
32+
"instructions": "",
33+
"required": 0,
34+
"conditional_logic": 0,
35+
"wrapper": {
36+
"width": "",
37+
"class": "",
38+
"id": ""
39+
},
40+
"default_value": "",
41+
"maxlength": "",
42+
"rows": "",
43+
"placeholder": "",
44+
"new_lines": ""
45+
},
46+
{
47+
"key": "field_66e1e37b0d3df",
48+
"label": "FAQs Listing",
49+
"name": "faqs_listing",
50+
"aria-label": "",
51+
"type": "relationship",
52+
"instructions": "",
53+
"required": 0,
54+
"conditional_logic": 0,
55+
"wrapper": {
56+
"width": "",
57+
"class": "",
58+
"id": ""
59+
},
60+
"post_type": [
61+
"faq_item"
62+
],
63+
"post_status": [
64+
"publish",
65+
"draft"
66+
],
67+
"taxonomy": "",
68+
"filters": [
69+
"search"
70+
],
71+
"return_format": "object",
72+
"min": "",
73+
"max": "",
74+
"allow_in_bindings": 1,
75+
"elements": "",
76+
"bidirectional": 0,
77+
"bidirectional_target": []
78+
},
79+
{
80+
"key": "field_66e1e37b0d41c",
81+
"label": "Closing",
82+
"name": "closing",
83+
"aria-label": "",
84+
"type": "textarea",
85+
"instructions": "",
86+
"required": 0,
87+
"conditional_logic": 0,
88+
"wrapper": {
89+
"width": "",
90+
"class": "",
91+
"id": ""
92+
},
93+
"default_value": "",
94+
"maxlength": "",
95+
"rows": "",
96+
"placeholder": "",
97+
"new_lines": ""
98+
}
99+
],
100+
"location": [
101+
[
102+
{
103+
"param": "post_type",
104+
"operator": "==",
105+
"value": "faqs-group"
106+
}
107+
]
108+
],
109+
"menu_order": 0,
110+
"position": "acf_after_title",
111+
"style": "seamless",
112+
"label_placement": "top",
113+
"instruction_placement": "label",
114+
"hide_on_screen": [
115+
"the_content",
116+
"excerpt",
117+
"discussion",
118+
"comments"
119+
],
120+
"active": true,
121+
"description": "",
122+
"show_in_rest": 0,
123+
"modified": 1741896971
124+
}

src/inc/acf-json/group_66e1e613ec088.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"label_placement": "top",
1818
"instruction_placement": "label",
1919
"hide_on_screen": "",
20-
"active": true,
20+
"active": false,
2121
"description": "",
2222
"show_in_rest": 0,
23-
"modified": 1739997301
23+
"modified": 1741362041
2424
}
+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"key": "group_66e20475d56d0",
3+
"title": "FAQs Index Meta",
4+
"fields": [
5+
{
6+
"key": "field_66e204760135a",
7+
"label": "Language",
8+
"name": "language",
9+
"aria-label": "",
10+
"type": "select",
11+
"instructions": "",
12+
"required": 0,
13+
"conditional_logic": 0,
14+
"wrapper": {
15+
"width": "",
16+
"class": "",
17+
"id": ""
18+
},
19+
"choices": {
20+
"English": "English",
21+
"French": "French"
22+
},
23+
"default_value": false,
24+
"return_format": "value",
25+
"multiple": 0,
26+
"allow_null": 0,
27+
"allow_in_bindings": 0,
28+
"ui": 0,
29+
"ajax": 0,
30+
"placeholder": ""
31+
}
32+
],
33+
"location": [
34+
[
35+
{
36+
"param": "post_type",
37+
"operator": "==",
38+
"value": "page"
39+
},
40+
{
41+
"param": "page_template",
42+
"operator": "==",
43+
"value": "page_faqs.php"
44+
}
45+
]
46+
],
47+
"menu_order": 0,
48+
"position": "side",
49+
"style": "default",
50+
"label_placement": "top",
51+
"instruction_placement": "label",
52+
"hide_on_screen": "",
53+
"active": false,
54+
"description": "",
55+
"show_in_rest": 0,
56+
"modified": 1741362015
57+
}

src/inc/acf-json/post_type_66e1db36db2a5.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"description": "",
4646
"public": true,
4747
"hierarchical": true,
48-
"exclude_from_search": true,
48+
"exclude_from_search": false,
4949
"publicly_queryable": true,
5050
"show_ui": true,
5151
"show_in_menu": true,
@@ -85,5 +85,5 @@
8585
"delete_with_user": false,
8686
"register_meta_box_cb": "",
8787
"enter_title_here": "",
88-
"modified": 1740579848
88+
"modified": 1741980856
8989
}

0 commit comments

Comments
 (0)