Skip to content

Commit

Permalink
docs: fix wrong usage example on README
Browse files Browse the repository at this point in the history
  • Loading branch information
sectsect committed Jun 15, 2024
1 parent bd25b9d commit 3c7f26d
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,21 @@ add_filter( 'google_ss2db_before_save', function ( $row, $worksheetid, $workshee

And also use `add_filter('google_ss2db_after_save', $return_array )` to perform any processing with the return value.
```php
add_filter( 'google_ss2db_after_save', function ( $array ) {
if ( 'My Spreadsheet' === $worksheetname ) {
// $id = $array['id'];
// $date = $array['date'];
// $title = $array['title'];
// $value = $array['value'];
// $work_sheet_id = $array['worksheet_id'];
// $work_sheet_name = $array['worksheet_name'];
// $sheet_name = $array['sheet_name'];
// $result = $array['result'];

// Do something...
$return = $something;
} else {
$return = $array;
add_filter( 'google_ss2db_after_save', function ( $data ) {
if ( 'My Spreadsheet' === $data['worksheet_name'] ) {
// $id = $data['id'];
// $date = $data['date'];
// $title = $data['title'];
// $value = $data['value'];
// $work_sheet_id = $data['worksheet_id'];
// $work_sheet_name = $data['worksheet_name'];
// $sheet_name = $data['sheet_name'];
// $result = $data['result'];

// Example
my_callback( $data );
}

return $return;
} );
});
```

## APIs
Expand Down

0 comments on commit 3c7f26d

Please sign in to comment.