Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to add a custom field to an existing "widget" in the backend?

What I wanna do is provide a way to have a checkbox to apply a thumbnail that is double the size of the normal one on the frontend. So I'm thinking of simply adding a custom field as a checkbox that says "Double the size" and when checked I return a different output on the frontend.

That is not the problem, I know how to do so.

However I wonder if it possible to locate this checkbox in the post-thumbnail widget in the backend?

enter image description here

Normally when adding a custom field it appears underneath the excerpt or content area. Is it possible to locate this checkbox inside the post-thumbnail widget?

Thank you in advance

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Just filter admin_post_thumbnail_html and append your checkbox HTML:

add_filter( 'admin_post_thumbnail_html', 'wpse_71501_thumbnail_options' );
function wpse_71501_thumbnail_options( $html )
{ 
    return $html . <<<html
<p>
    <label for="big_thumbnail">
        <input id="big_thumbnail" name="big_thumbnail" type="checkbox" />
        Use big thumbnail
    </label>
</p>
html;
}
share|improve this answer
add comment

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.