'page',
'orderby' => 'date',
'order' => 'DESC',
'posts_per_page' => 50,
));
$pages = array();
if (!empty($page_list) && !is_wp_error($page_list)) {
foreach ($page_list as $page) {
$pages[$page->ID] = $page->post_title;
}
}
return $pages;
}
}
/**
* Get a translatable string with allowed html tags.
*
* @param string $level Allowed levels are basic and intermediate
* @return string
*/
function be_get_allowed_html_desc($level = 'basic')
{
if (!in_array($level, ['basic', 'intermediate', 'advance'])) {
$level = 'basic';
}
$tags_str = '<' . implode('>,<', array_keys(be_get_allowed_html_tags($level))) . '>';
return sprintf(__('This input field has support for the following HTML tags: %1$s', 'being'), '' . esc_html($tags_str) . '');
}
/**
* Get a list of all the allowed html tags.
*
* @param string $level Allowed levels are basic and intermediate
* @return array
*/
function be_get_allowed_html_tags($level = 'basic')
{
$allowed_html = [
'b' => [],
'i' => [
'class' => [],
],
'u' => [],
'em' => [],
'br' => [],
'abbr' => [
'title' => [],
],
'span' => [
'class' => [],
],
'strong' => [],
];
if ($level === 'intermediate') {
$allowed_html['a'] = [
'href' => [],
'title' => [],
'class' => [],
'id' => [],
'target' => [],
];
}
if ($level === 'advance') {
$allowed_html['ul'] = [
'class' => [],
'id' => [],
];
$allowed_html['ol'] = [
'class' => [],
'id' => [],
];
$allowed_html['li'] = [
'class' => [],
'id' => [],
];
$allowed_html['a'] = [
'href' => [],
'title' => [],
'class' => [],
'id' => [],
'target' => [],
];
}
return $allowed_html;
}
// WP kses allowed tags
// ----------------------------------------------------------------------------------------
function be_kses($raw)
{
$allowed_tags = array(
'a' => array(
'class' => array(),
'href' => array(),
'rel' => array(),
'title' => array(),
'target' => array(),
),
'abbr' => array(
'title' => array(),
),
'b' => array(),
'blockquote' => array(
'cite' => array(),
),
'cite' => array(
'title' => array(),
),
'code' => array(),
'del' => array(
'datetime' => array(),
'title' => array(),
),
'dd' => array(),
'div' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),
'dl' => array(),
'dt' => array(),
'em' => array(),
'h1' => array(
'class' => array(),
),
'h2' => array(
'class' => array(),
),
'h3' => array(
'class' => array(),
),
'h4' => array(
'class' => array(),
),
'h5' => array(
'class' => array(),
),
'h6' => array(
'class' => array(),
),
'i' => array(
'class' => array(),
),
'img' => array(
'alt' => array(),
'class' => array(),
'height' => array(),
'src' => array(),
'width' => array(),
),
'li' => array(
'class' => array(),
),
'ol' => array(
'class' => array(),
),
'p' => array(
'class' => array(),
),
'q' => array(
'cite' => array(),
'title' => array(),
),
'span' => array(
'class' => array(),
'title' => array(),
'style' => array(),
),
'iframe' => array(
'width' => array(),
'height' => array(),
'scrolling' => array(),
'frameborder' => array(),
'allow' => array(),
'src' => array(),
),
'strike' => array(),
'br' => array(),
'strong' => array(),
'data-wow-duration' => array(),
'data-wow-delay' => array(),
'data-wallpaper-options' => array(),
'data-stellar-background-ratio' => array(),
'ul' => array(
'class' => array(),
),
'svg' => array(
'class' => true,
'aria-hidden' => true,
'aria-labelledby' => true,
'role' => true,
'xmlns' => true,
'width' => true,
'height' => true,
'fill' => true,
'viewbox' => true, // <= Must be lower case!
),
'g' => array('fill' => true),
'title' => array('title' => true),
'path' => array(
'd' => true,
'fill' => true,
'stroke' => true,
'stroke-width' => true,
'stroke-linecap' => true,
'stroke-linejoin' => true,
),
);
if (function_exists('wp_kses')) { // WP is here
$allowed = wp_kses($raw, $allowed_tags);
} else {
$allowed = $raw;
}
return $allowed;
}
/**
* Check elementor version
*
* @param string $version
* @param string $operator
* @return bool
*/
if (!function_exists('be_is_elementor_version')) {
function be_is_elementor_version($operator = '<', $version = '2.6.0')
{
return defined('ELEMENTOR_VERSION') && version_compare(ELEMENTOR_VERSION, $version, $operator);
}
}
// Use the following code to get ride of autop (automatic
tag) and line breaking tag (
tag).
add_filter('wpcf7_autop_or_not', '__return_false');
/**
* Element Common Functions
*/
trait HelperElementFunctions
{
/*
===========================================
========= Title Style Controls =========
===========================================
1. $control_id -> Tab ID
2. $control_name -> Tab Title
*/
protected function section_title_style_controls($control_id = null, $control_name = null)
{
$this->start_controls_section("be_' . $control_id . '_title_styling", [
"label" => esc_html__("Title Color", "being"),
"tab" => Controls_Manager::TAB_STYLE,
]);
$this->add_control("be_'. $control_id .'_top_text", [
"label" => esc_html__("Top Text Color", "being"),
"type" => Controls_Manager::COLOR,
"selectors" => [
"{{WRAPPER}} .tagline .header-text h2" =>
"background-color : {{VALUE}};",
],
"default" => "",
]);
$this->add_control("be_'. $control_id .'_middle_text", [
"label" => esc_html__("Middle Text Color", "being"),
"type" => Controls_Manager::COLOR,
"selectors" => [
"{{WRAPPER}} .tagline h3 span:nth-child(1)" =>
"-webkit-text-fill-color : {{VALUE}};",
],
"default" => "rgba(0, 0, 0, 0.3)",
]);
$this->add_control("be_'. $control_id .'_bottom_text", [
"label" => esc_html__("Bottom Text color", "being"),
"type" => Controls_Manager::COLOR,
"selectors" => [
"{{WRAPPER}} .tagline h3 span:nth-child(2)" =>
"background-color: {{VALUE}};",
],
"default" => "",
]);
$this->end_controls_section();
}
/*
=============================================
========= Section Style Controls =========
=============================================
1. $control_id -> Tab ID
2. $control_name -> Tab Title
3. $control_selector -> Selector Class or ID
*/
protected function section_style_controls($control_id = null, $control_name = null, $control_selector = null, $padding_default_top = "no", $padding_default_bottom = "no", $section_color = "", $padding_settings = true)
{
$this->start_controls_section(
'be_' . $control_id . '_area_styling',
[
'label' => esc_html($control_name),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'be_' . $control_id . '_padding_top',
[
'label' => esc_html__('Disable Padding Top', 'being'),
'type' => Controls_Manager::SWITCHER,
'default' => $padding_default_top,
'description' => esc_html__('Disable padding top for section', 'being'),
'selectors' => [
'{{WRAPPER}} ' . $control_selector . ' ' => 'padding-top: 0',
],
]
);
$this->add_control(
'be_' . $control_id . '_padding_bottom',
[
'label' => esc_html__('Disable Padding Bottom', 'being'),
'type' => Controls_Manager::SWITCHER,
'default' => $padding_default_bottom,
'description' => esc_html__('Disable padding bottom for section', 'being'),
'selectors' => [
'{{WRAPPER}} ' . $control_selector . ' ' => 'padding-bottom: 0',
],
]
);
$this->add_control(
'be_' . $control_id . '_section_color',
[
'label' => esc_html__('Background', 'being'),
'type' => Controls_Manager::COLOR,
'default' => $section_color,
'selectors' => [
'{{WRAPPER}} ' . $control_selector . ' ' => 'background-color: {{VALUE}}',
],
]
);
$this->add_control(
'be_' . $control_id . '_heading_text_color',
[
'label' => esc_html__('Heading Text Color', 'being'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} ' . $control_selector . ' h2,{{WRAPPER}} ' . $control_selector . ' h3,
{{WRAPPER}} ' . $control_selector . ' h4,{{WRAPPER}} ' . $control_selector . ' h5,
{{WRAPPER}} ' . $control_selector . ' h6 ' => 'color: {{VALUE}}; -webkit-text-stroke-color: {{VALUE}};border-color: {{VALUE}};',
'{{WRAPPER}} ' . $control_selector . ' .tagline h3 span:nth-child(2)' => 'background-color: {{VALUE}}',
'{{WRAPPER}} ' . $control_selector . ' h1 ' => 'color: {{VALUE}}'
],
]
);
$this->add_control(
'be_' . $control_id . '_normal_text_color',
[
'label' => esc_html__('Text Color', 'being'),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} ' . $control_selector . ',{{WRAPPER}} ' . $control_selector . ' p' => 'color: {{VALUE}}; -webkit-text-stroke-color: {{VALUE}};border-color: {{VALUE}};',
'{{WRAPPER}} ' . $control_selector . ' .form-box' => 'color: {{VALUE}}',
'{{WRAPPER}} ' . $control_selector . ' .form-box input[type="submit"]' => 'border-color: {{VALUE}};color: {{VALUE}}'
],
]
);
$this->add_responsive_control(
'be_' . $control_id . '_area_padding',
[
'label' => esc_html__('Padding', 'being'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} ' . $control_selector => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'be_' . $control_id . '_area_margin',
[
'label' => esc_html__('Margin', 'being'),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} ' . $control_selector => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_inline_editing_attributes('description', 'basic');
$this->end_controls_section();
}
}
function social_links()
{
$fb_url = get_theme_mod('fb_url', '');
$twitter_url = get_theme_mod('twitter_url', '');
$instagram_url = get_theme_mod('instagram_url', '');
$linkedin_url = get_theme_mod('linkedin_url', '');
$youtube_url = get_theme_mod('youtube_url', '');
$behance_url = get_theme_mod('behance_url', '');
$pinterest_url = get_theme_mod('pinterest_url', '');
$tumblr_url = get_theme_mod('tumblr_url', '');
$tiktok_url = get_theme_mod('tiktok_url', '');
if (!empty($fb_url)) { ?>