Skip to content

Fixing save Menu incompatibility in Wordpress 5.7.1 #374

@exonianp

Description

@exonianp

When saving a menu a series of errors occurs (their number depends on the number of menu items):

Notice: Undefined index: post_type in /var/www/wordpress/wp-content/plugins/wpckan/wpckan.php on line 129

Notice: Undefined index: post_type in /var/www/wordpress/wp-content/plugins/wpckan/wpckan.php on line 129

Notice: Undefined index: post_type in /var/www/wordpress/wp-content/plugins/wpckan/wpckan.php on line 129

Notice: Undefined index: post_type in /var/www/wordpress/wp-content/plugins/wpckan/wpckan.php on line 129

To solve this issue you have to change in file

wp-content/plugins/wpckan/wpckan.php

Line 129 from:

if ( 'page' == $_POST['post_type'] ) {

to

if ( 'post.php' === $pagenow && isset($_GET['post']) && 'post' === get_post_type( $_GET['post'] ) ) {

as well as add in line underneath the definition of the function wpckan_edit_post (line 118) the following line:

function wpckan_edit_post( $post_ID ) {
global $pagenow;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions