| 开发者 | erdincbulat |
|---|---|
| 更新时间 | 2026年8月27日 19:04 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
wp erdo-draft-links generate|revoke|list for scripting and automationerdo_draft_links_supported_post_types filter:
add_filter( 'erdo_draft_links_supported_post_types', function( $types ) { $types[] = 'product'; return $types; } );
Source Code
The full source code including build tools is included in the plugin's assets/js/src/ directory.
erdo-draft-links folder to the /wp-content/plugins/ directory.Yes. By default Erdo Draft Links supports posts and pages. Administrators can enable other public post types under Tools → Erdo Draft Links → Settings — no code required. Developers can also use the erdo_draft_links_supported_post_types filter, which takes precedence over the Settings tab.
Yes, via WP-CLI: wp erdo-draft-links generate <post_id> [--label=<label>] [--expiry=<24h|48h|7d|never>], wp erdo-draft-links revoke <link_id>, and wp erdo-draft-links list [--post_id=<id>] [--status=<all|active|expired|revoked>] [--format=<table|csv|json|yaml|count>].
Yes. Tokens are 32 characters of cryptographic randomness generated by WordPress's built-in wp_generate_password. The raw token appears in the URL only once — subsequent visits use a signed HttpOnly cookie. Tokens are stored as SHA-256 HMAC hashes in the database.
The recipient sees a clear message: "This draft link has expired and is no longer accessible." The post remains a draft — nothing is published.
Yes. Give each link an optional label (e.g. "Client A", "Designer") when you generate it, and each link gets its own expiry, view count, and can be revoked independently of the others.
Yes. Choose "Custom Date & Time…" from the expiry dropdown when generating a link and pick any future date and time, in addition to the 24 hour / 48 hour / 7 day / never presets.
Yes. The site admin email receives a notification the first time each link is opened. Repeat visits to an already-opened link don't send another email.
No. Erdo Draft Links is designed for draft and private posts. Password-protected posts use WordPress's own mechanism.
Erdo Draft Links only runs on requests that include a ?erdo_token= parameter or a valid session cookie. Normal site traffic is not affected.
wp erdo-draft-links generate|revoke|list.current_time('timestamp') with time() for correct UTC handling.