如何在WordPress插件中正确编辑样式



我需要编辑插件中的样式。如果它们不是内联编写的。这会更容易。我会限制自己在子主题中使用一个简单的CSS文件。但是样式是内联的:

public static function generate_print_button_for_user($order, $order_id, $template_type, $action, $action_data)
{
$show_button=true;

/* toggle the visibility for admin/customer */
$show_button=apply_filters('wt_pklist_toggle_email_print_buttons', $show_button, $order, $template_type, $action_data['email_button'], $action_data['sent_to_admin']);
if($show_button)
{
$style='';
if($action_data['email_button'])
{
$style='background:#514763; border-color:#514763; text-align: center; display: block;  color:#fff; text-decoration:none; padding:10px; border-radius:0; text-shadow:0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799;';
$style=apply_filters('wt_pklist_alter_email_button_style', $style, $order, $template_type, $action_data['sent_to_admin']);
}
$button = '<a class="button button-primary" style="'.$style.'" target="_blank" href="'.$action_data['url'].'">לחצו להדפסת הזמנה</a><br><br>';
echo $button;
}
}

目前,我只是对插件文件进行了更改。但这是不正确的,更新后,我的自定义样式将消失。告诉我在这种情况下该怎么做?

为什么不在Wordpress面板中添加自定义代码
您可以在外观中添加自定义CSS样式代码->自定义->附加CSS
它覆盖插件CSS代码。

最新更新