WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Wordpress + Buddypress site.

I've created two custom fields which must be filled in each post. Also, I have a form in a custom metabox to show them.

I'm using WyPiekacz plugin to check for minimun words, tags, and categories. So it would be nice if I can tweak it a litle to check if these custom fields were filled or not, and set the post status to draft if the custom fields were empty.

Thanks :)

share|improve this question

I have no experience with this plugin. But when I look at the source, I think something like this should do it:

add_filter( 'wypiekacz_check_post', 'wpse_78395check' );

function wpse_78395check( $errors )
    if ( empty ( $_POST['custom_field_name'] ) )
        $errors[] = array (
            __( 'Custom error message', 'your_textdomain' )

    return $errors;

Replace all strings in this example with something useful. :)

share|improve this answer
:D I just did a litle change to your answer, and now it works: add_filter( 'wypiekacz_check_post', 'creepy_fuentecheck' ); function creepy_fuentecheck( $errors ) { global $post; $mustFill = ''; $mustFill = get_post_meta($post->ID, 'custom_field_name', true); if ( empty ( $mustFill ) ) $errors[] = array ( 'fuente_vacia', __( 'Por favor, agrega la fuente', 'wypiekacz' ) ); return $errors; } Thanks! – mautematico Jan 6 '13 at 6:59

Your Answer


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.