• Resolved Andrew Biss

    (@andrewpaulbiss)


    Great plugin!

    I noticed a minor problem with WordPress SEO where it does not play nicely with other plugins or themes which define custom columns in the Manage Posts and/or Manage Pages lists.

    The issue is that in wordpress-seo\admin\class-metabox.php the custom columns are defined with this function:

    function page_title_column_heading( $columns ) {
       return array_merge(array_slice($columns, 0, 2),
       array('page-title' => 'WP SEO Title'),
       array_slice($columns, 2, 6),
       array('page-meta-robots' => 'Robots Meta'));
    }

    This code assumes when splitting up the array of columns that nobody else has defined any custom columns. The result is that the associative array of column names gets truncated and only the first 7 columns that were already defined (plus the 2 from WordPress SEO) are displayed.

    As a workaround I patched the code to change the hardcoded array upper limit of 6 to count($columns) as follows:

    function page_title_column_heading( $columns ) {
       return array_merge(array_slice($columns, 0, 2),
       array('page-title' => 'WP SEO Title'),
       array_slice($columns, 2, count($columns)),
       array('page-meta-robots' => 'Robots Meta'));
    }

    With these change my custom columns along with those from WordPress SEO are available and I can hide and show the ones I need from the “Screen Options” panel.

    Andrew.

    http://wordpress.org/extend/plugins/wordpress-seo/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Breaks other plugins which add custom columns’ is closed to new replies.