简体   繁体   中英

Wordpress plugin path configuration

I am working on a local environment and I am pulling down a plugin that has its own git repository that is linked to the production server (also staging server). The only problem is that the plugin folder itself is in a folder like so:

repository-folder
   real-plugin-folder

And my plugins directory looks like so:

plugins
    plugin1
    plugin2
    plugin3
    repository-folder
        real-plugin-folder
    plugin4

Is there a way to define a new path for this one particular plugin so that it will show up in my local environment and so I can edit it while keeping the plugin git repository structure in contact so I can push up to that repository? (some sort of path definition in wp-config.php?).

I think Git submodules might be the answer? But honestly I don't have time to tinker with it: https://git-scm.com/book/en/v2/Git-Tools-Submodules .

Why don't you just start your repo in "repository-folder" ? You don't need to follow the same parent folder in git.

I hope it helps you at least a clarification here

If you are on a Linux environment, setup a symlink for the plugin:

cd plugins
mkdir real-plugin-folder
ln -s respository-folder/real-plugin-folder/plugin.php real-plugin-folder/plugin.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM