base, 'toplevel_page_borderless') === false) { return; } else { wp_enqueue_style('borderless_backend_style', BORDERLESS__URL . '/assets/styles/dashboard.min.css', array(), BORDERLESS__VERSION ); } } add_action( 'admin_menu', 'borderless_icon_fonts_submenu', 50 ); if ( ! function_exists( 'borderless_icon_fonts_submenu' ) ) { function borderless_icon_fonts_submenu() { $icon_manager_page = add_submenu_page( 'borderless.php', esc_html__( "Icon Fonts", "borderless" ), esc_html__( "Icon Fonts", "borderless" ), 'manage_options', 'borderless-fonts', 'borderless_custom_icons_menu' ); $Borderless_IF = new Borderless_IF; add_action('admin_print_styles-' . $icon_manager_page, array( $Borderless_IF, 'admin_scripts' ) ); } } add_submenu_page( 'borderless.php', esc_html__( 'System Info', 'borderless' ), esc_html__( 'System Info', 'borderless' ), 'manage_options', 'borderless-system-info', 'Borderless_System_Info', 99 ); } public function init_settings() { register_setting( 'settings_group', 'borderless' ); add_settings_section( 'borderless_section', '', false, 'borderless' ); add_settings_field( 'primary_color', __( 'Primary Color', 'borderless' ), array( $this, 'render_primary_color_field' ), 'borderless', 'borderless_section' ); add_settings_field( 'secondary_color', __( 'Secondary Color', 'borderless' ), array( $this, 'render_secondary_color_field' ), 'borderless', 'borderless_section' ); add_settings_field( 'tertiary_color', __( 'Tertiary Color', 'borderless' ), array( $this, 'render_tertiary_color_field' ), 'borderless', 'borderless_section' ); add_settings_field( 'text_color', __( 'Text Color', 'borderless' ), array( $this, 'render_text_color_field' ), 'borderless', 'borderless_section' ); add_settings_field( 'related_posts', __( 'Related Posts', 'borderless' ), array( $this, 'render_related_posts_field' ), 'borderless', 'borderless_section' ); } public function page_layout() { // Check required user capability if ( !current_user_can( 'manage_options' ) ) { wp_die( esc_html__( 'You do not have sufficient permissions to access this page.', 'borderless' ) ); } $current_user = wp_get_current_user(); $time = date('H'); $timezone = date('e'); $hi = __('Good Evening, ', 'borderless'); $avatar = wp_get_current_user(); if($time < '12'){ $hi = __('Good Morning, ', 'borderless'); }elseif($time >= '12' && $time < '17'){ $hi = __('Good Afternoon, ', 'borderless'); } // Admin Page Layout ?>
ID, 64 ); ?>

'.$current_user->display_name.''; ?>

' . "\n"; echo '

Settings

' . "\n"; echo '
' . "\n"; settings_fields( 'settings_group' ); do_settings_sections( 'borderless' ); submit_button(); echo '
' . "\n"; echo '
' . "\n"; echo '' . "\n"; ?>'; echo '' . __( 'Pick a primary color for the elements.', 'borderless' ) . ''; } function render_secondary_color_field() { // Retrieve data from the database. $options = get_option( 'borderless' ); // Set default value. $value = isset( $options['secondary_color'] ) ? $options['secondary_color'] : '#FF6819'; // Field output. echo ''; echo '' . __( 'Pick a secondary color for the elements.', 'borderless' ) . ''; } function render_tertiary_color_field() { // Retrieve data from the database. $options = get_option( 'borderless' ); // Set default value. $value = isset( $options['tertiary_color'] ) ? $options['tertiary_color'] : '#3FCC14'; // Field output. echo ''; echo '' . __( 'Pick a tertiary color for the elements.', 'borderless' ) . ''; } function render_text_color_field() { // Retrieve data from the database. $options = get_option( 'borderless' ); // Set default value. $value = isset( $options['text_color'] ) ? $options['text_color'] : ''; // Field output. echo ''; echo '' . __( 'Pick a text color for the elements.', 'borderless' ) . ''; } function render_related_posts_field() { // Retrieve data from the database. $options = get_option( 'borderless' ); // Set default value. $value = isset( $options['related_posts'] ) ? $options['related_posts'] : ''; // Field output. echo ' ' . __( '', 'borderless' ); echo '' . __( 'Related Posts.', 'borderless' ) . ''; } } new Borderless_Dashboard;