How can I create a simple interface for my WP plugin?
Question
I’ve made a simple plugin to style the WP default backend.
<?php
/*
Plugin Name: Admin CSS
Description: Custom Admin style. Made by LOOT
Author: LOOT
Version: 1.2
Author URI: http://weareloot.com
*/
function admin_theme() {
wp_enqueue_style('admin_theme', plugins_url('adminstyle.css', __FILE__));
}
function topbarstyle() {
wp_enqueue_style('topbarstyle', plugins_url('topbarstyle.css', __FILE__));
}
add_action('admin_enqueue_scripts', 'admin_theme');
add_action('login_enqueue_scripts', 'admin_theme');
add_action('admin_enqueue_scripts', 'topbarstyle');
add_action('wp_head', 'topbarstyle' );
?>
Then I have a bunch of CSS files and some colours defined in the topbarstyle.css like this:
/* General Colours */
:root {
--color1: #f5f5f5;
--color2: #d8d7da;
--color-accent: #2748f3;
--color-dark: #23282d;
}
I’d want to implement a settings page where those colours can be modified.
I’m a total newbie in PHP and I’m trying to find resources, but thought I’d ask this over here as well
Thanks!
0
plugin-development, plugins, user-interface
3 years
2020-04-30T13:10:24-05:00
2020-04-30T13:10:24-05:00 0 Answers
81 views
0
Leave an answer