Skip to content

Fix posts_per_page argument to be absint - #41

Open
Dade88 wants to merge 1 commit into
proelements:masterfrom
Dade88:master
Open

Dade88 wants to merge 1 commit into
proelements:masterfrom
Dade88:master

Conversation

@Dade88

@Dade88 Dade88 commented Aug 6, 2026

Copy link
Copy Markdown

Fix: Cast posts_per_page to integer in Product Related widget

Description:
$args['posts_per_page'] is sanitized via sanitize_text_field() prior to querying related products, converting the value to a string (e.g., "4"). This triggers a WooCommerce warning/error log: Invalid limit type passed to wc_get_related_products. Expected integer, got string.

Solution:
Wrapped $args['posts_per_page'] with absint() when passing it to wc_get_related_products() to ensure strict type compliance.

### Fix: Cast `posts_per_page` to integer in Product Related widget

**Description:**
`$args['posts_per_page']` is sanitized via `sanitize_text_field()` prior to querying related products, converting the value to a string (e.g., `"4"`). This triggers a WooCommerce warning/error log: `Invalid limit type passed to wc_get_related_products. Expected integer, got string`.

**Solution:**
Wrapped `$args['posts_per_page']` with `absint()` when passing it to `wc_get_related_products()` to ensure strict type compliance.
@BackuPs

BackuPs commented Aug 6, 2026

Copy link
Copy Markdown

drop at elementor as this repository is not supported by its developer.

@Dade88

Dade88 commented Aug 7, 2026

Copy link
Copy Markdown
Author

I would but this is an Elementor Pro widget/feature, are they hosting it somewhere or you mean to plain contact them?

@BackuPs

BackuPs commented Aug 7, 2026

Copy link
Copy Markdown

ProElements is a 100% (One on One) copy of elementor pro without any support as stated on the proelements developers website. https://proelements.org/

So if you want to have your issues fixed you need to buy elementor pro and use your account to get support or drop it at elementor (pro) at github.

afbeelding

@oliversafo-creator

Copy link
Copy Markdown

Atomic Elements - create component and Custom CSS not working wit Pro Elements.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants