Last active
February 3, 2021 17:39
-
-
Save wpmu-authors/b44bf08bf511277184a49de53c0c3ed8 to your computer and use it in GitHub Desktop.
best-activation.php
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( 'init', 'my_custom_post_type' ); | |
function my_custom_post_type() { | |
$args = array( | |
'public' => true, | |
'label' => 'Board Games' | |
); | |
register_post_type( 'boardgames', $args ); | |
} | |
function myplugin_flush_rewrites() { | |
my_custom_post_type(); | |
flush_rewrite_rules(); | |
} | |
register_activation_hook( __FILE__, 'myplugin_flush_rewrites' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment