-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't see list of themes in backend now that I used a code snippet #251
Comments
if you want to use Enlighter outside of bbPress you have to set at least one theme. the empty array setting works for the TinyMCE plugin alone but not in conjunction with the Enlighter plugin (sorry for this - i'm testing the plugins standalone most of the time). |
That is why I was surprised that in the backend I could not choose a theme anymore. Maybe something else going on? |
I had to disable the code snippet so I could select the theme customizer. Maybe: I should set the option to only run it in the front end or something? Or is there a bug? But by deactivating the above code I was able to select a theme in the backend. Activating the code I could no longer select a theme. |
the issue is that the "customizer" theme is also an item within the array // list of build-in themes
const THEMES = array(
'enlighter' => 'Enlighter',
'godzilla' => 'Godzilla',
'beyond' => 'Beyond',
'classic' => 'Classic',
'mowtoo' => 'MooTwo',
'eclipse' => 'Eclipse',
'droide' => 'Droide',
'minimal' => 'Minimal',
'atomic' => 'Atomic',
'rowhammer' => 'Rowhammer',
'bootstrap4' => 'Bootstrap4',
'dracula'=> 'Dracula',
'monokai' => 'Monokai',
'wpcustom' => 'Theme Customizer'
); |
Ok, So what is the plan?
|
give me a few minutes.... but generally: without additional KSES filters it is not possible to suppress this (users can still edit the raw content) |
for your use case: you have to add some ACL related code to determine if the current user is admin/manager and if the request is related to the frontend/backend |
ACL related stuff is projected for the pro/enterprise editions only - sorry... (it requires a full rework of the TinyMCE plugin...) you can easily do it on your own by building a custom version of the TinyMCE plugin and hook into the enlighter_resource filter |
So I need to use this:
And add some wrapper logic to see if :
Right? |
theoretically...^^ snippets // frontend or dashboard area ?
if (is_admin()){}
// check frontend user privileges
$canEdit = is_user_logged_in() && (current_user_can('edit_posts') || current_user_can('edit_pages')); |
I will look into it. Got work tonight so it will be tomorrow on my staging site. The only other alternative was setting my snippet to only run in the front-end. If you look at the screen grab it has an option to run the snippet in backend or frontend or both. It is currently set to both. |
I don't think I am understanding this quite right:
Doh! I not downloaded your latest version. |
Looks like I am doing something wrong. It doesn't seem to work. But this seems complicated to me.
I had disabled the first snippet ( So I am getting confused. Now I have the themes show everywhere. Note that in bbPress the actions are |
your snippet above should work with the latest snapshot. you should not use the maybe your acl check is not correct. just try a simple clause with |
That works great - thanks. :) Noticed a typo in the comment |
Recently I added this code snippet:
That was based on our discussion here. The problem I have now discovered is in my backend:
I thought it would atleast show "Atomic" but it shows none.
The theme customizer still lists all of them.
Ideally the front-end will be stripped so the user can only use the chosen theme. But i thought the backend would show all of them incase I want to change my mind as to what the default theme is.
The text was updated successfully, but these errors were encountered: