Skip to content

Add support for secondary placeholders for singular and plural specification in label autofill #921

@tw2113

Description

@tw2113

Originally from: #920

When translating auto-populated string values, we want to add support for returning either {{singular}} or {{plural}} instead of %s for placeholders. PHP won't throw a fit if no %s placeholder is returned, with the replacement value still provided. It would if the replacement value wasn't provided.

So in our javascript, we need to amend the section linked below, to first check for {{singular}} or {{plural}} first and if either of those exist, replace appropriately OTHERWISE just use what we have now with checking the if ( 'plural' === plurality ) { etc.

Make sure the description/helper text reflects the availability for these placeholders.

https://github.com/WebDevStudios/custom-post-type-ui/blob/1.13.4/src/js/cptui-scripts.js#L259-L274

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions