Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions admin/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function init(): void {
add_action( 'wp_trash_post', [ Purge_Post_Data::class, 'delete_post' ] );
add_action( 'save_post', [ Post_Save::class, 'delete_issue_data_on_post_trashing' ], 10, 3 );

$plugin_action_links = new Plugin_Action_Links();
$plugin_action_links->init_hooks();

$admin_notices = new Admin_Notices();
$admin_notices->init_hooks();

Expand Down
61 changes: 61 additions & 0 deletions admin/class-plugin-action-links.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Plugin Action Links class file for the Accessibility Checker plugin.
*
* @package Accessibility_Checker
*/

namespace EDAC\Admin;

/**
* Plugin Action Links handling class.
*/
class Plugin_Action_Links {

/**
* Initialize hooks.
*
* @return void
*/
public function init_hooks(): void {
add_filter( 'plugin_action_links_' . plugin_basename( EDAC_PLUGIN_FILE ), [ $this, 'plugin_action_links' ] );
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}

/**
* Plugin action links.
*
* Adds action links to the plugin list table
*
* Fired by `plugin_action_links` filter.
*
* @since 1.27.0
* @access public
*
* @param array $links An array of plugin action links.
*
* @return array An array of plugin action links.
*/
public function plugin_action_links( $links ) { // phpcs:ignore Generic.NamingConventions.ConstructorName.OldStyle
Comment thread
SteveJonesDev marked this conversation as resolved.
Outdated
$settings_link = sprintf(
'<a href="%1$s">%2$s</a>',
admin_url( 'admin.php?page=accessibility_checker_settings' ),
Comment thread
SteveJonesDev marked this conversation as resolved.
Outdated
esc_html__( 'Settings', 'accessibility-checker' )
);

array_unshift( $links, $settings_link );

// Add Pro link if not already pro version.
if ( ! EDAC_KEY_VALID ) {
$go_pro_text = esc_html__( 'Get Pro', 'accessibility-checker' );

$links['go_pro'] = sprintf(
'<a href="%1$s" target="_blank" class="edac-plugin-action-links__go-pro" aria-label="%2$s">%3$s</a>',
edac_link_wrapper( 'https://equalizedigital.com/accessibility-checker/pricing/', 'plugin-action-links', 'get-pro-link', false ),
Comment thread
SteveJonesDev marked this conversation as resolved.
Outdated
esc_attr__( 'Get Accessibility Checker Pro, opens in new window', 'accessibility-checker' ),
$go_pro_text
);
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

return $links;
}
}
12 changes: 12 additions & 0 deletions src/admin/sass/accessibility-checker-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2002,3 +2002,15 @@
color: variables.$color-gray;
text-decoration: none;
}

.edac-plugin-action-links {
&__go-pro {
color: variables.$color-red;
font-weight: bold;
&:hover,
&:focus {
color: variables.$color-red;
text-decoration: underline;
Comment thread
SteveJonesDev marked this conversation as resolved.
}
}
}