Conversation
supportWe are seeing an issue with the latest update. Warning: array_intersect(): Expected parameter 2 to be an array, null given in /home/public_html/wp-content/plugins/page-or-post-clone/page-or-post-clone.php on line 123
same issue here with version 5.8. Wasnt the plugin tested before release? Not to cool such error on prod site if I may.
Anyone know how to fix? I removed the plugin in the hosting file manager but the issue remained. This reply was modified 4 years, 4 months ago by jgroh .
For Anyone having this issue, go and edit the plugin itself and starting at line 121 to 134 replace what exists with the following code add_action('init', function(){ global $current_user; $allowed_roles = array('editor', 'administrator', 'author'); if (array_intersect($allowed_roles, $current_user->roles)) { function content_clone_link($actions, $post) { if (current_user_can('edit_posts')) { $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=content_clone&post=' . $post->ID, basename(__FILE__), 'clone_nonce') . '" title="Clone!" rel="permalink">Clone</a>'; } return $actions; } } add_filter('post_row_actions', 'content_clone_link', 10, 2); // Para artigos add_filter('page_row_actions', 'content_clone_link', 10, 2); //Para páginas }); This takes puts this in an init hook so that there is access to the $current_user global variable
same issue here with version 5.8. Wasnt the plugin tested before release? Not to cool such error on prod site if I may.
Anyone know how to fix? I removed the plugin in the hosting file manager but the issue remained. This reply was modified 4 years, 4 months ago by jgroh .
For Anyone having this issue, go and edit the plugin itself and starting at line 121 to 134 replace what exists with the following code add_action('init', function(){ global $current_user; $allowed_roles = array('editor', 'administrator', 'author'); if (array_intersect($allowed_roles, $current_user->roles)) { function content_clone_link($actions, $post) { if (current_user_can('edit_posts')) { $actions['duplicate'] = '<a href="' . wp_nonce_url('admin.php?action=content_clone&post=' . $post->ID, basename(__FILE__), 'clone_nonce') . '" title="Clone!" rel="permalink">Clone</a>'; } return $actions; } } add_filter('post_row_actions', 'content_clone_link', 10, 2); // Para artigos add_filter('page_row_actions', 'content_clone_link', 10, 2); //Para páginas }); This takes puts this in an init hook so that there is access to the $current_user global variable