WordPress.org

Ready to get started?Download WordPress

Ideas

"howdy" hook

  1. prw
    Member

    12345

    please god give us a hook for the "howdy, <username>" on the top bar. Its easy enough to edit the core but that defeats the purpose of hooks.

    Posted: 4 years ago #
  2. Jeff Chandler
    Volunteer Moderator and Voice of WP

    Pretty sure there are a few different plugins that either remove or change hello dolly to something else.

    Posted: 4 years ago #
  3. Jen Mylo
    Key Master

    @jeffr0: He's talking about the Howdy before the username in the upper right, not the hello dolly plugin.

    Posted: 4 years ago #
  4. I believe this method can be used to change any of the built-in strings, including that one.

    Posted: 4 years ago #
  5. Andrea Rennick
    Customer Care at Copyblogger Media and Studiopress

    http://planetozh.com/blog/my-projects/no-howdy-a-plugin-for-wordpress/

    But as Ohz points out, he had to load up the whole jQuery library to hide it.

    Posted: 4 years ago #
  6. Aaron Jorbin
    Member

    The method that Stephanie points out is the best route. All you have to do is change the $text variable to match the string used. For example if you wanted to change Howdy to Hello, you would use:

    class PJW_Translation_Mangler {
     /**
     * Filter the translation string before it is displayed.
     *
     * @param $translation The current translation
     * @param $text The text being translated
     * @param $context The context for the translation
     * @param $domain The domain for the translation
     * @return string The translated / filtered text.
     */
     function filter_gettext($translation, $text, $domain) {
      $translations = &get_translations_for_domain( $domain );
      if ( $text == 'Howdy, <a href="%1$s" title="Edit your profile">%2$s</a>' ) {
       return $translations->translate( 'Hello, <a href="%1$s" title="Edit your profile">%2$s</a>' );
      }
      return $translation;
     }
    }
    add_filter('gettext', array('PJW_Translation_Mangler', 'filter_gettext'), 10, 4);
    Posted: 4 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.

  • Rating

    12345
    6 Votes
  • Status

    This idea is under consideration

Tags