Skip to content

Commit 973593e

Browse files
committed
Documentation updates.
1 parent 0a1c3a4 commit 973593e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

wc-api-custom-meta.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ class Academe_Wc_Api_Custom_Meta
6262
);
6363

6464
/**
65-
* Initialise the hooks at plugin initialisation.
65+
* Initialise all hooks at plugin initialisation.
66+
* It may be worth registering the hooks in two layers, so we
67+
* first check we have the capability and that WooCommerce is
68+
* installed, before registering the remaining hooks. Also can
69+
* check if we are being invoked by the WC API, as there is no
70+
* point registering these API hooks if we aren't.
6671
*/
6772
public static function initialize()
6873
{
@@ -86,7 +91,8 @@ public static function initialize()
8691
}
8792

8893
/**
89-
* Fetch a product.
94+
* Fetching a product detail.
95+
* Add in the custom meta fields if we have the capability.
9096
*/
9197
public static function fetchCustomMeta($product_data, $product, $fields, $server) {
9298
// The admin and shop manager will have the capability "manage_woocommerce".

0 commit comments

Comments
 (0)