| 开发者 | douglaskarr |
|---|---|
| 更新时间 | 2026年11月26日 04:54 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
{post_title}, {permalink}, and {date} are replaced for each post.
How syncing works
drive.file scope. With it, the plugin can see and change only the files and folders it creates, so it creates its own folder for your Docs. If you need Docs written into a folder you made yourself, or one in a shared drive, you can switch to full Google Drive access (the drive scope) on the Google Connection tab.
Privacy and external services
This plugin connects to Google services, and only after an administrator sets up the connection. It does not contact any other service, and it never sends data to DK New Media.
dk-post-sync-for-google-docs folder to /wp-content/plugins/. Then go to Settings → DK Post Sync → Google Connection and copy the Authorized redirect URI. It looks like this:
https://example.com/wp-admin/admin-post.php?action=dknm_gdocs_oauth
Your site must use HTTPS, because Google accepts plain http redirect URIs only for localhost.
2. Set up Google Cloud
https://www.googleapis.com/auth/drive.file, or https://www.googleapis.com/auth/drive if you choose full Drive access.Your site talks to Google directly, with credentials you control. No third-party server sits in between, and you can revoke access at any time from your Google account or by clicking Disconnect.
Yes. Add these lines to wp-config.php, above the "That's all, stop editing!" line: define( 'DKNM_GDOCS_CLIENT_ID', 'your-client-id.apps.googleusercontent.com' ); define( 'DKNM_GDOCS_CLIENT_SECRET', 'your-client-secret' ); When they are defined, the matching fields on the Google Connection tab are locked.
When a consent screen is External and its publishing status is Testing, Google expires refresh tokens after 7 days. Use an Internal consent screen (Google Workspace) or publish the app, then reconnect.
With the recommended drive.file access, Google lets the plugin use only folders it created. Create the folder from the Settings tab, or switch to full Drive access on the Google Connection tab and reconnect.
Yes. The plugin tracks the folder by its ID, so renaming or moving it in Drive doesn't break syncing. To share the Docs, share the folder in Google Drive.
Published posts of the post type that are not password-protected. Drafts, private posts, and password-protected posts are never sent. If a post that has a Doc stops being public, its Doc moves to the Drive trash.
No. Disconnecting revokes the plugin's access at Google and stops syncing. Uninstalling also revokes access and removes the plugin's settings, the stored secret and token, the queue, and its post meta. Your Docs stay in Drive. If you reinstall and connect with the same OAuth client, the plugin finds each post's existing Doc again instead of creating a duplicate.
No. Saving a post only adds it to a queue. The Google requests run in the background through WP-Cron, or on the Sync tab while you have it open.
Yes. On Settings → DK Post Sync → Settings there is an optional HTML field prepended to the top of every synced Doc. Leave it blank if you do not want a header. Allowed tags are the same as in posts. You can include these placeholders, which are replaced for each post:
{post_title}
{permalink}
{date}
{date} uses the date format from Settings → General and the post's published date. After you change the header, click Sync All Posts on the Sync tab to update Docs that already exist.
drive.file scope by default, with optional full Drive access.