Warning: Missing argument 2
-
I’m using a theme which uses meta boxes for its settings page. I’m getting a warning at this settings page.
Warning: Missing argument 2 for Comment_control::set_default_comment_status() in .../wp-content/plugins/comment-control/comment-control.php on line 62
I’ve fixed it making the second argument optional.
function set_default_comment_status( $post_type, $post = null ){ $screen = get_current_screen(); // only mess with new posts that support comments if( ! $post || ! isset( $this->options['allow_comments_on'][$post_type] ) || $screen->action != 'add' || $screen->base != 'post' || ! post_type_supports( $post_type, 'comments' ) ) return; $post->comment_status = $this->options['allow_comments_on'][$screen->id] ? 'open' : 'closed'; $post->ping_status = $this->options['allow_pings_on'][$screen->id] ? 'open' : 'closed'; }
Greats from Germany
LeisureLarry
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Warning: Missing argument 2’ is closed to new replies.