Support » Developing with WordPress » first parameter of wp_add_privacy_policy_content()

  • Resolved nlpro

    (@nlpro)


    Is it:

    wp_add_privacy_policy_content( 'Plugin Name', $content ); //Option 1

    or:

    wp_add_privacy_policy_content( __( 'Plugin Name', 'text_domain' ), $content ); //Option 2

    WordPress by the way uses Option 2 ( __( ‘WordPress’ ) ).

    But Code Reference for wp_add_privacy_policy_content() is inconclusive.

    And the example code for “Suggesting text for the site privacy policy” in the Plugin Handbook uses ‘Example Plugin’ … (Option 1).

    • This topic was modified 2 weeks ago by nlpro.
    • This topic was modified 2 weeks ago by nlpro.
    • This topic was modified 2 weeks ago by nlpro.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator bcworkz

    (@bcworkz)

    Either will work. Usage depends on whether you intend to have your plugin’s strings translated or not. ‘Plugin Name’ is its display name. The plugin’s textdomain name should uniquely identify your plugin the same way regardless of its translated name.

    Joy

    (@joyously)

    It simply depends on whether you want your plugin name translated or not.

    Ah right.
    So in a plugin that is fully implementing translation it makes sense to use the Option 2 syntax.

    And if the Option 2 syntax is not currently being used in a plugin (while translation is implemented throughout the rest of the plugin code) the plugin author simply missed an opportunity to enhance the plugin translation ?

    A simple Yes/No is all I’m looking for 😉

    Thank you.

    Joy

    (@joyously)

    Yes, they missed a chance, but No, they didn’t want the possibility of the plugin’s name being changed in translation (like a trademark).

    But:

    C:\plugin_folder>findstr /S /C:"( 'Plugin Name', " *.php
    
    \page-debug.php:          <?php _e( 'Plugin Name', 'text_domain' ); ?>
    \page-logs.php:           <?php _e( 'Plugin Name', 'text_domain' ); ?>
    \page-settings.php:       <?php _e( 'Plugin Name', 'text_domain' ); ?>
    ..\..\class-privacy.php:  wp_add_privacy_policy_content( 'Plugin Name', $this->get_privacy_policy_content() );

    They are translating the <h1>Plugin Name</h1> header on three different plugin pages …

    So would it not make sense to do the same on the WordPress Privacy Policy Guide page ?

    Really appreciate your input.

    Joy

    (@joyously)

    Well, yes, then it looks like they just missed one.

    😉

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.