Wrong generated page_name/slug on first publish of custom post type
When registering or updating any rewrite for any post/custom post type you need to flush rewrite rules by the admin panel or via code: register_activation_hook( __FILE__, ‘plugin_activation’ ); function plugin_activation() { update_option(‘plugin_permalinks_flushed’, 0); } add_action( ‘init’, ‘register_custom_post_type’ ); function register_custom_post_type() { global $wp; register_post_type( ‘review’, array( ‘label’ => ‘Reviews’, ‘labels’ => array( ‘name’ => ‘Reviews’, … Read more