Make WordPress Core

Opened 8 weeks ago

Closed 7 weeks ago

#61775 closed feature request (reported-upstream)

Link Field for Javascript Functions

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

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
7 weeks ago

  • Component changed from General to Editor
  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

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.