Skip to content

Commit

Permalink
Move the plugins.php GitHub icon to the auto-updates column
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Sep 10, 2023
1 parent 44f343a commit 4eb4047
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/Git_Updater/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ public function get_update_url( $type, $action, $repo_name ) {
/**
* Add git host based icons.
*
* @hooked theme_row_meta
*
* @param array $links Row meta action links.
* @param string $file Plugin or theme file.
*
Expand All @@ -635,6 +637,21 @@ public function row_meta_icons( $links, $file ) {
return $links;
}

/**
* Append the GitHub icon to the auto-updates column text.
*
* @hooked plugin_auto_update_setting_html
* @see \WP_Plugins_List_Table::single_row()
*
* @param string $html The existing HTML for the plugins.php Automatic Updates column.
* @param string $file Plugin or theme file.
*
* @return string
*/
public function plugin_auto_update_setting_html( $html, $file ) {
return $html . ' | ' . $this->get_git_icon( $file, false );
}

/**
* Get git host based icon as an HTML img element.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Git_Updater/Init.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function () {
add_filter( 'upgrader_source_selection', [ $this->base, 'upgrader_source_selection' ], 10, 4 );

// Add git host icons.
add_filter( 'plugin_row_meta', [ $this->base, 'row_meta_icons' ], 15, 2 );
add_filter( 'plugin_auto_update_setting_html', [ $this->base, 'plugin_auto_update_setting_html' ], 15, 2 );
add_filter( 'theme_row_meta', [ $this->base, 'row_meta_icons' ], 15, 2 );

// Check for deletion of cron event.
Expand Down

0 comments on commit 4eb4047

Please sign in to comment.