gpt4 book ai didi

php - 从自定义字段获取背景颜色?

转载 作者:太空宇宙 更新时间:2023-11-03 18:29:20 24 4
gpt4 key购买 nike

我正在使用来自 wordpress 的 Meta Slider,管理页面向 slider 添加了两个选项,即“标题”和“URL” 我想向字段添加“背景颜色”选项并具有 LI 类从字段中调用背景颜色。我该怎么做。

这是字段所在 slider 的 php,我如何以及在何处添加“背景颜色”选项。

https://gist.github.com/mihadaiko/7621697

另外,我要在 css 中添加什么以便它从后台字段调用?

最佳答案

 // localise the JS
wp_localize_script( 'metaslider-admin-script', 'metaslider', array(
'url' => __("URL", 'metaslider'),
'caption' => __("Caption", 'metaslider'),

/* ADD */'Background Color' => __("Background Color", 'metaslider'),

'new_window' => __("New Window", 'metaslider'),
'confirm' => __("Are you sure?", 'metaslider'),
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'resize_nonce' => wp_create_nonce('metaslider_resize'),
'iframeurl' => METASLIDER_BASE_URL . 'preview.php',
'useWithCaution' => __("Caution: This setting is for advanced developers only. If you're unsure, leave it checked.", 'metaslider')
));

还有第144行

 * Media Manager iframe HTML
*/
public function iframe() {
wp_enqueue_style('metaslider-admin-styles', METASLIDER_ASSETS_URL . 'metaslider/admin.css', false, METASLIDER_VERSION);
wp_enqueue_script('google-font-api', 'http://fonts.googleapis.com/css?family=PT+Sans:400,700');

$link = apply_filters('metaslider_hoplink', 'http://www.metaslider.com/upgrade/');
$link .= '?utm_source=lite&utm_medium=more-slide-types&utm_campaign=pro';

echo "<div class='metaslider'>";
echo "<p style='text-align: center; font-size: 1.2em; margin-top: 50px;'>Get the Pro Addon pack to add support for: <b>Post Feed</b> Slides, <b>YouTube</b> Slides, <b>HTML</b> Slides & <b>Vimeo</b> Slides</p>";
echo "<p style='text-align: center; font-size: 1.2em;'><b>NEW: </b> Animated HTML <b>Layer</b> Slides (with an awesome Drag & Drop editor!)</p>";
echo "<p style='text-align: center; font-size: 1.2em;'><b></b> Live Theme Editor!</p>";
echo "<p style='text-align: center; font-size: 1.2em;'><b>NEW:</b> Thumbnail Navigation for Flex & Nivo Slider!</p>";
echo "<a class='probutton' href='{$link}' target='_blank'>Get <span class='logo'><strong>Meta</strong>Slider</span><span class='super'>Pro</span></a>";
echo "<span class='subtext'>Opens in a new window</span>";
echo "</div>";
}

关于php - 从自定义字段获取背景颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20169548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com