| 开发者 |
4wpdev
anatolikkk |
|---|---|
| 更新时间 | 2026年9月20日 22:30 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
incoming/, editors review them on the admin Incoming screen, and approved content becomes draft posts or updates existing posts and pages—without copy-paste. Analytics stores import history (folder alias, site slug, incoming → published) for drafts and published posts.
A plugin by 4wp.dev.
Learn more, workflow details, and comparisons on the plugin page at 4wp.dev/plugin/4wp-drive/.
Perfect for
incoming/ folder and a review step before publishincoming/ and published/ subfolders. GitHub: set the repo and incoming path (default incoming/).incoming/ (Google Doc, Markdown, or Word on Drive; Markdown on GitHub) or run Sync.published/. Open Analytics to see history (drafts and published).incoming/ for Google Docs, Markdown, Word, and images (Drive) or Markdown packages (GitHub)[image:file.png left])--- or =====) map to post fields; body becomes post content (headings, lists, bold preserved)[image:filename.jpeg] with core/image from the package folderwp forwp-drive sync for manual syncsrc/ (PSR-4 autoload via src/Autoload.php when vendor/ is absent). No npm build step — admin scripts ship as plain JS in assets/.
Run tests: composer install && composer test && composer run lint
/wp-content/plugins/4wp-drive/ or install from the Plugins screen.FORWP_DRIVE_GOOGLE_CLIENT_ID, FORWP_DRIVE_GOOGLE_CLIENT_SECRET, or FORWP_DRIVE_OAUTH_REDIRECT_URI in wp-config.php.During Sync, Drive downloads each article as HTML (Google Docs export, Word conversion, or Markdown download). Export errors is how many of those downloads failed on the last sync — not a WordPress import failure. Click the chip to see file names and Google’s message (quota, permissions, unsupported type, or a broken Doc). The package can still sit in the queue; yellow labels mark it. Fix the file in Drive and Sync again.
Yes. Create OAuth 2.0 credentials (Web application), enable the Google Drive API, and register the redirect URI shown in the plugin Documentation tab.
Google Docs in incoming/ (single doc or subfolder with doc + image). Front-matter uses Label: value lines before a separator paragraph (--- or a row of = characters). The rest is post body.
No. OAuth and Drive requests run on the server. Only administrators with manage_options can connect Drive and import.
Yes. Use FORWP_DRIVE_GOOGLE_CLIENT_ID and FORWP_DRIVE_GOOGLE_CLIENT_SECRET constants.
Yes. Use the OAuth redirect (local) field when Google rejects your site hostname; register the same loopback URI in Google Cloud Console.
Yes. In Incoming → Preview, choose Update existing post, search or pick a target, and confirm. The document content is imported into that post. Use Import as Draft when you want a new post instead.
The plugin updates title, content, mapped categories/tags, SEO meta (when configured), and featured image (when the Drive folder includes an image). Optional front-matter date updates post_date when present. The post slug and status (published, draft, etc.) stay as they were unless your site or other plugins change them.
Only posts of the configured import post type (for example Posts or Pages under Document template). Targets must be posts you can edit (edit_post). Published, draft, pending, private, and scheduled posts are supported. The picker can suggest a match by document slug or title before you search.
You must select a target and confirm before import. If the slug or title in the document matches an existing post, the plugin may suggest that post first—you still choose explicitly. Always preview the document before updating production content.
It works with whichever post type you set as the import type in Document template. Switch the import type to Page (or another public type with editor support) to update pages instead of posts. The target must match that same type.
Polylang (1.2.0): When more than one language is configured, open Incoming → Preview & import and select Content language before import (no default). New drafts receive that language; Update existing post lists and validates targets in the selected language only. Language is not read from Drive folder names. WPML: Shown as Planned under Settings → Multilingual integration; not used for import in this release. Single-language sites (no Polylang) behave as before — no language picker in Incoming.
Yes in this release. Set Incoming path in GitHub settings (default incoming). Each article is a subfolder with a .md file plus images. After import the same tree is moved to published/.
4WP Drive only reads and writes the owner/repo you configured. A classic PAT with repo can still access other repositories on that GitHub account. Use a fine-grained token limited to this repository (Contents: Read and write) if you want a narrow token.
4WP Drive → Analytics. Each import stores source, date, post, folder alias, site slug, and incoming/published paths. Restore to incoming moves the published package back; then Sync Incoming. History starts after upgrading to 1.5.0 (older imports are not backfilled). You do not need to reactivate the plugin.
4WP Drive → Settings → Storage sources — scroll to Multilingual integration. Cards show Polylang (live), WPML (planned), and single-language fallback, with status badges (Active, Inactive, Not installed, Planned).
[image:file.png left]. Markdown  in the same folder still becomes the same marker.Family_Plugin_Catalog, filter forwp_drive_family_plugins). Cards stay visible when a plugin is missing: Get plugin / Activate. Active plugins expose editable H2 wrap titles.forwp/faq accordion. Pin/unwrap in Incoming; skip nested wrap badges.const marker.incoming, published, failed) open when they contain child folders. Shortcuts and shared-drive items are listed. Empty folders fetch children on expand.====== split and import as Gutenberg core/table (cells are no longer dumped as paragraphs like “Risk Zone”).forwp-drive-inbox slug).incoming/ packages accept .md / .markdown as the article (preferred over Google Doc / Word when several files sit in the folder). Pick which document to import. in the same folder becomes [image:file.png].incoming/, import Markdown packages, move to published/failed, sideload package images.incoming/ subfolder, show doc/image counts, file names, and Open folder (after Sync).[image:filename.jpeg] markers sideload from the package folder into core/image blocks on import.forwp/faq + core accordion (requires 4WP FAQ plugin).core/accordion only (no FAQ wrapper).language on document import; lang on import-targets; multilingual payload on inbox, preview, settings, and targets.Language_Provider_Interface, Language_Provider_Registry, Import_Language_Resolver; filter forwp_drive_language_providers. WPML provider class kept; not enabled for import until a future release.Post_Creator::update_existing() and Import_Target_Resolver for safe target validation.