Appearance
Built-ins
Built-ins are pre-defined functions and features available for immediate use within your hooks. WP Data Access includes several types of built-ins, each with a specific scope and purpose.
Click on any built-in below to learn more about it.
Namespace wpda
Functions provided via the wpda namespace are globally available throughout the plugin and can be used in any hook.
wpda.log.[level](message)wpda.alert(title, message)wpda.button(label, callback)wpda.callService(action, args, callback, error)wpda.confirm(title, message, callback)wpda.snackbar(message, variant)
Context Object app
Functions accessed via the app context object (e.g., app.*) are scoped to their specific table context (master or detail). Please note:
- They are not available in the global scope.
- They return different results when called from a master table context versus a detail table context.
- The state of a master table cannot be modified from a detail context, and vice versa.
app.getUsername()app.userHasRole(role)app.setGlobalSearch(boolean)app.setColumnFilters(boolean)app.setInsert(boolean)app.setUpdate(boolean)app.setDelete(boolean)app.setInlineEditing({ [key]: boolean })app.setBulkActions({ [key]: boolean })
Named Functions
Some functions require direct access to specific data. These are injected into a hook via its parameters and are only accessible if explicitly included in the hook's parameter list.
getColumnValue(columnName)setColumnValue(columnName, columnValue)setColumnStyle(columnName, cssStyle)setColor(color, columnName)setBackgroundColor(color, columnName)setRowColor(color)setRowBackgroundColor(color)setValidationError(columnName, errorMessage)unsetValidationError(columnName)loadScript(fileName)loadStyle(fileName)
