more style fixes

This commit is contained in:
Django Doucet 2022-10-31 15:08:19 -06:00
parent 852634360b
commit c801d072c8
2 changed files with 32 additions and 26 deletions

View file

@ -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' );

View file

@ -22,9 +22,9 @@ class Migrate_List extends \WP_List_Table {
return array();
}
function get_bulk_actions() {
public function get_bulk_actions() {
$actions = array(
'delete' => 'Remove backwards compatibility'
'delete' => 'Remove backwards compatibility',
);
return $actions;
}
@ -34,7 +34,7 @@ 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( 'all', null, __( 'All', 'activitypub' ), $posts_count ),
array( 'comments', 'activitypub', __( 'Posts with Comments', 'activitypub' ), $comments_posts_count ),
);
$post_status_var = get_query_var( 'comments' );
@ -45,14 +45,18 @@ class Migrate_List extends \WP_List_Table {
if ( $post_status_temp != '' ) {
$post_status_temp = '&comments=' . $view_slugs[ $x ][1];
}
$views[$view_slugs[$x][0]] = sprintf(__('<a href="' .
$views[ $view_slugs[ $x ][0] ] = sprintf(
__(
'<a href="' .
$activitypub_tools_page .
$post_status_temp . '"' .
$class .
' >' .
$view_slugs[ $x ][2] .
' <span class="count">(%d)</span></a>'),
$view_slugs[$x][3]);
' <span class="count">(%d)</span></a>'
),
$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' : ''; ?>
<tr class="<?php echo $inline_styles; ?>"><?php $this->single_row_columns( $item ); ?></tr><?php
<tr class="<?php echo $inline_styles; ?>"><?php $this->single_row_columns( $item ); ?></tr>
<?php
}
/**
@ -142,9 +147,10 @@ class Migrate_List extends \WP_List_Table {
*
* @return string
*/
function column_cb( $item ) {
public function column_cb( $item ) {
return sprintf(
'<input type="checkbox" name="selected[]" value="%s" />', $item['migrate']
'<input type="checkbox" name="selected[]" value="%s" />',
$item['migrate']
);
}