Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #1

Merged
merged 9 commits into from Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions .editorconfig
@@ -0,0 +1,26 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 4
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true

[*.json]
indent_style = space

[*.md]
trim_trailing_whitespace = false

[*.{bash,sh,zsh}]
indent_style = space
indent_size = 2
tab_width = 2

[*.{yaml,yml}]
indent_style = space
indent_size = 2
tab_width = 2
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
/vendor/
/wp-content/


!.gitkeep
22 changes: 13 additions & 9 deletions README.md
@@ -1,25 +1,29 @@
# AMF WordPress

Share a WordPress media library between blogs.

Use another WordPress site as source for your media library.

## About

AMF WordPress uses the [Asset Manager Framework](https://github.com/humanmade/asset-manager-framework) to set an external WordPress media library for your WordPress installation. This allows you to insert images anywhere they're used in WordPress, including Gutenberg, featured images, and the Customiser all from the same media library.

*Note:* Currently, whatever default blog is set will *replace* the local media library of any blog that activates the plugin. This is a limitation of AMF that we're working on fixing.
AMF WordPress uses the [Asset Manager Framework](https://github.com/humanmade/asset-manager-framework) (AMF) to use another WordPress site as media source for your WordPress installation.
This allows you to insert images anywhere they're used in WordPress, including the Block Editor, featured images, and the Customiser, all from the same media library.

**Note:** Currently, whatever WordPress site is set will **replace** the local media library of any site that activates this plugin.
This is a limitation of AMF that we're working on fixing.

## Installation

Download this plugin and [Asset Manager Framework](https://github.com/humanmade/asset-manager-framework), and activate both.
Install with [Composer](https://getcomposer.org):

```
composer require humanmade/amf-wordpress
```

## Settings

By default the plugin will use the current site's media library. This should be changed from **Settings > Media** by setting the full domain of the WordPress blog you'd like to use. This could be an external WordPress site or another site in a MultiSite installation.

By default the plugin will use the current site's media library.
This should be changed at **Settings > Media** by providing the URL of the WordPress site you'd like to use as media source.
This could be an external WordPress site or another site in a multisite installation.

## License

Copyright 2020 Human Made. Licensed under the GPLv2 or later.
Copyright 2021 Human Made. Licensed under the GPLv3 or later.
62 changes: 47 additions & 15 deletions composer.json
@@ -1,16 +1,48 @@
{
"name": "humanmade/amf-wpmultisite",
"description": "Share a WordPress media library between blogs in a multisite.",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Human Made",
"homepage": "https://humanmade.com/"
}
],
"require": {
"php": ">=7.2",
"humanmade/asset-manager-framework": "~0.6"
}
}
"name": "humanmade/amf-wordpress",
"description": "Use another WordPress site as source for your media library.",
"type": "wordpress-plugin",
"homepage": "https://github.com/humanmade/amf-wordpress",
"license": "GPL-3.0-or-later",
"authors": [
{
"name": "Human Made",
"homepage": "https://humanmade.com"
}
],
"support": {
"issues": "https://github.com/humanmade/orphan-command/issues"
},
"require": {
"php": ">=7.2",
"ext-json": "*",
"composer/installers": "^1.0",
"humanmade/asset-manager-framework": "^0.8.1"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"humanmade/coding-standards": "^1.1",
"squizlabs/php_codesniffer": "^3.5"
},
"autoload": {
"classmap": [
"inc"
],
"files": [
"inc/namespace.php"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"scripts": {
"lint": "find ./plugin.php ./inc/ -type f -name '*.php' -print0 | xargs -0 -L 1 -P 4 -- php -l",
"phpcs": "phpcs .",
"test": [
"@lint",
"@phpcs"
]
}
}