Skip to content
This repository was archived by the owner on Jun 15, 2022. It is now read-only.

Commit 96bea72

Browse files
committed
Add documentation and cleanup whitespace for the main plugin file.
1 parent 381657f commit 96bea72

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

wc-custom-order-table.php

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,40 @@
1313
* WC tested up to: 3.2.6
1414
*/
1515

16-
define('WC_CUSTOM_ORDER_TABLE_URL', plugin_dir_url(__FILE__));
17-
define('WC_CUSTOM_ORDER_TABLE_PATH', plugin_dir_path(__FILE__));
16+
/* Define constants to use throughout the plugin. */
17+
define( 'WC_CUSTOM_ORDER_TABLE_URL', plugin_dir_url( __FILE__ ) );
18+
define( 'WC_CUSTOM_ORDER_TABLE_PATH', plugin_dir_path( __FILE__ ) );
1819

20+
/* Load includes via a PHP 5.2-compatible autoloader. */
1921
if ( file_exists( WC_CUSTOM_ORDER_TABLE_PATH . 'vendor/autoload_52.php' ) ) {
20-
require( WC_CUSTOM_ORDER_TABLE_PATH . 'vendor/autoload_52.php' );
22+
require( WC_CUSTOM_ORDER_TABLE_PATH . 'vendor/autoload_52.php' );
2123
}
2224

25+
/**
26+
* Installation procedure for the plugin.
27+
*
28+
* This function is responsible for creating the new plugin database tables.
29+
*/
2330
function wc_custom_order_table_install() {
24-
$installer = new WC_Custom_Order_Table_Install();
25-
register_activation_hook( __FILE__, array( $installer, 'activate' ) );
31+
$installer = new WC_Custom_Order_Table_Install();
32+
register_activation_hook( __FILE__, array( $installer, 'activate' ) );
2633
}
2734

2835
register_activation_hook( __FILE__, 'wc_custom_order_table_install' );
2936

3037
/**
31-
* @return WC_Custom_Order_Table
38+
* Retrieve an instance of the WC_Custom_Order_Table class.
39+
*
40+
* If one has not yet been instantiated, it will be created.
41+
*
42+
* @global $wc_custom_order_table
43+
*
44+
* @return WC_Custom_Order_Table The global WC_Custom_Order_Table instance.
3245
*/
3346
function wc_custom_order_table() {
3447
global $wc_custom_order_table;
3548

36-
if( ! $wc_custom_order_table instanceof WC_Custom_Order_Table ) {
49+
if ( ! $wc_custom_order_table instanceof WC_Custom_Order_Table ) {
3750
$wc_custom_order_table = new WC_Custom_Order_Table;
3851
$wc_custom_order_table->setup();
3952
}

0 commit comments

Comments
 (0)