Skip to content

Commit

Permalink
Change sizes of (default) labels & Add GatherPress (ugly WIP :( )
Browse files Browse the repository at this point in the history
  • Loading branch information
carstingaxion committed Oct 25, 2024
1 parent 604847d commit 6839c45
Show file tree
Hide file tree
Showing 3 changed files with 181 additions and 11 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"require": {
"figuren-theater/label-printing": "0.3.5",
"figuren-theater/theater-production-blocks": "0.2.0",
"figuren-theater/theater-production-subsites": "^0.1.1"
"figuren-theater/theater-production-subsites": "^0.1.1",
"wpackagist-plugin/gatherpress": "*"
},
"require-dev": {
"figuren-theater/code-quality": "^1.1"
Expand Down
168 changes: 166 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions inc/label-printing/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function is_network_admin;
use function is_user_admin;

const BASENAME = 'label-printing/plugin.php';
const BASENAME = 'label-printing/label-printing.php';
const PLUGINPATH = '/figuren-theater/' . BASENAME;
// const PLUGINPATH = '/wpackagist-plugin/' . BASENAME; // Not yet, see #6.

Expand All @@ -35,7 +35,6 @@ function bootstrap(): void {
* @return void
*/
function load_plugin(): void {

$config = Figuren_Theater\get_config()['modules']['theater'];
if ( ! $config['label-printing'] ) {
return;
Expand All @@ -48,7 +47,6 @@ function load_plugin(): void {
if ( is_network_admin() || is_user_admin() ) {
return;
}

require_once FT_VENDOR_DIR . PLUGINPATH; // phpcs:ignore WordPressVIPMinimum.Files.IncludingFile.UsingCustomConstant

add_filter(
Expand All @@ -65,7 +63,7 @@ function load_plugin(): void {
* @return array<int, array<string, string|int|float>>
*/
function filter_default_labels( array $default_labels ): array {

Check warning on line 65 in inc/label-printing/namespace.php

View workflow job for this annotation

GitHub Actions / call-workflow-build-test-measure / Lint: PHP

The method parameter $default_labels is never used

Check warning on line 65 in inc/label-printing/namespace.php

View workflow job for this annotation

GitHub Actions / call-workflow-build-test-measure / Lint: PHP

Unused function parameter $default_labels.
$default_labels = [
return [
[
'name' => 'A6 Landscape (4 Stück)',
'width' => 148,
Expand All @@ -84,8 +82,8 @@ function filter_default_labels( array $default_labels ): array {
],
[
'name' => 'HERMA Neon No. 5147 (8 Stück)',
'width' => 96,
'height' => 67,
'width' => 99,
'height' => 68,
'a4_border_tb' => 14,
'a4_border_lr' => 9,
'orientation' => 'portrait',
Expand All @@ -94,10 +92,17 @@ function filter_default_labels( array $default_labels ): array {
'name' => 'LABELident (64 Stück)',
'width' => 48,
'height' => 17,
'a4_border_tb' => 13,
'a4_border_tb' => 14, // 13 / 15 / 14
'a4_border_lr' => 8,
'orientation' => 'portrait',
],
[
'name' => 'AVERY 6122 (24 Stück)',
'width' => 70,
'height' => 36,
'a4_border_tb' => 14,
'a4_border_lr' => 7,
'orientation' => 'portrait',
],
];
return $default_labels;
}

0 comments on commit 6839c45

Please sign in to comment.