Skip to content

Commit

Permalink
Aliasing duplicate, identical and redundant EntryAuthorNickname handl…
Browse files Browse the repository at this point in the history
…er to EntryAuthorDisplayName
  • Loading branch information
jayallen committed Mar 12, 2009
1 parent 2e6e1cf commit 308be27
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/MT/Template/ContextHandlers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ sub core_tags {
EntryAuthorEmail => \&_hdlr_entry_author_email,
EntryAuthorURL => \&_hdlr_entry_author_url,
EntryAuthorLink => \&_hdlr_entry_author_link,
EntryAuthorNickname => \&_hdlr_entry_author_nick,
# Deprecated in favor of EntryAuthorDisplayName
EntryAuthorNickname => \&_hdlr_entry_author_display_name,
EntryAuthorID => \&_hdlr_entry_author_id,
EntryAuthorUserpic => \&_hdlr_entry_author_userpic,
EntryAuthorUserpicURL => \&_hdlr_entry_author_userpic_url,
Expand Down Expand Up @@ -9104,28 +9105,18 @@ Outputs the display name of the author for the current entry in context.
If the author has not provided a display name for publishing, this tag
will output an empty string.

=cut

sub _hdlr_entry_author_display_name {
my ($ctx) = @_;
my $e = $ctx->stash('entry')
or return $ctx->_no_entry_error();
my $a = $e->author;
return $a ? $a->nickname || '' : '';
}

###########################################################################
=for tags author entry

=head2 EntryAuthorNickname

An alias of L<EntryAuthorDisplayName>. B<This tag is deprecated in
favor of L<EntryAuthorDisplayName>.>

=for tags deprecated
=for tags entry author deprecated

=cut

sub _hdlr_entry_author_nick {
sub _hdlr_entry_author_display_name {
my ($ctx) = @_;
my $e = $ctx->stash('entry')
or return $ctx->_no_entry_error();
Expand Down

0 comments on commit 308be27

Please sign in to comment.