Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mayukojpn/6ef62c39dcf48c17ed96 to your computer and use it in GitHub Desktop.
Save mayukojpn/6ef62c39dcf48c17ed96 to your computer and use it in GitHub Desktop.
wp_setup_nav_menu_item の Hotfix
<?php
/*
Plugin Name: #35324 hotfix
Plugin URI: https://core.trac.wordpress.org/ticket/35324
Description: This will fix a bug of post type archives support in nav menus.
Author: Toro_Unit, extendwings, mayukojpn
Author URI: https://gist.github.com/mayukojpn/6ef62c39dcf48c17ed96
Version: 0.1
*/
add_filter('wp_setup_nav_menu_item', function( $menu_item ) {
if ( isset( $menu_item->post_type ) && ( 'post_type_archive' == $menu_item->type ) ) {
$menu_item->description = $menu_item->post_content;
}
return $menu_item;
});
@phtester3
Copy link

doesnt working anymore since latest updates from facebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment