Skip to content
πŸš€ Rapid Application Development with the App Builder

Adding Styled Buttons ​

Styled buttons have the same CSS styling as other app buttons (e.g., NEW ROW button, BULK ACTIONS button, etc.).

Styled buttons can be used in computed fields and hooks using the wpda.button() function. Use the callback to implement your own custom action.

✨ Example: Adding a Styled Button Using a Computed Field ​

js
wpda.button(
	"Buy For $ {:price}",
	(() => {
        // Implement your custom action here
        window.open("{:amazon_link}")
    })
)

πŸ“Œ The computed field must be of type Code.
πŸ“Œ Allow inline HTML must be enabled.

πŸ’‘ Screenshot Showing the Styled Buttons ​

WP Data Access - Styled Button Using a Computed Field

✨ Example: Adding a Styled Button Using a Hook ​

This example uses the customActionsStop hook, but the approach also works for other hooks.

js
((table) => {

	return wpda.button(
    	"⭐Special Offers⭐",
    	(() => {
            // Implement your custom action here
            window.open("https://my.special.offers/")
        })
    )

})

πŸ’‘ Screenshot Showing the Styled Button ​

WP Data Access - Styled Button Using a Hook