: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<span class="label">' . __( 'Mobile Menu', 'themify' ) .themify_help(__( 'Main menu will toggle to mobile menu style when viewport width meets the entered value.', 'themify' )) . '</span>
<input type="text" name="setting-mobile_menu_trigger_point" value="' . esc_attr( Themify_Enqueue_Assets::$mobileMenuActive ) . '" class="width2">' . __( 'Mobile menu viewport (px)', 'themify' ) .'
if ( ! function_exists( 'themify_generic_slider_controls' ) ) {
* Creates a general module to setup slider parameters
function themify_generic_slider_controls( $prefix ) {
* Associative array containing theme settings
$auto_options = apply_filters( 'themify_generic_slider_auto',
__('4 Secs (default)', 'themify') => 4000,
__('Off', 'themify') => 'off',
__('1 Sec', 'themify') => 1000,
__('2 Secs', 'themify') => 2000,
__('3 Secs', 'themify') => 3000,
__('4 Secs', 'themify') => 4000,
__('5 Secs', 'themify') => 5000,
__('6 Secs', 'themify') => 6000,
__('7 Secs', 'themify') => 7000,
__('8 Secs', 'themify') => 8000,
__('9 Secs', 'themify') => 9000,
__('10 Secs', 'themify')=> 10000
$speed_options = apply_filters( 'themify_generic_slider_speed',
__('Fast', 'themify') => 500,
__('Normal', 'themify') => 1000,
__('Slow', 'themify') => 1500
array('name' => __('Slide', 'themify'), 'value' => 'slide'),
array('name' => __('Fade', 'themify'), 'value' =>'fade')
<span class="label">' . __('Auto Play', 'themify') . '</span>
<select name="' . $prefix . 'autoplay">';
foreach ( $auto_options as $name => $val ) {
$v=themify_get( $prefix . 'autoplay' );
$output .= '<option value="' . $val . '" ' . selected( $v, $v ? $val : 4000, false ) . '>' . esc_html( $name ) . '</option>';
<span class="label">' . __( 'Effect', 'themify' ) . '</span>
<select name="' . $prefix. 'effect">' .
themify_options_module( $effect_options, $prefix . 'effect' ) . '
<span class="label">' . __( 'Transition Speed', 'themify' ) . '</span>
<select name="' . $prefix . 'transition_speed">';
$transition=themify_get( $prefix . 'transition_speed' );
foreach ( $speed_options as $name => $val ) {
$output .= '<option value="' . $val . '" ' . selected( $transition, $transition? $val : 500, false ) . '>' . esc_html( $name ) . '</option>';
return apply_filters( 'themify_generic_slider_controls', $output );
* Display select element with featured image sizes + blank slot
* @param String $key setting name
function themify_feature_image_sizes_select($key = ''){
/** Define WP Featured Image sizes + blank + Themify's image script
$themify_layout_feature_sizes = themify_get_image_sizes_list();
$output = '<p class="show_if_disabled_img_php">
<span class="label">' . __('Featured Image Size', 'themify') . '</span>
<select name="setting-' . $key . '">';
$val=themify_get('setting-'.$key,false,true);
foreach($themify_layout_feature_sizes as $option){
$sel=$option['value']===$val?' selected="selected"':'';
$output .= '<option'.$sel.' value="' . $option['value'] . '">' . esc_html( $option['name'] ) . '</option>';
$output .= '</select></p>';
if ( ! function_exists( 'themify_theme_mega_menu_controls' ) ) {
* @param array $data Theme settings data
* @return string Markup for module.
function themify_theme_mega_menu_controls( $data = array() ) {
* Theme Settings Option Key Prefix
$key = 'setting-mega_menu';
<span class="label">' . __( 'Mega Menu Posts', 'themify' ) .themify_help(__( 'Number of posts to show on mega menu.', 'themify' )) . '</span>
<input type="text" name="'.$key.'_posts" value="' . esc_attr( themify_get( $key.'_posts', 5,true ) ) . '" class="width2">' . __( 'Posts', 'themify' ) .'
<span class="label">' . __( 'Mega Post Image', 'themify' ) .themify_help(__( 'Enter featured image size on mega menu posts.', 'themify' )) . '</span>
<input type="text" name="'.$key.'_image_width" value="' . esc_attr( themify_get( $key.'_image_width', 180,true ) ) . '" class="width2"> X <input type="text" name="'.$key.'_image_height" value="' . esc_attr( themify_get( $key.'_image_height', 120,true ) ) . '" class="width2"> ' . __( 'px', 'themify' ) .'
return apply_filters('themify_mega_menu_settings',$out);
* Display google map api key input
function themify_google_map_key($data=array()){
$value = themify_get( 'setting-google_map_key','',true);
$validate = !empty($value) && strip_tags( $value ) !== $value ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
<span class="label">' . __( 'Google Map Key', 'themify' ) . '</span> <input type="text" class="width10" name="setting-google_map_key" value="' . esc_attr( $value ) . '" /> <br />' .
'<span class="pushlabel"><small>' . sprintf( __( 'Google API key is required to use Builder Map module and Map shortcode. <a href="%s" target="_blank" rel="noopener">Generate an API key</a> and insert it here. Also, please ensure you\'ve setup a <a href="%s" target="_blank" rel="noopener">billing plan</a>.', 'themify' ), '//developers.google.com/maps/documentation/javascript/get-api-key#key', 'https://support.google.com/googleapi/answer/6158867' ) . '</small></span>' .
* Display bing map api key input
function themify_bing_map_key($data=array()){
$value = themify_get( 'setting-bing_map_key','',true );
$validate = !empty($value) && strip_tags( $value ) !== $value ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
return '<p><span class="label">' . __( 'Bing Maps Key', 'themify' ) . '</span> <input type="text" class="width10" name="setting-bing_map_key" value="' . esc_attr( $value ) . '" /> <br />
<span class="pushlabel"><small>' . sprintf( __( 'To use Bing Maps, <a href="%s" target="_blank" rel="noopener">generate an API key</a> and insert it here.', 'themify' ), 'https://msdn.microsoft.com/en-us/library/ff428642.aspx' ) . '</small></span>' . $validate . '</p>';
* Display Cloudflare api key input
function themify_cloudflare_setting($data=array()){
$key='setting-clf_email';
$email=themify_get( $key,'',true );
$output = '<p><span class="label">' . __( 'Account Email', 'themify' ) . '</span> <input type="email" class="width8" name="'.$key.'" value="' . esc_attr( $email ) . '" /></p>';
$api=themify_get( $key,'',true );
$validate = !empty($api) && strip_tags( $api ) !== $api ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
$output .= '<p><span class="label">' . __( 'API Key', 'themify' ) . '</span> <input type="text" class="width10" name="'.$key.'" value="' . esc_attr( $api ) . '" />' . $validate . '</p>';
$key='setting-clf_z_'.crc32($email.$api);
$zone=themify_get( $key,'',true );
$output .= '<input type="hidden" name="'.$key.'" value="' . esc_attr( $zone ) . '" />';
$output .= '<p><span class="pushlabel"><small>' . __( 'To clear Cloudflare cache upon theme update or purge Themify cache, please login to your Cloudflare account and insert your information here.', 'themify' ) . '</small></span></p>';
* Display recaptcha api key input
function themify_recaptcha_setting($data=array()){
$version=Themify_Builder_Model::getReCaptchaOption( 'version');
$selected = $version=='v'.$i?' selected="selected"':'';
$options.='<option value="v'.$i.'"'.$selected.'>Version '.$i.'</option>';
$public_key = Themify_Builder_Model::getReCaptchaOption( 'public_key' );
$private_key = Themify_Builder_Model::getReCaptchaOption( 'private_key' );
$output='<p><span class="label">' . __( 'ReCaptcha Version', 'themify' ) . '</span><select name="setting-recaptcha_version">'.$options.'</select></p>';
$validate = !empty($public_key) && strip_tags( $public_key ) !== $public_key ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
$output.='<p><span class="label">' . __( 'ReCaptcha Site Key', 'themify' ) . '</span> <input type="text" class="width10" name="setting-recaptcha_site_key" value="' . esc_attr( $public_key ) . '" /> ' . $validate . ' </p>';
$validate = !empty($private_key) && strip_tags( $private_key ) !== $private_key ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
$output.='<p><span class="label">' . __( 'ReCaptcha Secret Key', 'themify' ) . '</span> <input type="text" class="width10" name="setting-recaptcha_secret_key" value="' . esc_attr( $private_key ) . '" /><br/><span class="pushlabel"><small>'.sprintf( __( 'Go to <a target="_blank" href="%s" rel="noopener">reCAPTCHA Admin Console</a> to create API keys for your domain. A Google account is required.', 'themify' ), 'https://www.google.com/recaptcha/admin' ).'</small></span> ' . $validate . '</p>';
* Display hcaptcha api key input
function themify_hcaptcha_setting($data=array()){
$secret_key = themify_builder_get( 'setting-hcaptcha_secret', 'hcaptcha_secret' );
$site_key = themify_builder_get( 'setting-hcaptcha_site', 'hcaptcha_site' );
$validate = !empty($secret_key) && strip_tags( $secret_key ) !== $secret_key ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
$output = '<p><span class="label">' . __( 'hCaptcha Secret Key', 'themify' ) . '</span> <input type="text" class="width10" name="setting-hcaptcha_secret" value="' . esc_attr( $secret_key ) . '" /><br/><span class="pushlabel"><small>' . sprintf( __( 'You can find the secret key on your hCaptcha <a href="%s" target="_blank">profile page</a>.', 'themify' ), 'https://dashboard.hcaptcha.com/settings' ) . '</small></span> ' . $validate . '</p>';
$validate = !empty($site_key) && strip_tags( $site_key ) !== $site_key ? sprintf( '<div class="notice notice-error"><p>%s</p></div>', __( 'This field must not contain HTML tags, please enter just the API key.', 'themify' ) ) : '';
$output .= '<p><span class="label">' . __( 'hCaptcha Site Key', 'themify' ) . '</span> <input type="text" class="width10" name="setting-hcaptcha_site" value="' . esc_attr( $site_key ) . '" /><br/><span class="pushlabel"><small>' . sprintf( __( 'You can find the site key from the <a href="%s" target="_blank">sites page</a> on your hCaptcha profile. Note that you also need to add your site domain(s) in the site key.', 'themify' ), 'https://dashboard.hcaptcha.com/sites' ) . '</small></span> ' . $validate . '</p>';
function themify_video_gdpr($data=array()){
$imgVal=themify_get( $imgKey,'',true );
<label class="label" for="'.$key.'">' . __( 'GDPR', 'themify' ) . '</label>
<select name="'.$key.'" .id="'.$key.'">
<option value="">' . __( 'Disabled', 'themify' ) . '</option>
<option value="1" ' . selected( 'on', themify_get($key,'',true ), false ) . '>' . __( 'Enable', 'themify' ) . '</option>
<small class="description">' . __( 'Once it is enabled, only logged-in users can see your site.', 'themify' ) . '</small>
<div data-show-if-element="[name='.$key.']" data-show-if-value="1">
<label class="label" for="'.$imgKey.'">' . __( 'Show Image', 'themify' ) . '</label>
<div class="icon-preview">
<img id="' . $imgKey . '-preview" src="' . $imgVal . '" loading="lazy" decoding="async" />
<input id="'.$imgKey.'" type="text" class="width10" name="'.$imgKey.'" value="' . $imgVal . '" />
'.themify_get_uploader($imgKey,$media).'
* Add Maintenance mode option
function themify_maintenance_mode_settings() {
$pre = 'setting-page_builder_';
$value = themify_builder_get( $pre . 'maintenance_mode', 'tools_maintenance_mode' );
<label class="label" for="tb_maintenance_mode">' . __( 'Maintenance', 'themify' ) . '</label>
<select name="' . $pre . 'maintenance_mode">
<option value="">' . __( 'Disabled', 'themify' ) . '</option>
<option value="on" ' . selected( 'on', $value, false ) . '>' . __( 'Enable and display a page', 'themify' ) . '</option>
<option value="message" ' . selected( 'message', $value, false ) . '>' . __( 'Enable and display a message', 'themify' ) . '</option>
<small class="description">' . __( 'Once it is enabled, only logged-in users can see your site.', 'themify' ) . '</small>
$message = themify_builder_get( 'setting-maintenance_message', 'tools_maintenance_message' );
<div data-show-if-element="[name=setting-page_builder_maintenance_mode]" data-show-if-value="message">
<textarea name="setting-maintenance_message" class="width10">' . esc_html( $message ) . '</textarea>
$selected_value = themify_builder_get( 'setting-page_builder_maintenance_page', 'tools_maintenance_page' );
$selected_page = empty($selected_value) ? '' : get_page_by_path( $selected_value, OBJECT, 'page' );
$output .= sprintf( '<div data-show-if-element="[name=setting-page_builder_maintenance_mode]" data-show-if-value="on"><label class="label" for="%s">%s</label><select id="%s" name="%s">%s<option>%s</option></select><div data-show-if-element="[name=page_builder_maintenance_mode]" data-show-if-value="true" class="pushlabel"><small>%s</small></div></div>',
$pre . 'maintenance_page',
__( 'Maintenance Page', 'themify' ),
$pre . 'maintenance_page',
$pre . 'maintenance_page',
!is_object($selected_page) ? '<option></option>' : sprintf('<option value="%s" selected="selected">%s</option>',$selected_value,$selected_page->post_title),
__( 'Loading...', 'themify' ),
__( 'Select a page to show for public users.', 'themify' )
$output .= '<div data-show-if-element="[name=setting-page_builder_maintenance_mode]" data-show-if-value=\'["on", "message"]\'><label class="label">' . __( 'Allow Access', 'themify' ) . themify_help( __('Select the user role(s) to allow viewing when maintenance mode is enabled.', 'themify')) .
'</label><div class="pushlabel">';
$roles = $wp_roles->get_names();
/* administrator role always has access */
unset( $roles['administrator'] );
foreach ( $roles as $key => $label ) {
$selected = themify_builder_get( 'setting-maintenance_access_' . $key, 'maintenance_access_' . $key ) ? ' checked' : '';
$output .= '<label><input name="setting-maintenance_access_' . $key . '" type="checkbox" ' . $selected . ' value="1"> ' . esc_html( $label ) . '</label>';
$output .= '</div></div>';
* Add Google Analytics option
function themify_google_analytics_settings() {
$m_id = themify_get( 'setting-ga_m_id','',true );
return '<p><span class="label">' . __( 'Measurement ID', 'themify' ) . '</span> <input type="text" name="setting-ga_m_id" value="' . esc_attr( $m_id ) . '" /> <br />
<span class="pushlabel"><small>' .
sprintf( __( '<a href="%s">Set up Analytics for your website</a>. Afterwards, go to your <a href="%s">Analytics admin dashboard</a> and select Data Streams, click on the item you want, then copy the Measurement ID (starts with "G-") and paste it here.', 'themify' ), 'https://support.google.com/analytics/answer/9304153', 'https://support.google.com/analytics/answer/6132368' )
* Callback for themify_framework_theme_microdata_config(), to display the options
function themify_framework_theme_microdata_config_callback() {
return '<p><span class="label">' . __('Schema Microdata', 'themify') . '</span> <label for="setting-disable_microdata"><input type="checkbox" id="setting-disable_microdata" name="setting-disable_microdata" '. checked( 'on', themify_get( 'setting-disable_microdata','',true ), false ) .'/> ' . __('Disable schema.org microdata output.', 'themify') . '</label></p>';
* Display Builder Styles page content
function themify_global_styles_page(){
if ( ! current_user_can( 'edit_posts' ) )
wp_die( __( 'You do not have sufficient permissions to update this site.', 'themify' ) );
return Themify_Global_Styles::page_content();
///////////////////////////////////////////
///////////////////////////////////////////
function themify_scrub_func($string=''){
return str_replace(array(' ', '/', ','), array('_', '_', '-'), strtolower($string));
///////////////////////////////////////////
///////////////////////////////////////////
function themify_scrub($string=''){
return str_replace(array('#','-',' ','.',':',',','[',']','=','<','>'), array('_id_','_dash_','_space_','_class_','_colon_','_comma_','_opensquare_','_closesquare_','_equal_','_openbracket_','_closebracket_'), $string);
* Check if multiple plugins are active, returns true only if all of them are
function themify_are_plugins_active( $plugins ) {
foreach( $plugins as $plugin ) {
if( ! is_plugin_active( $plugin ) ) {
if ( ! function_exists( 'themify_lightbox_link_field' ) ) {
* Returns Lightbox Link field definition for themify custom panel
function themify_lightbox_link_field( $args = array() ) {
'name' => 'multi_lightbox_link',
'title' => __('Lightbox Link', 'themify'),
'name' => 'lightbox_link',
'description' => __('Link Featured Image and Post Title to lightbox image, video or iframe URL <br/>(<a href="https://themify.me/docs/lightbox" target="_blank" rel="noopener">learn more</a>)', 'themify'),
'label' => __('iFrame URL', 'themify'),
'name' => 'lightbox_icon',
'label' => __('Add zoom icon on lightbox link', 'themify'),
$field = wp_parse_args( $args, $defaults );
return apply_filters( 'themify_lightbox_link_field', $field );
if( ! function_exists( 'themify_image_dimensions_field' ) ) {
* Multi field: Image dimensions fields to enter width and height.
function themify_image_dimensions_field( $args = array(), $prefix = 'image' ) {
if(!themify_is_image_script_disabled()){
'name' => $prefix . '_dimensions',
'title' => __('Featured Image Size', 'themify'),
'name' => $prefix . '_width',
'label' => __('width', 'themify'),
'meta' => array('size' => 'small')
'name' => $prefix . '_height',
'label' => __('height', 'themify'),
'meta' => array( 'size' => 'small')
'description' => __('Enter height = 0 to disable vertical cropping with image script enabled', 'themify'),
$defaults = array( 'name'=>'','type'=>'' );
$field = wp_parse_args( $args, $defaults );
return apply_filters( 'themify_image_dimensions_field', $field );