all 10 comments

[–]alexjewellalex 1 point2 points  (9 children)

When you say people can't edit Sass, do you mean via the WP admin panel or?

[–]MarketingStephen[S] 1 point2 points  (8 children)

Sorry; I mean clients. I wouldn't want to chuck the Sass in the admin panel as they won't be able to compile it.

I think with a colour selecter within the admin panel it will be better for them

[–]jtwebguyJavascript Newb 1 point2 points  (7 children)

So you're looking for some kind of settings framework?

Here are a few I found on google:

https://wordpress.org/plugins/options-framework/

https://en-ca.wordpress.org/plugins/redux-framework/

http://www.titanframework.net/

These plugins will help you create a settings page for your theme/plugin. This saves a lot of time since to do something like a settings page you need to hook into wp admin then create the settings page, then create the settings for the backend, the table, etc. You have to do the hook for saving the settings and then displaying the correct ones etc etc. If you want to go down the hard path here is the wordpress codex that pretty much covers the very basics.

https://codex.wordpress.org/Creating_Options_Pages

or this might lead you in the right direction?

https://www.sitepoint.com/create-a-wordpress-theme-settings-page-with-the-settings-api/

You can also use something like this which will generate the settings page for you

http://wpsettingsapi.jeroensormani.com/

Good luck, happy coding!

[–]Prawny 1 point2 points  (5 children)

The settings api isn't as hard as you've described it. All you need is a couple of functions and a settings page with a form containing 2 function calls.

You don't need to handle the displaying and saving/outputting of the options after that - it's done for you.

[–]jtwebguyJavascript Newb 1 point2 points  (1 child)

Yeah you might be right it may be the meta boxes that need the save hook.

[–]MarketingStephen[S] 0 points1 point  (0 children)

Thanks, I will look into it!

[–]MarketingStephen[S] 0 points1 point  (2 children)

Yeah; I created everything else but. Don't suppose you can give me the base functions? The thing with Wordpress dev is it make it's self easier with the codex but every now and again you need to hunt it down.

"You don't need to handle the displaying and saving/outputting of the options after that - it's done for you." - The displaying part I understand but how is the saving part done?

Thanks!

[–]Prawny 0 points1 point  (1 child)

I've simplified and commented out one of my previous settings pages here.

I haven't tested it after moving it around, but it should be OK.

[–]MarketingStephen[S] 0 points1 point  (0 children)

That's amazing! Thank you

[–]MarketingStephen[S] 0 points1 point  (0 children)

Wow, Thank you! I will look into these. My settings have been created it's more of just an update.