diff --git a/includes/class-admin.php b/includes/class-admin.php index da9f740..f45140b 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -140,7 +140,7 @@ class Admin { */ public static function version_check() { if ( ! function_exists( 'get_plugin_data' ) ) { - require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugin_data = \get_plugin_data( ACTIVITYPUB_PLUGIN ); $activitypub_db_version = \get_option( 'activitypub_version' ); diff --git a/includes/table/migrate-list.php b/includes/table/migrate-list.php index 907f41a..168655b 100644 --- a/includes/table/migrate-list.php +++ b/includes/table/migrate-list.php @@ -21,10 +21,10 @@ class Migrate_List extends \WP_List_Table { public function get_sortable_columns() { return array(); } - - function get_bulk_actions() { + + public function get_bulk_actions() { $actions = array( - 'delete' => 'Remove backwards compatibility' + 'delete' => 'Remove backwards compatibility', ); return $actions; } @@ -34,25 +34,29 @@ class Migrate_List extends \WP_List_Table { $comments_posts_count = \Activitypub\Tools\Posts::count_posts_with_comments_to_migrate(); $activitypub_tools_page = 'tools.php?page=activitypub_tools'; $view_slugs = array( - array('all', NULL, __('All', 'activitypub'), $posts_count), - array('comments', 'activitypub', __('Posts with Comments', 'activitypub'), $comments_posts_count), + array( 'all', null, __( 'All', 'activitypub' ), $posts_count ), + array( 'comments', 'activitypub', __( 'Posts with Comments', 'activitypub' ), $comments_posts_count ), ); - $post_status_var = get_query_var('comments'); - $view_count = count($view_slugs); - for ($x = 0; $x < $view_count; $x++) { - $class = ($post_status_var == $view_slugs[$x][1]) ? ' class="current"' : ''; - $post_status_temp = $view_slugs[$x][1]; - if($post_status_temp != '') { - $post_status_temp = '&comments='.$view_slugs[$x][1]; + $post_status_var = get_query_var( 'comments' ); + $view_count = count( $view_slugs ); + for ( $x = 0; $x < $view_count; $x++ ) { + $class = ( $post_status_var == $view_slugs[ $x ][1] ) ? ' class="current"' : ''; + $post_status_temp = $view_slugs[ $x ][1]; + if ( $post_status_temp != '' ) { + $post_status_temp = '&comments=' . $view_slugs[ $x ][1]; } - $views[$view_slugs[$x][0]] = sprintf(__('' . - $view_slugs[$x][2] . - ' (%d)'), - $view_slugs[$x][3]); + $views[ $view_slugs[ $x ][0] ] = sprintf( + __( + '' . + $view_slugs[ $x ][2] . + ' (%d)' + ), + $view_slugs[ $x ][3] + ); } return $views; } @@ -132,7 +136,8 @@ class Migrate_List extends \WP_List_Table { public function single_row( $item ) { $inline_styles = ( $item['comments'] > 0 ) ? 'warning' : ''; ?> - single_row_columns( $item ); ?>">single_row_columns( $item ); ?> + ', $item['migrate'] - ); + '', + $item['migrate'] + ); } /** @@ -177,7 +183,7 @@ class Migrate_List extends \WP_List_Table { 'delete' => sprintf( '%s', esc_attr( $_REQUEST['page'] ), - 'delete',// using this id for style reasons + 'delete', // using this id for style reasons $item['post_author'], \rawurlencode( $item['migrate'] ), $migrate_action_nonce,