Created
August 31, 2015 07:16
-
-
Save gwin/32eb5de62ba3e1739bf2 to your computer and use it in GitHub Desktop.
Enable comments in Adverts
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
<?php | |
add_action("adverts_post_type", "enable_adverts_comments"); | |
add_action("adverts_insert_post", "enable_adverts_comments_check"); | |
add_action("adverts_update_post", "enable_adverts_comments_check"); | |
function enable_adverts_comments( $args ) { | |
$args["supports"][] = "comments"; | |
return $args; | |
} | |
function enable_adverts_comments_check( $data ) { | |
$data["comment_status"] = "open"; | |
return $data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment