通过使用以下两个功能将讨论中的链接从插件管理页面的第一列移到第二列,我找到了一个更好的解决方案:
/** Remove action links from the Super Socializer plugin first column **/
const PLUGIN_SLUG = "super-socializer/super_socializer.php";
add_filter("plugin_action_links_" . PLUGIN_SLUG, function ($actions, $plugin_file, $plugin_data, $context) {
unset($actions[1]); // remove link "Add-Ons"
unset($actions[2]); // remove link "Support Documentation"
return $actions;
}, 10, 4);
/** Add action links to the Super Socializer plugin second column **/
add_filter( \'plugin_row_meta\', \'custom_plugin_row_meta\', 10, 2 );
function custom_plugin_row_meta( $links, $file ) {
if( strpos( $file, \'super_socializer.php\' ) !== false ) {
$new_links = array(
\'addons\' => \'<a href="\' . esc_url( \'https://www.heateor.com/add-ons\' ) . \'" target="_blank" aria-label="\' .
esc_attr__( \'Add-Ons\', \'domain\' ) . \'">\' . esc_html__( \'Add-Ons\', \'domain\' ) . \'</a>\', // add link "Add-Ons"
\'support\' => \'<a href="\' . esc_url( \'https://www.heateor.com/add-ons\' ) . \'" target="_blank" aria-label="\' .
esc_attr__( \'Support Documentation\', \'domain\' ) . \'">\' . esc_html__( \'Support Documentation\', \'domain\' ) . \'</a>\' // add link "Support Documentation"
);
$links = array_merge( $links, $new_links );
}
return $links;
}