Created
January 23, 2014 13:04
-
-
Save luisfdeandrade/8578144 to your computer and use it in GitHub Desktop.
Mensagem validação custom post type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function save_post_representante() { | |
...... | |
$representante = get_post($clientes[$cliente]); | |
$erro = 'O cliente "<strong> '. $representante->post_title. '</strong> " já está cadastrado para o representante "'. $post->post_title.'" '; | |
} set_transient( get_current_user_id().'missingfield', $erro ); | |
function representante_validacao() { | |
if($out = get_transient( get_current_user_id().'missingfield' ) ) { | |
delete_transient( get_current_user_id().'missingfield' ); | |
echo "<div class='error'><p>$out</p></div>"; | |
} | |
} | |
add_action( 'save_post', 'save_post_representante'); | |
add_action('admin_notices', "representante_validacao"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment