1

I have been triying to localize a wordpress site which uses Bones as the theme.

In the theme's search.php, there is a line that goes:

<?php the_excerpt('<span class="read-more">' . __('Read more &raquo;', 'bonestheme') . '</span>'); ?>

In the function reference it is said that this function does not take any parameters. So why does this theme send parameters?

1 Answer 1

2

This is a bug in the theme. The real function does indeed not use the parameter:

/**
 * Display the post excerpt.
 *
 * @since 0.71
 * @uses apply_filters() Calls 'the_excerpt' hook on post excerpt.
 */
function the_excerpt() {
    echo apply_filters('the_excerpt', get_the_excerpt());
}

PHP will just ignore it, but the unnecessary gettext call should be avoided. Write a bug report.

4
  • Thank you @toscho. Maybe you can also help me with my main problem
    – turzifer
    May 14, 2013 at 13:16
  • I wrote a bug report and here is the reply to it: italic_This is because Bones uses a filter on excerpts. If you take a look at library/bones.php line 50: add_filter('excerpt_more', 'bones_excerpt_more');_italic
    – turzifer
    May 21, 2013 at 6:59
  • @turzifer That filter will never get the extra parameter, because it is discarded by PHP. The explanation doesn’t make sense.
    – fuxia
    May 21, 2013 at 7:02
  • The conversation
    – turzifer
    May 28, 2013 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.