Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
Thank you @toscho. Maybe you can also help me with my main problem – turzifer May 14 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 at 6:59
@turzifer That filter will never get the extra parameter, because it is discarded by PHP. The explanation doesn’t make sense. – toscho May 21 at 7:02
The conversation – turzifer May 28 at 14:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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