Code

Posts under the "Code" category

Remote database access

The WP Data Access API can be used to connect to local and remote databases. Here is a basic example which shows how to connect, perform a query and dump the query results on the screen.This code works similar for local and remote databases. A database must be...

CRUD Example

The following PHP code creates a fully functional CRUD page for table employees stored in a remote database named rdb:classicmodels. The page is added to the WordPress dashboard menu.To use a table stored in the WordPress database, just remove the wpdaschema_name...

Alternative search algorithm

Extended Search Algorithm (wpda-cdg-extensions) for WP Data Access was written by Charles Godwin. It is an alternative search algorithm that looks for the occurrence of each space delimited token in the search string rather than the default of just one string and...

wpda_construct_where_clause

WP Data Access version 3 allows you to add your own search logic through a filter named wpda_construct_where_clause. The search logic provided through this filter is used in all tools. To allow developers to add search logic for specific tables or columns only, the...

wpda_column_default

Filter wpda_column_default was added to influence the layout of list table columns. The filter works for all columns except the fist one. The first column holds the links to other actions.You can use this filter in combination with action hook wpda_after_list_table to...

wpda_wpdataaccess_prepare

Filter wpda_wpdataaccess_prepare allows developers to add their own html and javascript code to a Data Table.Parameters$html HTML code (may include JavaScript code) $schema_name Database schema name (database name) $table_name Database table name $pub_id ID $columns...

wpda_after_simple_form

Use action hook wpda_after_simple_form to add HTML and JavaScript after a data entry form. Argument $self contains a reference to your simple form instance, which allows you to interact with your data entry form through public members and methods.

wpda_before_simple_form

Use action hook wpda_before_simple_form to add HTML and JavaScript before a data entry form. Argument $self contains a reference to your simple form instance, which allows you to interact with your data entry form through public members and methods.

wpda_after_list_table

Use action hook wpda_after_list_table to add custom HTML and JavaScript after a list table.  Argument $self contains a reference to your list table instance, which allows you to interact with your list table through public members and methods.NoteYou can use this...