PHP code example of screenfeed / autowpdb

1. Go to this page and download the library: Download screenfeed/autowpdb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

screenfeed / autowpdb example snippets


use Screenfeed\AutoWPDB\Table;
use Screenfeed\AutoWPDB\TableUpgrader;

add_action( 'plugins_loaded', 'my_plugin_init' );

function my_plugin_init() {
	// Your class defining your custom DB table.
	$table_def = new MyCustomTableDefinition();

	// The upgrader: it will upgrade your DB table automatically if its version changes.
	$upgrader = new TableUpgrader( new Table( $table_def ) );
	$upgrader->init();
}