Skip to:
Content

BuddyPress.org

Changeset 14110


Ignore:
Timestamp:
03/20/2025 07:10:39 PM (16 months ago)
Author:
dcavins
Message:

Avoid WP 6.7 notice about using translatable strings too early

Use a "raw" name instead of a "translatable" name for the BP_Component's & BP_Theme_Compat's name properties.

Props boonebgorges.

See #9247 (trunk)
Closes https://github.com/buddypress/buddypress/pull/391

Location:
branches/12.0
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • branches/12.0/docs/developer/component/build-component.md

    r13516 r14110  
    4848                        'custom',
    4949
    50                         // Your component Name.
    51                         __( 'Custom component', 'custom-text-domain' ),
     50                        // The raw name for your component. Do not use translatable strings here.
     51                        'Custom component',
    5252
    5353                        /*
  • branches/12.0/src/bp-activity/classes/class-bp-activity-component.php

    r13690 r14110  
    2929                parent::start(
    3030                        'activity',
    31                         __( 'Activity Streams', 'buddypress' ),
     31                        'Activity Streams',
    3232                        buddypress()->plugin_dir,
    3333                        array(
  • branches/12.0/src/bp-blogs/classes/class-bp-blogs-component.php

    r13522 r14110  
    3131                parent::start(
    3232                        'blogs',
    33                         __( 'Site Directory', 'buddypress' ),
     33                        'Site Directory',
    3434                        buddypress()->plugin_dir,
    3535                        array(
  • branches/12.0/src/bp-core/classes/class-bp-component.php

    r13662 r14110  
    2828
    2929        /**
    30          * Translatable name for the component.
     30         * Raw name for the component.
     31         *
     32         * Do not use translatable strings here as this part is set before WP's `init` hook.
     33         *
     34         * @since 1.5.0
     35         * @since 14.3.0 Changed the variable inline documentation summary and added a description.
    3136         *
    3237         * @internal
     
    221226         * @since 2.3.0 Added $params['features'] as a configurable value.
    222227         * @since 2.4.0 Added $params['search_query_arg'] as a configurable value.
     228         * @since 14.3.0 Changed the `$name` parameter's description.
    223229         *
    224230         * @param string $id   Unique ID. Letters, numbers, and underscores only.
    225          * @param string $name Unique name. This should be a translatable name, eg.
    226          *                     __( 'Groups', 'buddypress' ).
     231         * @param string $name Unique raw name for the component (do not use translatable strings).
    227232         * @param string $path The file path for the component's files. Used by {@link BP_Component::includes()}.
    228233         * @param array  $params {
  • branches/12.0/src/bp-core/classes/class-bp-core.php

    r13532 r14110  
    3030                parent::start(
    3131                        'core',
    32                         __( 'BuddyPress Core', 'buddypress' ),
     32                        'BuddyPress Core',
    3333                        buddypress()->plugin_dir
    3434                );
  • branches/12.0/src/bp-core/classes/class-bp-theme-compat.php

    r13013 r14110  
    1919 *
    2020 * @since 1.7.0
     21 * @since 14.3.0 Changed the `$name` property's description.
    2122 *
    2223 * @todo We should probably do something similar to BP_Component::start().
     
    2627 *     An array of properties describing the theme compat package.
    2728 *     @type string $id      ID of the package. Must be unique.
    28  *     @type string $name    Name of the theme. This should match the name given
     29 *     @type string $name    Raw name for the theme. This should match the name given
    2930 *                           in style.css.
    3031 *     @type string $version Theme version. Used for busting script and style
  • branches/12.0/src/bp-friends/classes/class-bp-friends-component.php

    r13503 r14110  
    2929                parent::start(
    3030                        'friends',
    31                         _x( 'Friend Connections', 'Friends screen page <title>', 'buddypress' ),
     31                        'Friend Connections',
    3232                        buddypress()->plugin_dir,
    3333                        array(
  • branches/12.0/src/bp-groups/classes/class-bp-groups-component.php

    r13690 r14110  
    118118                parent::start(
    119119                        'groups',
    120                         _x( 'User Groups', 'Group screen page <title>', 'buddypress' ),
     120                        'User Groups',
    121121                        buddypress()->plugin_dir,
    122122                        array(
  • branches/12.0/src/bp-members/classes/class-bp-members-component.php

    r13708 r14110  
    7676                parent::start(
    7777                        'members',
    78                         __( 'Members', 'buddypress' ),
     78                        'Members',
    7979                        buddypress()->plugin_dir,
    8080                        array(
  • branches/12.0/src/bp-members/classes/class-bp-members-invitations-component.php

    r13629 r14110  
    1717                parent::start(
    1818                        'members_invitations',
    19                         __( 'Members Invitations', 'buddypress' ),
     19                        'Members Invitations',
    2020                        '',
    2121                        array()
  • branches/12.0/src/bp-messages/classes/class-bp-messages-component.php

    r13551 r14110  
    3838                parent::start(
    3939                        'messages',
    40                         __( 'Private Messages', 'buddypress' ),
     40                        'Private Messages',
    4141                        buddypress()->plugin_dir,
    4242                        array(
  • branches/12.0/src/bp-notifications/classes/class-bp-notifications-component.php

    r13503 r14110  
    2929                parent::start(
    3030                        'notifications',
    31                         _x( 'Notifications', 'Page <title>', 'buddypress' ),
     31                        'Notifications',
    3232                        buddypress()->plugin_dir,
    3333                        array(
  • branches/12.0/src/bp-settings/classes/class-bp-settings-component.php

    r13503 r14110  
    2727                parent::start(
    2828                        'settings',
    29                         __( 'Settings', 'buddypress' ),
     29                        'Settings',
    3030                        buddypress()->plugin_dir,
    3131                        array(
  • branches/12.0/src/bp-templates/bp-legacy/buddypress-functions.php

    r13823 r14110  
    5959                $bp            = buddypress();
    6060                $this->id      = 'legacy';
    61                 $this->name    = __( 'BuddyPress Legacy', 'buddypress' );
     61                $this->name    = 'BP Legacy';
    6262                $this->version = bp_get_version();
    6363                $this->dir     = trailingslashit( $bp->themes_dir . '/bp-legacy' );
  • branches/12.0/src/bp-xprofile/classes/class-bp-xprofile-component.php

    r13503 r14110  
    4848                parent::start(
    4949                        'xprofile',
    50                         _x( 'Extended Profiles', 'Component page <title>', 'buddypress' ),
     50                        'Extended Profiles',
    5151                        buddypress()->plugin_dir,
    5252                        array(
  • branches/12.0/src/class-buddypress.php

    r14053 r14110  
    936936                        array(
    937937                                'id'      => 'legacy',
    938                                 'name'    => __( 'BuddyPress Legacy', 'buddypress' ),
     938                                'name'    => 'BP Legacy',
    939939                                'version' => bp_get_version(),
    940940                                'dir'     => trailingslashit( $this->themes_dir . '/bp-legacy' ),
     
    946946                        array(
    947947                                'id'      => 'nouveau',
    948                                 'name'    => __( 'BuddyPress Nouveau', 'buddypress' ),
     948                                'name'    => 'BP Nouveau',
    949949                                'version' => bp_get_version(),
    950950                                'dir'     => trailingslashit( $this->themes_dir . '/bp-nouveau' ),
Note: See TracChangeset for help on using the changeset viewer.