Skip to content

Add WP_LANG_DIR constant#212

Merged
szepeviktor merged 1 commit intoszepeviktor:masterfrom
swissspidy:add/wp-lang-dir
Feb 26, 2024
Merged

Add WP_LANG_DIR constant#212
szepeviktor merged 1 commit intoszepeviktor:masterfrom
swissspidy:add/wp-lang-dir

Conversation

@swissspidy
Copy link
Copy Markdown
Contributor

Defined in wp_set_lang_dir().

There is no function to read this constant.

Related:

@szepeviktor
Copy link
Copy Markdown
Owner

szepeviktor commented Feb 26, 2024

There is no function to read this constant.

And you should not read that constant.

@szepeviktor szepeviktor merged commit 3a8e8a9 into szepeviktor:master Feb 26, 2024
@johnbillion
Copy link
Copy Markdown
Contributor

Should this go into dynamicConstantNames too?

@szepeviktor
Copy link
Copy Markdown
Owner

Should this go into dynamicConstantNames too?

No, this is always a non-empty string - PHPStan does not care what its value is.

@swissspidy swissspidy deleted the add/wp-lang-dir branch February 26, 2024 13:54
@szepeviktor
Copy link
Copy Markdown
Owner

Pascal must have a special plugin that is fiddling with translations...

@swissspidy
Copy link
Copy Markdown
Contributor Author

Hehe just working on adding PHPStan to my Preferred Languages plugin :) swissspidy/preferred-languages#961

@gritdigital-mibu
Copy link
Copy Markdown

Having this issue with WP_CONTENT_DIR too. WP core just refers directly to the constant / no function to read. 🫠

@gritdigital-mibu
Copy link
Copy Markdown

There is WP_Filesystem_Base::wp_content_dir() but it's not available where I need it. Anyways, I'm rambling. 😅

@swissspidy
Copy link
Copy Markdown
Contributor Author

@gritdigital-mibu Feel free to submit a PR for WP_CONTENT_DIR :)

@westonruter
Copy link
Copy Markdown
Contributor

Feel free to submit a PR for WP_CONTENT_DIR :)

Proposed in #216

@szepeviktor
Copy link
Copy Markdown
Owner

@gritdigital-mibu You've got a new release.
https://github.com/szepeviktor/phpstan-wordpress/releases/tag/v1.3.4

@gritdigital-mibu
Copy link
Copy Markdown

Fab.! Ty ❤️

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.

5 participants