Created
November 23, 2012 04:09
-
-
Save dbernar1/4133966 to your computer and use it in GitHub Desktop.
Setting some options through enabling a theme. In this case, comments and pingbacks are disabled by default in posts/pages, and timezone is Winnipeg.
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
add_action( 'after_switch_theme', 'dbfds_disable_comments' ); | |
function dbfds_disable_comments( $theme_name ) { | |
update_option( 'default_comment_status', 'closed' ); | |
update_option( 'default_ping_status', 'closed' ); | |
update_option( 'timezone_string', 'America/Winnipeg' ); | |
} |
Does it need the $theme_name in the function call? Doesn't look like it gets used in the function...
Hi vodou,
Not sure why the system didn't notify me of your comment.
$theme_name is passed to, though not used in my particular hook function, so I suppose I could have left it out. Not sure whether that would have raised a PHP notice.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice.