Skip to content

Add configurable Quick Create mode for translations #608

@apermo

Description

@apermo

Description

Add a configurable Quick Create mode for the "create new translation" button. Instead of opening post-new.php in a new tab, this mode creates the translation post silently via a REST API call without leaving the current post, then updates the metabox UI in place.

#606 depends on this and will continue once this is merged.

Configuration

New checkbox in the Advanced Settings section (next to "Autocomplete"):

  • Label: Quick Create
  • Description: Create translations without leaving the current post

When disabled (default), the button behaves as before (Classic mode). When enabled, the button triggers an AJAX call instead of opening a new tab.

Quick Create behavior

  1. User clicks the "+" button for a language
  2. REST API call creates a draft post on the target blog with:
    • Title: From [LANG]: {original title}
    • Content: From [LANG]: {original content}
    • Mapped categories and tags assigned automatically
    • MSLS link established between source and new post
  3. On success, the metabox row updates in place — shows the edit link, hides the create button

REST API endpoint

Use register_rest_route() under the plugin namespace instead of admin-ajax.php:

  • Route: msls/v1/create-translation (or similar)
  • Method: POST
  • Auth: WordPress REST API nonce / cookie authentication
  • Parameters: source post ID, source blog ID, target blog ID
  • Response: new post ID, edit URL
  • Permission callback: capability check (edit_posts on target blog)

Filter hooks

Every piece of data should be filterable so developers can customize the creation pipeline:

  • Post data — title, content, excerpt, status (before wp_insert_post)
  • Taxonomies — which terms to assign, mapping logic
  • Post meta — allow adding custom meta during creation
  • Response — allow extending the returned data

Scope

Handled by default:

  • Post title and content with language prefix
  • Mapped categories and tags
  • MSLS link creation
  • Metabox UI update

Not handled by default, but extensible via filters:

  • Post meta and custom fields
  • Custom taxonomies beyond categories/tags
  • Featured image mapping
  • Embedded image duplication

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions