New: migrate from Elementor Pro custom code to Code Snippets#346
Draft
rami-elementor wants to merge 1 commit intocore-betafrom
Draft
New: migrate from Elementor Pro custom code to Code Snippets#346rami-elementor wants to merge 1 commit intocore-betafrom
rami-elementor wants to merge 1 commit intocore-betafrom
Conversation
Contributor
Author
|
The imported generated with AI, but it's not yet ready for merge. The locations should be tweaked, they are not imported as intended. |
Contributor
|
@rami-elementor The scope gap might not be something we can fix within his PR alone - it requires a change to Code Snippets core - adding a |
Contributor
|
@rami-elementor Coming to think of it, I also had some other locations in the other plugins that were not supported, so I skipped them. But we can definitely add a backlog task to support more locations in Code Snippets. |
louiswol94
reviewed
Apr 14, 2026
| public function create_snippet( array $snippet_data, bool $multisite ): ?Snippet { | ||
| $kind = $snippet_data['code_kind'] ?? ''; | ||
|
|
||
| if ( ! in_array( $kind, [ 'html', 'css', 'js' ], true ) ) { |
Contributor
There was a problem hiding this comment.
Suggested change
| if ( ! in_array( $kind, [ 'html', 'css', 'js' ], true ) ) { | |
| if ( ! in_array( $kind, [ 'html' ], true ) ) { |
CSS and JS should be in Pro only.
louiswol94
reviewed
Apr 14, 2026
Comment on lines
+177
to
+185
| if ( 'html' === $kind ) { | ||
| return 'head-content'; | ||
| } | ||
| if ( 'css' === $kind ) { | ||
| return 'site-css'; | ||
| } | ||
| if ( 'js' === $kind ) { | ||
| return 'site-head-js'; | ||
| } |
Contributor
There was a problem hiding this comment.
Suggested change
| if ( 'html' === $kind ) { | |
| return 'head-content'; | |
| } | |
| if ( 'css' === $kind ) { | |
| return 'site-css'; | |
| } | |
| if ( 'js' === $kind ) { | |
| return 'site-head-js'; | |
| } | |
| if ( 'html' === $kind ) { | |
| return 'head-content'; | |
| } |
Same here
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Elementor custom code:
Code Snippets Importer:
Code Snippets: