admin_url('admin-ajax.php'), 'rest_url' => esc_url_raw( rest_url() ), 'rest_nonce' => wp_create_nonce( 'wp_rest' ), 'nonce' => wp_create_nonce('alba_move_card_nonce'), 'get_card_details_nonce' => wp_create_nonce('alba_get_card_details_admin'), 'save_card_details_nonce' => wp_create_nonce('alba_save_card_details_admin'), 'upload_attachment_nonce' => wp_create_nonce('alba_upload_attachment_nonce'), 'delete_attachment_nonce' => wp_create_nonce('alba_delete_attachment_nonce'), 'delete_list_nonce' => wp_create_nonce('alba_delete_list_nonce'), 'manage_card_archive_nonce' => wp_create_nonce('alba_manage_card_archive'), 'trash_card_nonce' => wp_create_nonce( 'alba_trash_card' ), 'trash_card_confirm' => __( 'Move this card to Trash? You can restore it from Alba Board > Cards > Trash.', 'alba-board' ), 'trash_card_error' => __( 'Could not move this card to Trash. Please try again.', 'alba-board' ), 'move_list_nonce' => wp_create_nonce('alba_move_list_nonce'), 'current_user_id' => get_current_user_id(), 'can_edit_others_cards' => current_user_can('edit_others_cards'), 'can_move_cards' => current_user_can('edit_cards') || current_user_can('edit_others_cards'), 'can_move_lists' => current_user_can('edit_lists') || current_user_can('edit_others_lists'), 'loading' => __('Loading...', 'alba-board'), 'uploading' => __('Uploading...', 'alba-board'), 'fetch_error' => __('Error communicating with server.', 'alba-board') ]); } add_action('admin_enqueue_scripts', 'alba_board_enqueue_admin_assets'); /** The sidebar icon is present throughout wp-admin, including Settings. */ function alba_board_enqueue_sidebar_style() { if ( ! current_user_can( 'edit_cards' ) ) return; $path = plugin_dir_path( dirname( __FILE__ ) ) . 'assets/css/alba-admin-sidebar.css'; wp_enqueue_style( 'alba-admin-sidebar', plugin_dir_url( dirname( __FILE__ ) ) . 'assets/css/alba-admin-sidebar.css', [], (string) filemtime( $path ) ); } add_action( 'admin_enqueue_scripts', 'alba_board_enqueue_sidebar_style' );