• Resolved AGriboed

    (@agriboed)


    Hello!
    I have multilanguage site, and in my custom post type in admin i’m use translations. For this i need fix code in plugin after each update. Please, fix this in plugin:
    custom-post-type-ui.php
    line 295

    if ( ! empty( $label ) ) {
    			$labels[ $key ] = <strong>__($label);</strong>
    		} elseif ( empty( $label ) && in_array( $key, $preserved ) ) {
    			$labels[ $key ] = cptui_get_preserved_label( 'post_types', $key, $post_type['label'], $post_type['singular_label'] );
    		}

    Thanks!
    With best regarts.

    https://www.ads-software.com/plugins/custom-post-type-ui/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter AGriboed

    (@agriboed)

    Sorry,
    this piece
    __($label);

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hello.

    If we were to make that change, we would be affecting everyone, and this is not something that necessarily everyone wants done with their own sites.

    From the best I can tell, you’re adding a <strong> tag to the label, and also passing it through a gettext filter. Instead of editing our file every time we push out an update, the following filter would be a better available option for you

    $args = apply_filters( 'cptui_pre_register_post_type', $args, $post_type['name'], $post_type );

    We pass all of the arguments for each post type through this filter right before we register it, including the labels you’re overwriting and translating. You could safely override those labels with your own using this without having to re-change it each time and without us changing for everyone.

    Hope that helps and spurs on some ideas for you.

    Thread Starter AGriboed

    (@agriboed)

    I need only to translate my labels in custom post types.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    That filter is going to be your best friend here, without me changing this one thing for everyone, and it’ll save you from updating every single time we push out a new update.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Please, add one small fix :)’ is closed to new replies.