Answer the question
In order to leave comments, you need to log in
Is it possible to do this in code?
Good afternoon!
In one of the wordpress plugins I found this piece of code.
What does $update do? I understand correctly that the variable was declared but not written further in the code?
public function save_badge_metadata ( $post_id, $post, $update ) {
if ( 'mycred_badge' != $post->post_type ) {
return;
}
$badge_description = '';
if ( isset( $_POST[ 'gfy_badge_description' ] ) ) {
$badge_description = sanitize_text_field( $_POST[ 'gfy_badge_description' ] );
}
update_post_meta( $post_id, 'gfy_badge_description', $badge_description );
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question