Comments (7)
Hi @wujekbogdan
Where is wp-content/plugins
created in your case?
I wonder if it's because I've "type":"wordpress-plugin"
in the composer.json
?
from geo-query.
Where is wp-content/plugins created in your case?
wp-content/plugins
is created in the same directory where composer install
command is executed.
├─── composer.json
├─── vendor
└─── wp-content
└─── plugins
└─── geo-query
I wonder if it's because I've
"type":"wordpress-plugin"
in thecomposer.json
?
You are probably right, this is a composer/installers feature. Here's an article on this topic.
from geo-query.
Thanks for the links.
I already require composer/installers
, so maybe you could change the installer-paths
, in the extra
section, in your main composer.json
file? Something like:
{
"extra": {
"installer-paths": {
"your/custom/path/{$name}/": ["birgir/geo-query"]
}
}
}
https://github.com/composer/installers
https://getcomposer.org/doc/faqs/how-do-i-install-a-package-to-a-custom-path-for-my-framework.md
from geo-query.
I already require composer/installers
Yes, I know. But maybe you shouldn't use it? What's the benefit of using it? It looks like the installer causes that "issue".
Thanks for the installer-path
tip. I'll use it as a workaround. But IMO it would be better if no additional effort was needed in order to install birgir/geo_query
as a composer dependency.
from geo-query.
I have now added birgir/geo-query
as a package on packagist.com:
https://packagist.org/packages/birgir/geo-query
I just created a test plugin, that uses birgir/geo-query
as a dependency.
The test plugin has the following composer.json
file:
{
"name": "birgir/test-plugin",
"require": {
"birgir/geo-query": "~0.0.5"
},
"extra": {
"installer-paths": {
"vendor/{$name}/": ["birgir/geo-query"]
}
}
}
This seems to work as expected and generates:
composer.json
composer.lock
vendor/
autoload.php
composer/
birgir/
geo-query/
instead of
composer.json
composer.lock
vendor/
autoload.php
composer/
wp-content/
plugins/
geo-query/
If I would not use the "wordpress-plugin" type and the composer/installers
, what options would we have to install it to wp-content/plugins
from a main site composer.json
?
Maybe I should try and look for a WordPress plugin that is used both as a vendor library and a plugin, to see how it's usually done. (don't remember such a plugin at the moment)
ps: I'm just trying to understand the limitations and avoid "burning" any bridges ;-)
from geo-query.
Thank you very much. I'll add an extra
entry to my composer.json
file for now. It's a workaround, but I can live with that :)
If I would not use the "wordpress-plugin" type and the composer/installers, what options would we have to install it to wp-content/plugins from a main site composer.json?
Sadly I have no idea and I'm afraid I can't help you. I'm just a Composer user. I never made a composer public package.
You can try to have a look at Timber (a great tool by the way), they have a composer-compatible version and a WordPress plugin too.
from geo-query.
great, thanks @wujekbogdan I've heard about Timber but not used it.
I will checkout Timber and try to learn how they do it.
I will mark this thread as resolved in the meanwhile ;-)
Thanks for the heads up, I learned from it ;-)
from geo-query.
Related Issues (18)
- Installation within a theme HOT 1
- Setting up but posts displaying as normal or white screen HOT 5
- Is it possible to query using lat/lon in one meta field? HOT 1
- 0 results when radius < 1 HOT 4
- Move the order parameter out of geo_query part of WP_Query
- Support custom database tables to get full speed optimization HOT 3
- Add support for pre_get_posts HOT 20
- geo-query is not compatible with composer/installers newer than ~1.0.0 HOT 3
- GeoQueryUserHaversine returns 0 results when order argument is used HOT 3
- 404 Error in get_pre_posts Callback HOT 2
- Using in conjunction with multiple meta queries in REST url HOT 3
- Retrieve distance information for an item HOT 2
- Add support for polygon/shape/region HOT 3
- pre_get_posts not working HOT 2
- Structure query to search ACF Google Map fields in a Repeater field saved to a User HOT 1
- WordPress database error: [Unknown column 'settings.distance_unit' in 'field list'] HOT 5
- Deprecated notice in PHP 8.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geo-query.