PluginProbe
Advanced Custom Fields (ACF®) / 5.8.6
Advanced Custom Fields (ACF®) v5.8.6
6.8.9 6.8.8 6.8.7 6.8.6 6.8.5 6.8.4 6.8.3 6.8.2 6.8.1 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 All 230 releases
advanced-custom-fields / includes / admin / admin.php

admin.php in Advanced Custom Fields (ACF®) 5.8.6, at includes/admin/admin.php

89 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
5 if( ! class_exists('acf_admin') ) :
6
7 class acf_admin {
8
9 /*
10 * __construct
11 *
12 * Initialize filters, action, variables and includes
13 *
14 * @type function
15 * @date 23/06/12
16 * @since 5.0.0
17 *
18 * @param n/a
19 * @return n/a
20 */
21
22 function __construct() {
23
24 // actions
25 add_action('admin_menu', array($this, 'admin_menu'));
26 add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'), 0);
27 }
28
29 /*
30 * admin_menu
31 *
32 * This function will add the ACF menu item to the WP admin
33 *
34 * @type action (admin_menu)
35 * @date 28/09/13
36 * @since 5.0.0
37 *
38 * @param n/a
39 * @return n/a
40 */
41
42 function admin_menu() {
43
44 // bail early if no show_admin
45 if( !acf_get_setting('show_admin') ) return;
46
47
48 // vars
49 $slug = 'edit.php?post_type=acf-field-group';
50 $cap = acf_get_setting('capability');
51
52
53 // add parent
54 add_menu_page(__("Custom Fields",'acf'), __("Custom Fields",'acf'), $cap, $slug, false, 'dashicons-welcome-widgets-menus', '80.025');
55
56
57 // add children
58 add_submenu_page($slug, __('Field Groups','acf'), __('Field Groups','acf'), $cap, $slug );
59 add_submenu_page($slug, __('Add New','acf'), __('Add New','acf'), $cap, 'post-new.php?post_type=acf-field-group' );
60
61 }
62
63
64 /*
65 * admin_enqueue_scripts
66 *
67 * This function will add the already registered css
68 *
69 * @type function
70 * @date 28/09/13
71 * @since 5.0.0
72 *
73 * @param n/a
74 * @return n/a
75 */
76
77 function admin_enqueue_scripts() {
78
79 wp_enqueue_style( 'acf-global' );
80
81 }
82 }
83
84 // initialize
85 acf()->admin = new acf_admin();
86
87 endif; // class_exists check
88
89 ?>