Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@phtester3 phtester3 commented Feb 26, 2016

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
You can’t perform that action at this time.