admin管理员组

文章数量:1122846

A client's website has 12 pages, but we can both only see 3 of them, even though we have administrator accounts, and creating a new administrator account does not solve the problem.

Screen Options will not open, and if I check the Chrome console, I see:

Failed to load resource: the server responded with a status of 500 (): /wp-admin/edit.php

I can see /wp-admin/edit.php exists.

I have removed /wp-admin and /wp-includes and uploaded fresh copies of these.

I have uploaded a fresh copy of the parent theme, and the child theme is untouched.

If I rename plugins to plugins.temp the issue remains.

Help appreciated.

EDIT1

If I turn debug on, and reload /wp-admin/edit.php?post_type=page, I see the following errors:

Warning: Illegal string offset 'slideshow' in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48

Fatal error: Uncaught Error: Cannot use string offset as an array in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php:48 Stack trace: #0 /home/user/public_html/wp-includes/class-wp-hook.php(298): avia_backend_compatibility_custom_field_filter('', 127) #1 /home/user/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters('', Array) #2 /home/user/public_html/wp-content/themes/abundance/framework/php/function-set-avia-frontend.php(262): apply_filters('avia_post_meta_...', '', 127) #3 /home/user/public_html/wp-includes/class-wp-hook.php(300): avia_post_meta(Object(WP_Post)) #4 /home/user/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #5 /home/user/public_html/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #6 /home/user/public_html/wp-includes/class-wp-query.php(4070): do_action_ref_array('the_post', Array) #7 /home/user/public_html/wp-includes/query.php(938): WP_Query->setup_postdata(Object(WP_Post)) #8 /home/mag in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48

EDIT2

Here is line 44 to 61 of /abundance/includes/admin/compat.php

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields['slideshow'][0]['slideshow_image'] = "";
    }

    if(isset($custom_fields['slideshow']) && is_array($custom_fields['slideshow']) && isset($custom_fields['slideshow'][0]['slideshow_image']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );

        if($custom_fields['slideshow'][0]['slideshow_image'] == "" && $post_thumbnail_id)
        {
            $custom_fields['slideshow'][0]['slideshow_image'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}

A client's website has 12 pages, but we can both only see 3 of them, even though we have administrator accounts, and creating a new administrator account does not solve the problem.

Screen Options will not open, and if I check the Chrome console, I see:

Failed to load resource: the server responded with a status of 500 (): /wp-admin/edit.php

I can see /wp-admin/edit.php exists.

I have removed /wp-admin and /wp-includes and uploaded fresh copies of these.

I have uploaded a fresh copy of the parent theme, and the child theme is untouched.

If I rename plugins to plugins.temp the issue remains.

Help appreciated.

EDIT1

If I turn debug on, and reload /wp-admin/edit.php?post_type=page, I see the following errors:

Warning: Illegal string offset 'slideshow' in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48

Fatal error: Uncaught Error: Cannot use string offset as an array in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php:48 Stack trace: #0 /home/user/public_html/wp-includes/class-wp-hook.php(298): avia_backend_compatibility_custom_field_filter('', 127) #1 /home/user/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters('', Array) #2 /home/user/public_html/wp-content/themes/abundance/framework/php/function-set-avia-frontend.php(262): apply_filters('avia_post_meta_...', '', 127) #3 /home/user/public_html/wp-includes/class-wp-hook.php(300): avia_post_meta(Object(WP_Post)) #4 /home/user/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #5 /home/user/public_html/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #6 /home/user/public_html/wp-includes/class-wp-query.php(4070): do_action_ref_array('the_post', Array) #7 /home/user/public_html/wp-includes/query.php(938): WP_Query->setup_postdata(Object(WP_Post)) #8 /home/mag in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48

EDIT2

Here is line 44 to 61 of /abundance/includes/admin/compat.php

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields['slideshow'][0]['slideshow_image'] = "";
    }

    if(isset($custom_fields['slideshow']) && is_array($custom_fields['slideshow']) && isset($custom_fields['slideshow'][0]['slideshow_image']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );

        if($custom_fields['slideshow'][0]['slideshow_image'] == "" && $post_thumbnail_id)
        {
            $custom_fields['slideshow'][0]['slideshow_image'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}
Share Improve this question edited Oct 16, 2017 at 7:42 Steve asked Oct 16, 2017 at 7:02 SteveSteve 1,75719 gold badges66 silver badges114 bronze badges 1
  • This has now been asked in the comments on themeforest, from the outside it is difficult to help here, see this answer explaining the error message. – kero Commented Oct 16, 2017 at 8:32
Add a comment  | 

2 Answers 2

Reset to default 1
  1. Please open your wp-config.php file and change the parameter like this:

    define('WP_DEBUG', true);
    

Once this parameter is activated, you can see more details about the error.

  1. Try to activate any default WordPress theme like TwentySeventeen and look if the error still exists.

Update:

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields = array(
             'slideshow' => array(
                 array( 'slideshow_image' => '' )
             )
        );
    }

    if(isset($custom_fields['slideshow']) && is_array($custom_fields['slideshow']) && isset($custom_fields['slideshow'][0]['slideshow_image']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );

        if($custom_fields['slideshow'][0]['slideshow_image'] == "" && $post_thumbnail_id)
        {
            $custom_fields['slideshow'][0]['slideshow_image'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}

In my case is was a conflict between two translation plugins, namely WPML and Polylang, while doing a migration. Not sure what was the exact cause since there were no errors shown.

本文标签: post editorcan39t see all pages in dashboard (can only see 3) wpadmineditphp gt 500 error