Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#61775 closed feature request (reported-upstream)

Link Field for Javascript Functions

Reported by: gabriel1957 Owned by:
Priority: normal Milestone:
Component: Editor Version:
Severity: normal Keywords:
Cc: Focuses:

Description

I am hoping that your WordPress team can add a “trigger javascript function” option that would allow users to enter a given javascript function into the URL text field. I can add that functionality in the CODE VIEW, but I believe adding this as an option in the LINK field would be a great tool. (If such an option already exists, how do I access it?)

https://groovdigit.com/wp-content/uploads/2024/07/link-field.png
https://groovdigit.com/wp-content/uploads/2024/07/link-script.png

Thanks for your help! Best wishes, Gabriel

Change History (1)

#1 @sabernhardt
2 years ago

  • Component GeneralEditor
  • Milestone Awaiting Review
  • Resolutionreported-upstream
  • Status newclosed

Hi and welcome to WordPress Core Trac!

I'll close this as 'reported-upstream' because you already opened a Gutenberg issue.
https://github.com/WordPress/gutenberg/issues/64068

However, a button element would be more appropriate for changing content on the page.
<button onclick="changeColor()">Change to Blue</button>
https://www.freecodecamp.org/news/html-button-onclick-javascript-click-event-tutorial/

Note: See TracTickets for help on using tickets.