[wp-trac] [WordPress Trac] #12991: Allow setting default_comment_status specifically for Pages (or for any post type)
WordPress Trac
wp-trac at lists.automattic.com
Tue Oct 9 18:55:33 UTC 2012
#12991: Allow setting default_comment_status specifically for Pages (or for any
post type)
-------------------------+-----------------------------
Reporter: demetris | Owner: messenlehner
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: Comments | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+-----------------------------
Comment (by F J Kaiser):
For all people stumbling over this ticket (that hasn't made progress for a
while), here's a temporary solution written by a user on WordPress
StackExchange.
{{{
function wpse48145_unchecked_page_discussion () {
if( 'page' == $_REQUEST[ 'post_type' ] ) {
add_filter( 'pre_option_default_comment_status',
'wpse48145_unchecked_page_discussion_filter' );
// & if you want...
add_filter( 'pre_option_default_ping_status',
'wpse48145_unchecked_page_discussion_filter' );
}
}
add_action( 'load-post-new.php', 'wpse48145_unchecked_page_discussion' );
function wpse48145_unchecked_page_discussion_filter ( $val ) {
return 'closed';
}
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12991#comment:26>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list