$links Existing action link HTML. * @return array */ public function plugin_action_links( array $links ): array { if ( ! current_user_can( 'manage_woocommerce' ) ) { return $links; } $link = '' . esc_html__( 'Settings', 'afroit-messaging-workflows' ) . ''; // Add the link to the beginning of the array. array_unshift( $links, $link ); return $links; } /** * WooCommerce submenu: visible hub + hidden legacy routes (same callbacks as before). * * @return void */ public function admin_menu() { $parent = 'woocommerce'; $cap = 'manage_woocommerce'; // Visible: WooCommerce-style hub (?section= primary, ?tab= for settings sub-nav in preview). add_submenu_page( $parent, __( 'Afroit Messaging Workflows for WooCommerce', 'afroit-messaging-workflows' ), __( 'Messaging Workflows', 'afroit-messaging-workflows' ), $cap, \AFROMEWO_PLUGIN_SLUG, array( $this, 'render_hub' ), 56 ); } /** * WooCommerce-style hub (preview shell). * * @return void */ public function render_hub() { if ( ! current_user_can( 'manage_woocommerce' ) ) { wp_die( esc_html__( 'Insufficient permissions.', 'afroit-messaging-workflows' ) ); } ( new HubPage() )->render(); } }