Skip to content

Add support for conditions #135

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

Open
sheabunge opened this issue Jul 5, 2022 · 2 comments
Open

Add support for conditions #135

sheabunge opened this issue Jul 5, 2022 · 2 comments
Assignees

Comments

@sheabunge
Copy link
Member

sheabunge commented Jul 5, 2022

One feature we have requested pretty often is the ability to choose exactly when a snippet is evaluated. This could encompass both where (i.e., post type, page type, etc) and when (logged in, administrator, specific users, etc).

While this can be easily achieved by including conditional tags in Functions snippets, it seems that people would find an interface control helpful, and it would be especially useful for snippets that don't allow for PHP code (CSS/JS snippets).

Conditions should work with all four snippet types: Functions, Content, Styles, Scripts.

Relevant topics

@nowrds
Copy link

nowrds commented Oct 16, 2022

It's really annoying to add code snippets to individual pages, posts, etc. because you always have to edit them there and have no overview or control in the plugin itself. Conditionally adding snippets within the plugin in a clear interface is a must.

@sheabunge sheabunge self-assigned this Sep 6, 2024
@sheabunge sheabunge changed the title Add support for conditional tags Add a UI for conditions Dec 6, 2024
@sheabunge sheabunge changed the title Add a UI for conditions Add support for conditions Dec 6, 2024
@deckerweb
Copy link
Contributor

Yeah, a robust visually controlled conditions feature is really missing from "Code Snippets" for a long time already. Especially since you have content snippets it is a must to setup conditions for indivual post types, posts, etc. ---> I am able to do that all by myself that is not the problem. The issue here is: it is so much faster to click it visually and avoids typing errors for such stuff especially when you are in stress...

Also for the functions conditionals make sense but for content, css and js, it should be added very soon.

Further enhancement for Pro Version:
And for single posts and pages (and post types) you could add also snippets editor in the single edit view like WPCode does. – And you could then list those "Page Snippets" in the overview table with special markup so it is clearly seen as such a thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants