|
Mar 26 |
awarded | Tumbleweed |
|
Mar 19 |
asked | Check Types custom checkbox and metadata when publish post |
|
Feb 18 |
comment |
Automatically add a tag according to custom metadata Great! Works like a charm. Thanks a lot! |
|
Feb 18 |
awarded | Student |
|
Feb 18 |
awarded | Teacher |
|
Feb 18 |
answered | Automatically add a tag according to custom metadata |
|
Feb 18 |
comment |
Automatically add a tag according to custom metadata I do this: function is_featured_post(){
$postid = get_the_ID();
$featured = get_post_meta($postid, 'wpcf-slider-if', true); if ( $featured == 1 ) {
wp_set_object_terms( $postid, 'Destacado', 'post_tag', true );
}
}
add_action ( 'publish_post', 'is_featured_post' );
But it doesn´t work. To me, the code looks fine. I don´t know what I´m doing wrong. |
|
Feb 17 |
asked | Automatically add a tag according to custom metadata |