Skip to content

Commit

Permalink
update hooks docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kilbot committed Jan 29, 2024
1 parent 02cfe23 commit 0ec7d08
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions includes/Abstracts/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Store extends \WC_Data {
* Construct the default POS store.
*/
public function __construct() {
parent::__construct();
$this->set_wordpress_settings();
$this->set_woocommerce_general_settings();
$this->set_woocommerce_tax_settings();
Expand Down
5 changes: 4 additions & 1 deletion includes/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ public function admin_menu(): void {
* @param \WP_Screen $current_screen Current screen object.
*/
public function current_screen( $current_screen ): void {
/**
/**
* Backwards compatibility for WooCommerce POS Pro 1.4.2 and below.
* DO NOT USE THIS!
*
* @TODO: Remove in WooCommerce POS 2.0.0.
*/
Expand All @@ -114,6 +115,8 @@ public function current_screen( $current_screen ): void {
/**
* Filters the screen handlers for WooCommerce POS admin screens.
*
* @hook woocommerce_pos_admin_screen_handlers
*
* @since 1.4.10
*
* @param array $handlers Associative array of screen IDs and their corresponding handlers.
Expand Down
6 changes: 3 additions & 3 deletions includes/Admin/Notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public function admin_notices(): void {
/**
* Filters the POS admin notices.
*
* @param {array} $notices
* @since 1.0.0
*
* @returns {array} $notices
* @param array $notices
*
* @since 1.0.0
* @return array $notices
*
* @hook woocommerce_pos_admin_notices
*/
Expand Down
7 changes: 5 additions & 2 deletions includes/Services/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,12 @@ public function get_general_settings(): array {
/*
* Filters the general settings.
*
* @param {array} $settings
* @returns {array} $settings
* @since 1.0.0
*
* @param array $settings
*
* @return array $settings
*
* @hook woocommerce_pos_general_settings
*/
return apply_filters( 'woocommerce_pos_general_settings', $settings );
Expand Down
10 changes: 5 additions & 5 deletions includes/wcpos-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ function woocommerce_pos_locate_template( $template = '' ) {
/*
* Filters the template path.
*
* @param {string} $template
* @param {string} $path
*
* @returns {string} $path
* @hook woocommerce_pos_locate_template
*
* @since 1.0.0
*
* @hook woocommerce_pos_locate_template
* @param string $path The full path to the template.
* @param string $template The template name, eg: 'receipt.php'.
*
* @return string $path The full path to the template.
*/
$filtered_path = apply_filters( 'woocommerce_pos_locate_template', $path, $template );

Expand Down

0 comments on commit 0ec7d08

Please sign in to comment.