-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
61 lines (55 loc) · 1.76 KB
/
functions.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
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('Version')
);
}
function custom_rest(){
register_rest_field( 'members', 'function', $args = array(
'get_callback' => function() { return get_field('function'); }
) );
register_rest_field( 'members', 'department', $args = array(
'get_callback' => function() { return get_field('department'); }
) );
}
add_action( 'rest_api_init', 'custom_rest' );
function asmi_post_types(){
register_post_type( 'members', array(
"supports"=> array("title", "custom-fields"),
"public" => true,
"show_in_rest" => true,
"labels" => array(
"name" => "Membri",
"add_new_item" => "Add Member"
),
'has_archive' => true,
"menu_icon" => "dashicons-buddicons-buddypress-logo"
));
register_post_type( 'projects', array(
"supports"=> array("title", "custom-fields"),
"public" => true,
"show_in_rest" => true,
"labels" => array(
"name" => "Proiecte",
"add_new_item" => "Add Project"
),
"menu_icon" => "dashicons-book-alt"
));
register_post_type( 'departments', array(
"supports"=> array("title", "custom-fields"),
"public" => true,
"show_in_rest" => true,
"labels" => array(
"name" => "Departamente",
"add_new_item" => "Add Department"
),
'has_archive' => true,
"menu_icon" => "dashicons-groups"
));
}
add_action('init', 'asmi_post_types');