wp_create_nonce('tf_nonce'), 'admin_url' => admin_url( 'admin.php?page=themify' ), 'page_not_found' => esc_html__( 'Page not found', 'themify' ) ); // Settings Panel if( $page === 'toplevel_page_themify' ){ wp_enqueue_script( 'jquery-ui-sortable' ); // Load main.js for using fontawsome function themify_enque_script( 'themify-main-script', THEMIFY_URI.'/js/main.js', THEMIFY_VERSION, array('jquery')); Themify_Enqueue_Assets::addLocalization('url', THEMIFY_URI, false); $admin_vars['empty_li']=__('The fileds could not be empty!','themify'); $admin_vars['theme']=get_template(); $admin_vars['erase']=array( 'processing'=>__('Erasing... ','themify'), 'done'=>__('Erasing complete','themify'), 'error'=>__('An error occurred: %error%','themify') ); $admin_vars['license']=array( 'title'=>__('Themify License','themify'), 'labels'=>array( 'name'=>__('Themify Username','themify'), 'key'=>__('License Key','themify'), 'update'=>__('Update','themify'), ), 'link'=> sprintf('%s%s%s',__('Please enter your Themify username and ','themify'),__('license key','themify'),__('. Make sure your membership/license key is active (not expired).','themify')) ); $admin_vars['import']=array( 'posts' => __('Importing Posts (%from%/%to%): %post%', 'themify'), 'terms' => __('Importing Taxonomies (%from%/%to%): %post%', 'themify'), 'menu_items' => __('Importing menu items (%from%/%to%): %post%', 'themify'), 'menu' => __('Importing menus', 'themify'), 'theme' => __('Importing theme Settings', 'themify'), 'done'=>__('Import successfully finished', 'themify'), 'import_gs_data' => __('Importing Global Styling', 'themify'), 'download_images'=> __( 'Downloading images (%from%/%to%):', 'themify' ), 'upload_images'=> __( 'Uploading images (%from%/%to%):', 'themify' ), 'import_skip' => __('Failed import. Skip importing %post%', 'tbp'), 'import_failed' => __('Failed import: %post%', 'themify'), 'download_fail' => __('download failed.', 'themify'), 'upload_fail' => __('upload failed (%msg%)', 'themify'), 'memory'=>(int)(wp_convert_hr_to_bytes(WP_MEMORY_LIMIT)*MB_IN_BYTES) ); if ( ! class_exists( 'Themify_Updater_utils', false ) ) { $tf_tu_utils = WP_PLUGIN_DIR . '/themify-updater/includes/class.utils.php'; if ( is_readable( $tf_tu_utils ) ) { require_once $tf_tu_utils; } } $license_username = ''; $license_key = ''; $license_hide_name = false; $license_hide_key = false; if ( class_exists( 'Themify_Updater', false ) ) { $themify_updater = Themify_Updater::get_instance(); $license_username = (string) $themify_updater->get_setting( 'username' ); $license_key = (string) $themify_updater->get_setting( 'key' ); $license_hide_name = (bool) $themify_updater->get_setting( 'hideName' ); $license_hide_key = (bool) $themify_updater->get_setting( 'hideKey' ); unset( $themify_updater ); } else { $license_opt = get_option( 'themify_updater_licence', '' ); if ( is_string( $license_opt ) && $license_opt !== '' ) { $license_dec = json_decode( $license_opt, true ); if ( is_array( $license_dec ) ) { $license_username = isset( $license_dec['username'] ) ? preg_replace( '/[^0-9A-Za-z_-]/', '', (string) $license_dec['username'] ) : ''; $license_key = isset( $license_dec['key'] ) ? preg_replace( '/[^0-9A-Za-z]/', '', (string) $license_dec['key'] ) : ''; $license_hide_name = ! empty( $license_dec['hideName'] ); $license_hide_key = ! empty( $license_dec['hideKey'] ); } } } if ( class_exists( 'Themify_Updater_utils', false ) ) { if ( $license_hide_name && $license_username !== '' ) { $license_username = Themify_Updater_utils::preg_replace( $license_username, 'username', '*' ); } if ( $license_hide_key && $license_key !== '' ) { $license_key = Themify_Updater_utils::preg_replace( $license_key, 'key', '*' ); } } $admin_vars['license']['username'] = $license_username; $admin_vars['license']['key'] = $license_key; //used icons themify_get_icon('info','ti'); themify_get_icon('alert','ti'); themify_get_icon('check','ti'); themify_get_icon('cog','fa'); } if( in_array( $page, $pages,true ) ) { //Enqueue styles wp_enqueue_style( 'themify-ui' ); wp_enqueue_style( 'themify-metabox' ); if ( is_rtl() ) { wp_enqueue_style( 'themify-ui-rtl' ); } wp_enqueue_style( 'themify-colorpicker' ); //Enqueue scripts wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'jquery-ui-core' ); wp_enqueue_script( 'jquery-ui-tabs' ); wp_enqueue_script( 'jquery-ui-slider' ); if( 'themify' === $pagenow){ wp_enqueue_script( 'jquery-ui-autocomplete' ); } wp_enqueue_script( 'json2' ); wp_enqueue_script( 'plupload-all' ); wp_enqueue_script( 'markjs' ); wp_enqueue_script( 'themify-colorpicker' ); if( in_array($typenow, $types,true) || in_array( $pagenow, $pagenows,true ) ){ //Don't include Themify JavaScript if we're not in one of the Themify-managed pages wp_enqueue_script( 'themify-scripts' ); wp_enqueue_script( 'themify-plupload' ); Themify_Metabox::get_instance()->enqueue(); } // Enqueue font icon assets. wp_enqueue_style( 'themify-icons' ); Themify_Icon_Font::enqueue(); wp_enqueue_style ( 'magnific' ); wp_enqueue_script( 'magnific' ); } wp_localize_script('themify-scripts', 'themify_js_vars', $admin_vars); wp_localize_script('themify-scripts', 'themify_lang', array( 'confirm_reset_settings' => __('Are you sure you want to reset your theme settings?', 'themify'), 'check_backup' => __('Make sure to backup before upgrading. Files and settings may get lost or changed.', 'themify'), 'confirm_delete_image' => __('Do you want to delete this image permanently?', 'themify'), 'confirm_demo' => __( 'This will import demo and override current Themify panel settings.', 'themify' ), ) ); wp_localize_script('themify-plupload', 'themify_plupload_lang', array( 'enable_zip_upload' => sprintf( __('Install the "File Upload Types" plugin and add the file extension upload support.', 'themify'), esc_url( network_admin_url('settings.php').'#upload_filetypes' ) ), 'filesize_error' => __('The file you are trying to upload exceeds the maximum file size allowed.', 'themify'), 'filesize_error_fix' => sprintf( __('Go to your Network Settings and increase the value of the Max upload file size.', 'themify'), esc_url( network_admin_url('settings.php').'#fileupload_maxk' ) ) ) ); // Enqueu admin widgets stuff if( $page === 'index.php' && themify_is_themify_theme()) { wp_enqueue_style( 'themify-admin-widgets-css' ); wp_enqueue_script( 'themify-admin-widgets-js' ); } } /** * Checks if current user is allowed to view the update interface. * * @since 2.0.0 * * @return bool */ function themify_allow_update() { return current_user_can( 'update_themes' ); } /////////////////////////////////////////// // Create Nav Options /////////////////////////////////////////// function themify_admin_nav() { global $submenu; $theme = wp_get_theme(); $name = $theme->display('Name'); $can_manage_option = current_user_can( 'manage_options' ); /** * Add Themify menu entry * @since 2.0.2 */ $themify_page = add_menu_page( 'themify',$name , 'edit_posts', 'themify', $can_manage_option?'themify_page':'', THEMIFY_URI . '/img/favicon.svg', '49.3' ); /** * Add Themify settings page * @since 2.0.2 */ if($can_manage_option){ add_submenu_page( 'themify', $name, __('Themify Settings', 'themify'), 'manage_options', 'themify', 'themify_page' ); } if ( class_exists('Themify_Builder_Model',false) && Themify_Builder_Model::builder_check() ) { /** * Add Themify Builder Layouts page * @since 2.0.2 */ add_submenu_page ( 'themify', __( 'Saved Layouts', 'themify' ), __( 'Saved Layouts', 'themify' ), 'edit_posts', 'edit.php?post_type=tbuilder_layout' ); /** * Add Themify Builder Layout Parts page * @since 2.0.2 */ add_submenu_page( 'themify', __( 'Layout Parts', 'themify' ), __( 'Layout Parts', 'themify' ), 'edit_posts', 'edit.php?post_type=tbuilder_layout_part' ); /** * Add Themify Global Styles page * @since 4.5.0 */ add_submenu_page ( 'themify', __( 'Global Styles', 'themify' ), __( 'Global Styles', 'themify' ), 'edit_posts', 'themify-global-styles', 'themify_global_styles_page' ); } /** * Add Themify Custom Fonts page * @since 4.6.3 */ add_submenu_page( 'themify', __( 'Custom Fonts', 'themify' ), __( 'Custom Fonts', 'themify' ), 'edit_posts', 'edit.php?post_type=tb_cf' ); /** * Add Themify Customize submenu entry * @since 2.0.2 */ add_submenu_page( 'themify', 'themify_customize', __( 'Customize', 'themify' ), 'manage_options', 'customize.php?themify=1' ); if ( is_plugin_active( 'themify-updater/themify-updater.php' ) ) { /** * Add Themify Updater License page link * @since 4.2.2 */ add_submenu_page ( 'themify', __( 'Themify License', 'themify' ), __( 'Themify License', 'themify' ), 'manage_options', 'index.php?page=themify-license' ); } if ( $can_manage_option ) { $submenu['themify'][] = array( __( 'Documentation', 'themify' ), 'manage_options', 'https://themify.me/docs/' . str_replace( 'themify-', '', $theme->get_template() ) ); $submenu['themify'][] = array( __( 'Contact Support', 'themify' ), 'manage_options', 'https://themify.me/new-topic/' ); } else { remove_submenu_page('themify','themify'); } } function themify_get_theme_required_plugins() { $info = get_file_data( trailingslashit( get_template_directory() ) . 'style.css', array( 'Required Plugins' ) ); return isset( $info[0] )?$info[0]:''; } /* Pages /***************************************************************************/ function themify_sort_config($themify_config) { $themify_config['panel']['settings']['tab']['theme_settings']['custom-module'][] = array( 'title' => __('Accessibility', 'themify'), 'function' => 'accessibility_options' ); $defaultModules=array( 'general'=>array( array( 'title' => __('Favicon', 'themify'), 'function' => 'favicon', 'target' => 'uploads/favicon/' ), array( 'title' => __('Header Code', 'themify'), 'function' => 'header_html' ), array( 'title' => __('Footer Code', 'themify'), 'function' => 'footer_html' ), array( 'title' => __('Google Analytics', 'themify'), 'function' => 'themify_google_analytics_settings' ), array( 'title' => __('Search Settings', 'themify'), 'function' => 'search_settings' ), array( 'title' => __('Error 404 Page', 'themify'), 'function' => 'page_404_settings' ), array( 'title' => __('Google Fonts', 'themify'), 'function' => 'themify_webfonts_subsets' ), array( 'title' => __('Schema Microdata', 'themify'), 'function' => 'themify_framework_theme_microdata_config_callback' ), array( 'title' => __('Maintenance Mode', 'themify'), 'function' => 'themify_maintenance_mode_settings' ), array( 'title' => __('Feed Settings', 'themify'), 'function' => 'feed_settings' ), array( 'title' => __('Custom Feed URL', 'themify'), 'function' => 'custom_feed_url' ), ), 'performance'=>array( array( 'title' => '', 'function' => 'performance_settings' ) ), 'social_links'=>array( array( 'title' => __('Manage Social Links', 'themify'), 'function' => 'themify_manage_links' ) ), 'image_script'=> array( array( 'title' => __('Image Script Settings', 'themify'), 'function' => 'img_settings' ) ), 'integration-api'=>array( array( 'title' => __('Google Map API Settings', 'themify'), 'function' => 'themify_google_map_key' ), array( 'title' => __('Bing Map API Settings', 'themify'), 'function' => 'themify_bing_map_key' ), array( 'title' => __('Azure Map API Settings', 'themify'), 'function' => 'themify_azure_map_key' ), array( 'title' => __('Cloudflare API Settings', 'themify'), 'function' => 'themify_cloudflare_setting' ), array( 'title' => __('reCaptcha API Settings', 'themify'), 'function' => 'themify_recaptcha_setting' ), array( 'title' => __( 'hCaptcha API Settings', 'themify' ), 'function' => 'themify_hcaptcha_setting' ), array( 'title' => __('Cloudflare Turnstile API Settings', 'themify'), 'function' => 'themify_turnstile_setting' ), // array( //'title' => __('Youtube/Vimeo GDPR', 'themify'), //'function' => 'themify_video_gdpr' // ), ), 'custom-icon-font'=>array( array( 'title' => __('Custom Icon Font', 'themify'), 'function' => 'themify_fontello_input_callback', ), ) ); foreach($defaultModules as $k=>$def){ if(isset($themify_config['panel']['settings']['tab'][$k]['custom-module'])){ $defaultModules[$k]=array_merge($def,$themify_config['panel']['settings']['tab'][$k]['custom-module']); } } $themify_config['panel']['settings']['tab']['general'] = array( 'title' => __('General', 'themify'), 'id' => 'general', 'custom-module' =>$defaultModules['general'] ); $themify_config['panel']['settings']['tab']['performance'] = array( 'title' => __('Performance', 'themify'), 'id' => 'performance', 'custom-module' => $defaultModules['performance'] ); $themify_config['panel']['settings']['tab']['social_links'] = array( 'title' => __('Social Links', 'themify'), 'id' => 'social_links', 'custom-module' => $defaultModules['social_links'] ); $themify_config['panel']['settings']['tab']['image_script'] = array( 'title' => __('Image Script', 'themify'), 'id' => 'image_script', 'custom-module' =>$defaultModules['image_script'] ); $themify_config['panel']['settings']['tab']['integration-api'] = array( 'title' => __('Integration API', 'themify'), 'id' => 'integration-api', 'custom-module' => $defaultModules['integration-api'] ); $themify_config['panel']['settings']['tab']['custom-icon-font'] = array( 'title' => __('Custom Icon Font', 'themify'), 'id' => 'custom-icon-font', 'custom-module' => $defaultModules['custom-icon-font'] ); unset($defaultModules); $ordered=array(); $sort=array('general','default_layouts','performance','theme_settings','shop_settings','portfolio_layouts','page_builder','social_links','hook-content','image_script','integration-api','role_access','custom-icon-font'); foreach($sort as $v){ if(isset($themify_config['panel']['settings']['tab'][$v])){ $ordered['panel']['settings']['tab'][$v]=$themify_config['panel']['settings']['tab'][$v]; unset($themify_config['panel']['settings']['tab'][$v]); } } if(!empty($themify_config['panel']['settings']['tab'])){ foreach($themify_config['panel']['settings']['tab'] as $k=>$v){ $ordered['panel']['settings']['tab'][$k]=$v; } } return apply_filters('themify_theme_config_sort',$ordered); } /////////////////////////////////////////// // Themify Page /////////////////////////////////////////// function themify_page() { if ( ! current_user_can( 'manage_options' ) ) wp_die( __( 'You do not have sufficient permissions to update this site.', 'themify' ) ); if (isset($_GET['action'])) { $action = 'upgrade'; themify_updater(); } /** * Load themify_config */ $themify_theme_config=array(); include locate_template(array('custom-config.php', 'theme-config.php')); $themify_config = apply_filters('themify_theme_config_setup', $themify_theme_config); unset($themify_theme_config); $themify_config=themify_sort_config($themify_config); // check theme information $theme = wp_get_theme(); $is_child = is_child_theme(); $check_theme_name = $is_child? $theme->parent()->Name : $theme->display('Name'); $check_theme_version = $is_child ? $theme->parent()->Version : $theme->display('Version'); /** * Markup for Themify skins. It's empty if there are no skins * @since 2.1.8 * @var string */ $themify_skins = themify_get_skins(); /* special admin tab that shows available skins with option to import demo separately for each */ $skins_and_demos = current_theme_supports( 'themify-skins-and-demos' ); ?>

()

    class="selected">
' . __( 'Here you can set the Default Layouts for WordPress archive post layout (category, search, archive, tag pages, etc.), single post layout (single post page), and the static Page layout. The default single post and page layout can be override individually on the post/page > edit > Themify Custom Panel.', 'themify' ) . '
'; } ?>
parent() : $theme; if ( ! method_exists($updater, 'themify_reinstall_theme') ) : ?>
should_block_themify_reinstall_for_missing_license( $theme->stylesheet ) : ( $updater->has_error() && ! $updater->has_attribute( $theme->stylesheet, 'free' ) ) ) ) : printf( __( 'To use theme re-installation, add your Themify username and license key under Themify License.', 'themify' ) ); $license_modal=true; else: $updater->themify_reinstall_theme( $theme->stylesheet ); endif; else : ?>
is_plugin_installed( 'themify-updater' )?'install':'activate'; $url='#'; $ajax_url = wp_nonce_url( add_query_arg( array( 'plugin' => urlencode( 'themify-updater' ), 'tgmpa-' . $action => $action . '-plugin', 'auto_activate' => 1, ), $tgmpa_instance->get_tgmpa_url() ), 'tgmpa-' . $action, 'tgmpa-nonce' ); }else{ $url=admin_url( 'admin.php?page=themify-install-plugins' ); } ?> Themify Updater plugin and insert your Themify username/license key.', 'themify' ), $url,('#'!==$url ? ' target="_blank" rel="noopener"' : ' data-ajax="'.esc_url($ajax_url).'"') ); ?>


array( array( 'name' => __( 'Default', 'themify' ), 'version' => null, 'description' => null, 'screenshot' => get_template_directory_uri() . '/themify/img/non-skin.gif', ), ), ); if ( is_dir( $dir ) && ($handle = opendir( $dir ) )) { // Grab Folders while ( false !== ( $dirTwo = readdir($handle) ) ) { if( $dirTwo !== '.' && $dirTwo !== '..' ) { $path = trailingslashit( $dir ) . $dirTwo; if( is_file( $path . '/style.css' ) ) { $info = get_file_data( $path . '/style.css', array( 'Skin Name', 'Version', 'Description', 'Demo URI', 'Required Plugins', 'Display Order' ) ); $order = empty( $info[5] ) ? 10 : $info[5]; $skins[ $order ][ $dirTwo ] = array( 'name' => $info[0], 'version' => $info[1], 'description' => $info[2], 'demo_uri' => $info[3], 'required_plugins' => $info[4], ); } } } closedir($handle); } ksort( $skins ); // sort skin groups ksort( $skins[10] ); // sort by skin name $skins = call_user_func_array( 'array_merge', $skins ); return apply_filters( 'themify_theme_skins', $skins ); } /** * Display the admin field for the theme skins * * @return string */ function themify_get_skins_admin(){ $skins = themify_get_skins(); $output = ''; $template = get_template(); $skins_with_demos = current_theme_supports( 'themify-skins-and-demos' ); if( ! empty( $skins ) ) { $current=themify_get_skin(); $canImport = current_user_can('manage_options'); $hasDemo=current_user_can('delete_pages') && Themify_Import_Helper::has_demo_content(); foreach( $skins as $id => $skin ) { $selected = $current === $id ? 'selected' : ''; $screenshot = 0 === $id ? get_template_directory_uri() . '/themify/img/screenshot-na.png' : 'https://themify.org/public-api/screenshots/' . $template . '/' . $id . '/screenshot.jpg'; if( ($id === 'default' || 0 === $id) &&(!$current || $current==='default')) { $selected = 'selected'; } $output .= '
' . esc_attr__( 'Skin', 'themify' ) . '
' . $skin['name']; if(! empty( $skin['demo_uri'] ) ) { $output .= sprintf( ' %s', $skin['demo_uri'], __( 'demo', 'themify' ) ); } if( $skins_with_demos && $canImport) { $output .= '
'; $output .= __( 'Demo:', 'themify' ); $output .= ' ' . __( 'Import', 'themify' ).''; if($hasDemo===true){ $output.='' . __( 'Erase', 'themify' ) . ''; $output .='
'.__( 'Erase Demo', 'themify' ).'
'; } $output .= '
'; } $output .= '
'; } } return $output; } /** * Create Settings Fieldset * * @param string $title * @param string $module * @param string $attr * @param bool $wrap whether to output the module wrapper * * @return string */ function themify_fieldset( $title = '', $module = '', $attr = '', $wrap = true ) { $data = themify_get_data(); $data_param = isset( $data['setting'][$title] )? $data['setting'][$title] : ''; if( is_array( $module ) && is_callable( $module ) ) { $function = $module; } else { $function = ''; $module = trim( $module ); $module = themify_scrub_func( $module ); if ( function_exists( 'themify_' . $module ) ) { $function = 'themify_' . $module; } else if ( function_exists( $module ) ) { $function = $module; } if ( '' == $function ) { return ''; } } $output = call_user_func( $function, array( 'data' => $data_param, 'attr' => $attr ) ); if ( $wrap ) { $tmp_id = is_string( $function ) ? 'id="'. esc_attr( $function ) .'"' : '' ; $output = '
' . esc_html( $title ) . '
' . $output . '
'; } return $output; } /** * Get details about a known plugin * * @param $name if omitted, returns the entire list * @since 2.8.6 */ function themify_get_known_plugin_info( $name = '' ) { $plugins = array( 'builder-ab-image' => array( 'name' => __( 'Builder A/B Image', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/ab-image.jpg', 'desc' => 'Compare 2 images side by side', 'page' => 'https://themify.me/addons/ab-image', 'path' => 'builder-ab-image/init.php', ), 'builder-audio' => array( 'name' => __( 'Builder Audio', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/audio.jpg', 'desc' => 'Elegant audio playlist', 'page' => 'https://themify.me/addons/audio', 'path' => 'builder-audio/init.php' ), 'builder-button' => array( 'name' => __( 'Builder Button Pro', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/button.jpg', 'desc' => 'Custom designed action buttons', 'page' => 'https://themify.me/addons/button', 'path' => 'builder-button/init.php' ), 'builder-contact' => array( 'name' => __( 'Builder Contact', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/contact.jpg', 'desc' => 'Simple contact form', 'page' => 'https://themify.me/addons/contact', 'path' => 'builder-contact/init.php' ), 'builder-countdown' => array( 'name' => __( 'Builder Countdown', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/countdown.jpg', 'desc' => 'Count down events and promotions', 'page' => 'https://themify.me/addons/countdown', 'path' => 'builder-countdown/init.php' ), 'builder-counter' => array( 'name' => __( 'Builder Counter', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/counter.jpg', 'desc' => 'Animated circles and number counters', 'page' => 'https://themify.me/addons/counter', 'path' => 'builder-counter/init.php' ), 'builder-fittext' => array( 'name' => __( 'Builder FitText', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/fittext.jpg', 'desc' => 'Auto fit text in the container', 'page' => 'https://themify.me/addons/fittext', 'path' => 'builder-fittext/init.php' ), 'builder-image-pro' => array( 'name' => __( 'Builder Image Pro', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/image-pro.jpg', 'desc' => 'Beautify images with image filters, color/image overlay, and animation effects', 'page' => 'https://themify.me/addons/image-pro', 'path' => 'builder-image-pro/init.php' ), 'builder-infinite-posts' => array( 'name' => __( 'Builder Infinite Posts', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/infinite-posts.jpg', 'desc' => 'Display posts in infinite scrolling on parallax, grid, overlay, or list view', 'page' => 'https://themify.me/addons/infinite-posts', 'path' => 'builder-infinite-posts/init.php' ), 'builder-bar-chart' => array( 'name' => __( 'Builder Bat Chart', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/bar-chart.jpg', 'desc' => 'Display bar graphs', 'page' => 'https://themify.me/addons/bar-chart', 'path' => 'builder-bar-chart/init.php' ), 'builder-maps-pro' => array( 'name' => __( 'Builder Maps Pro', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/maps-pro.jpg', 'desc' => 'Multiple markers, custom icons, tooltips, and 40+ map styles', 'page' => 'https://themify.me/addons/maps-pro', 'path' => 'builder-maps-pro/init.php' ), 'builder-pie-chart' => array( 'name' => __( 'Builder Pie Chart', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/pie-chart.jpg', 'desc' => '', 'page' => 'https://themify.me/addons/pie-chart', 'path' => 'builder-pie-chart/init.php' ), 'builder-pointers' => array( 'name' => __( 'Builder Pointers', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/pointers.jpg', 'desc' => 'Highlight certain areas of your image', 'page' => 'https://themify.me/addons/pointers', 'path' => 'builder-pointers/init.php' ), 'builder-pricing-table' => array( 'name' => __( 'Builder Pricing Table', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/pricing-table.jpg', 'desc' => 'Beautiful and responsive pricing table addon', 'page' => 'https://themify.me/addons/pricing-table', 'path' => 'builder-pricing-table/init.php' ), 'builder-progress-bar' => array( 'name' => __( 'Builder Progress Bar', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/progress-bar.jpg', 'desc' => 'Animated bars based on input percentage', 'page' => 'https://themify.me/addons/progress-bar', 'path' => 'builder-progress-bar/init.php' ), 'builder-slider-pro' => array( 'name' => __( 'Builder Slider Pro', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/slider-pro.jpg', 'desc' => 'Make stunning sliders with transition and animation effects', 'page' => 'https://themify.me/addons/slider-pro', 'path' => 'builder-slider-pro/init.php' ), 'builder-tiles' => array( 'name' => __( 'Builder Tiles', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/tiles.jpg', 'desc' => 'Drag & drop tiles to create Windows 8 Metro layouts', 'page' => 'https://themify.me/addons/tiles', 'path' => 'builder-tiles/init.php' ), 'builder-timeline' => array( 'name' => __( 'Builder Timeline', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/timeline.jpg', 'desc' => 'Display content in a timeline-styled layouts', 'page' => 'https://themify.me/addons/timeline', 'path' => 'builder-timeline/init.php' ), 'builder-typewriter' => array( 'name' => __( 'Builder Typewriter', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/typewriter.jpg', 'desc' => 'Display your text with eye-catching typing animation', 'page' => 'https://themify.me/addons/typewriter', 'path' => 'builder-typewriter/init.php' ), 'builder-woocommerce' => array( 'name' => __( 'Builder WooCommerce', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/woocommerce.jpg', 'desc' => 'Show WooCommerce products anywhere in the Builder', 'page' => 'https://themify.me/addons/woocommerce', 'path' => 'builder-woocommerce/init.php' ), 'contact-form-7' => array( 'name' => __( 'Contact Form 7', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/ab-image.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/contact-form-7/', 'path' => 'contact-form-7/wp-contact-form-7.php', 'wp_hosted'=>true ), 'themify-portfolio-post' => array( 'name' => __( 'Portfolio Posts', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/ab-image.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/themify-portfolio-post/', 'path' => 'themify-portfolio-post/themify-portfolio-post.php', 'wp_hosted'=>true ), 'mailchimp-for-wp' => array( 'name' => __( 'MailChimp for WordPress', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/ab-image.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/mailchimp-for-wp/', 'path' => 'mailchimp-for-wp/mailchimp-for-wp.php', 'wp_hosted'=>true ), 'woocommerce' => array( 'name' => __( 'WooCommerce', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/ab-image.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/woocommerce/', 'path' => 'woocommerce/woocommerce.php', 'wp_hosted'=>true ), 'themify-wc-product-filter' => array( 'name' => __( 'Themify Product Filter', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/ab-image.jpg', 'desc' => '', 'page' => 'https://themify.me/themify-product-filter', 'path' => 'themify-wc-product-filter/themify-wc-product-filter.php' ), 'themify-shortcodes' => array( 'name' => __( 'Themify Shortcodes', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/themify-shortcodes.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/themify-shortcodes/', 'path' => 'themify-shortcodes/init.php', 'wp_hosted'=>true ), 'themify-event-post' => array( 'name' => __( 'Themify Event Post', 'themify' ), 'image' => 'https://themify.me/wp-content/product-img/addons/themify-shortcodes.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/themify-event-post/', 'path' => 'themify-event-post/themify-event-post.php', 'wp_hosted'=>true ), 'learnpress' => array( 'name' => __( 'LearnPress', 'themify' ), 'image' => 'https://ps.w.org/learnpress/assets/icon-256x256.png', 'desc' => '', 'page' => 'https://wordpress.org/plugins/learnpress/', 'path' => 'learnpress/learnpress.php', 'wp_hosted'=>true ), 'themify-store-locator'=>array( 'name' => __( 'Themify Store Locator', 'themify' ), 'image' => 'https://themify.me/wp-content/uploads/2016/12/store-locator-blog-image.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/themify-store-locator/', 'path' => 'themify-store-locator/store_locator.php', 'wp_hosted'=>true ), 'themify-updater' => array( 'name' => __( 'Themify Updater', 'themify' ), 'image' => '', 'desc' => '', 'page' => 'https://themify.me/docs/themify-updater-documentation', 'path' => 'themify-updater/themify-updater.php' ), 'give' => array( 'name' => __( 'Give', 'themify' ), 'image' => 'https://ps.w.org/give/assets/icon-256x256.jpg', 'desc' => '', 'page' => 'https://wordpress.org/plugins/give/', 'path' => 'give/give.php', 'wp_hosted'=>true ), ); return $name===''?$plugins:(isset( $plugins[$name] )?$plugins[$name]:false); } /** * Themify Admin Widgets */ if( !function_exists( 'themify_add_admin_widgets' ) ): function themify_add_admin_widgets() { wp_add_dashboard_widget( 'themify_news', esc_html__( 'Themify News', 'themify' ), 'themify_news_admin_widget' ); } endif; add_action( 'wp_dashboard_setup', 'themify_add_admin_widgets' ); // Themify News Admin Widget function themify_news_admin_widget() { $cache_key = 'themify_news_dashboard_widget'; echo '
'; if ( false !== ( $output = Themify_Storage::get( $cache_key ) ) ) { echo $output; } else { echo ''; } echo '
'; } function themify_check_update_link( $plugin, $type ) { global $admin_page_hooks; if( !empty($admin_page_hooks[$plugin]) && $type === 'plugin' && strpos( 'builder-' , $plugin) === false ) { return esc_url( admin_url( 'admin.php?page=' . $plugin ) ); } return esc_url( admin_url( 'admin.php?page=themify#update-check' ) ); } /////////////////////////////////////////// // Favicon Module /////////////////////////////////////////// function themify_favicon( $data = array() ) { if($data['attr']['target'] != ''){ $target = "".$data['attr']['target'].""; } else { $target = ''; } $setting_favicon = themify_get( 'setting-favicon','',true ); return '
'. __('Custom Favicon', 'themify') . '
'.$target.' ' . themify_get_uploader('setting-favicon', array('tomedia' => true)) . '
'; } /////////////////////////////////////////// // Default Layouts /////////////////////////////////////////// if (!function_exists('themify_custom_post_type_layouts')) : /** * Default Custom Post sidebar Module * @param array $data Theme settings data * @return string Markup for module. * @since 4.0.0 */ function themify_custom_post_type_layouts($data = array()){ $data = themify_get_data(); /** * Theme Settings Option Key Prefix * @var string */ $prefix = 'setting-custom_post_'; /** * Module markup * @var string */ $output = ''; $custom_posts = null; $post_types = get_post_types(array('public' => true, 'publicly_queryable' => 'true'), 'objects'); $excluded_types = apply_filters( 'themify_exclude_CPT_for_sidebar', array('post', 'page', 'attachment', 'tbuilder_layout', 'tbuilder_layout_part', 'section','tglobal_style')); foreach ($post_types as $key => $value) { if (!in_array($key, $excluded_types)) { $custom_posts[$key] = array( 'name' => $value->labels->singular_name, 'archive' => $value->has_archive ); } } $custom_posts = apply_filters('themify_get_public_post_types', $custom_posts); /** * Sidebar placement options * @var array */ $sidebar_location_options = apply_filters('themify_post_type_theme_sidebars' , array( array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar ', 'themify')) ), false ); /** * Page sidebar placement */ if(is_array($custom_posts)){ foreach($custom_posts as $key => $cPost){ $output .= sprintf('

%s %s

', strtoupper($cPost['name']), __('POST TYPE', 'themify')); if ($cPost['archive']) { $output .= '

'. sprintf('%s %s', ucfirst($cPost['name']), __('Archive Sidebar', 'themify')); $val = isset( $data[$prefix.$key.'_archive'] ) ? $data[$prefix.$key.'_archive'] : ''; foreach ( $sidebar_location_options as $option ) { if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) { $val = $option['value']; } $class = $val == $option['value']?'selected':''; $w= isset($option['w'])?$option['w']:'46'; $h= isset($option['w'])?$option['w']:'35'; $output .= ''.$option['value'].''; } $output .= '

'; $content_width = isset( $data[ $prefix . $key . '_archive_content_width'] ) ? $data[ $prefix . $key . '_archive_content_width'] : 'default_width'; $output .= '

' . sprintf( __( '%s Archive Content Width', 'themify' ), $cPost['name'] ) . ' default_width full_width

'; } $output .= '

'. sprintf('%s %s', ucfirst($cPost['name']), __('Single Sidebar', 'themify')); $val = isset( $data[$prefix.$key.'_single'] ) ? $data[$prefix.$key.'_single'] : ''; foreach ( $sidebar_location_options as $option ) { if ( ( '' == $val || ! $val || ! isset( $val ) ) && ( isset( $option['selected'] ) && $option['selected'] ) ) { $val = $option['value']; } $class = $val == $option['value']?'selected':''; $w= isset($option['w'])?$option['w']:'46'; $h= isset($option['w'])?$option['w']:'35'; $output .= ''.$option['value'].''; } $output .= '

'; $content_width = isset( $data[ $prefix . $key . '_single_content_width'] ) ? $data[ $prefix . $key . '_single_content_width'] : 'default_width'; $output .= '

' . __( 'Default Single Content Width', 'themify' ) . ' default_width full_width

'; } } return $output; } endif; /////////////////////////////////////////// // Custom Feed URL Module /////////////////////////////////////////// function themify_custom_feed_url( $data = array() ) { $custom_feed_url = themify_get( 'setting-custom_feed_url','',true ); return '

' . __( 'Custom Feed URL', 'themify' ) . '
' . __( 'e.g. http://feedburner.com/userid', 'themify' ) . '

'; } /////////////////////////////////////////// // Meta Description Module /////////////////////////////////////////// function themify_meta_description( $data = array() ) { $data = themify_get_data(); return '

'; } /** * Header HTML Module * @param array $data * @return string */ function themify_header_html( $data = array() ) { $header_html = themify_get( 'setting-header_html','',true ); return '

' . __('The following code will add to the <head> tag.', 'themify') . '


' . __('Useful if you need to add additional scripts such as CSS or JS.', 'themify') . '

'; } /** * Footer HTML Module * @param array $data * @return string */ function themify_footer_html( $data = array() ) { $footer_html = themify_get( 'setting-footer_html','',true ); return '

' . __('The following code will be added to the footer before the closing </body> tag.', 'themify') . '


' . __('Useful if you need to Javascript or tracking code.', 'themify') . '

'; } /////////////////////////////////////////// // Search Settings Module /////////////////////////////////////////// function themify_search_settings( $data = array() ) { $data = themify_get_data(); $post_checked = ''; $checked = ''; $search_settings = themify_get( 'setting-search_settings','',true ); if ( themify_check( 'setting-search_settings_exclude',true ) ) { $checked = 'checked="checked"'; } if ( themify_check( 'setting-search_exclude_post',true ) ) { $post_checked = 'checked="checked"'; } $out = '

' . __( 'Search in Category IDs', 'themify' ) .themify_help(__( 'Use minus sign (-) to exclude categories. Example: (1,4,-7) = search only in Category 1 & 4, and exclude Category 7.', 'themify' )) . '

'; $pre = 'setting-search_exclude_'; $checkboxes = ''; $exclude_types = apply_filters( 'themify_types_excluded_in_search', get_post_types( array( '_builtin' => false, 'public' => true, 'exclude_from_search' => false ) ) ); foreach ( array_keys( $exclude_types ) as $post_type ) { $type = get_post_type_object( $post_type ); if ( is_object( $type ) ) { $checkboxes .= '

'; } } if ( '' != $checkboxes ) { $out .= $checkboxes; } return apply_filters('themify_search_settings_output', $out); } /////////////////////////////////////////// // 404 Page Settings Module /////////////////////////////////////////// if( !function_exists( 'page_404_settings' ) ){ function page_404_settings(){ $data = themify_get_data(); $page_404 = themify_get( 'setting-page_404','',true ); $max = 100; $args = array( 'sort_order' => 'asc', 'sort_column' => 'post_title', 'post_type' => 'page', 'ignore_sticky_posts'=>true, 'post_status' => 'publish', 'cache_results'=>false, 'update_post_term_cache'=>false, 'update_post_meta_cache'=>false, 'posts_per_page' => $max ); $pages = new WP_Query( $args ); $front = get_option('page_on_front'); $out = '

' . __( 'Custom 404 Page', 'themify' ) .themify_help(__('First create a new Page (eg. 404) and then select it here. The selected page will be used for error 404 (when a URL is not found on your site).', 'themify')). ' '; if($pages->max_num_pages>1){ $post_name = ''; if($page_404){ $post_name = get_post($page_404); if(!empty($post_name)){ $post_name = esc_attr($post_name->post_title); } } $out .= ''; $out .= ''; $out .= ''; } else{ $out.=''; } wp_reset_postdata(); return $out; } } /////////////////////////////////////////// // RSS Feed Settings Module /////////////////////////////////////////// function themify_feed_settings( $data = array() ) { $checked_use = ''; $feed_settings = themify_get( 'setting-feed_settings','',true ); $feed_custom_post = themify_get( 'setting-feed_custom_post','',true ); $custom_posts = array_diff( get_post_types( array('public' => true, 'publicly_queryable' => 'true' ) ) , array('attachment', 'tbuilder_layout', 'tbuilder_layout_part', 'section','tglobal_style') ); $custom_posts_options = ''; if ( 'on' === themify_get( 'setting-exclude_img_rss','',true ) ) { $checked_use = 'checked="checked"'; } if( ! empty( $custom_posts ) ) { array_unshift( $custom_posts, 'all' ); $feed_custom_post_arr = explode( ',', trim( $feed_custom_post ) ); foreach( $custom_posts as $c_post ) { $custom_posts_options .= sprintf( '' , in_array( $c_post, $feed_custom_post_arr ) ? 'selected="selected"' : '' , $c_post , ucfirst( preg_replace( "/[-_]/", ' ', $c_post ) ) ); } } return '

' . __('Feed Category', 'themify') .themify_help(__('Use minus sign (-) to exclude categories.
Example: (2,-9) = include only Category 2 in feeds and exclude Category 9.', 'themify')) . '

' . __('Post Image in RSS', 'themify') .themify_help(__('Check this to exclude post image in RSS feeds', 'themify')) . '

' . __('Custom Posts in RSS', 'themify') .themify_help(__( 'Select "All" to add all available posts in your feed or select the specific ones.', 'themify')) . '

'; } /** * Outputs Image Script module in theme settings. */ function themify_img_settings( $data = array() ) { $feature_sizes = themify_get_image_sizes_list(); $checked_use = ''; $disable = ''; $imaging_library = wp_image_editor_supports(); $imaging_library_error = ''; if ( ! $imaging_library || themify_is_image_script_disabled() ) { $checked_use = "checked='checked'"; if ( ! $imaging_library ) { $disable = ' style="pointer-events: none;"'; $imaging_library_error = '
' . sprintf( __( 'This feature requires an image processing library to be installed on the server. Please contact your hosting provider to enable this.', 'themify' ), 'https://www.php.net/manual/en/refs.utilspec.image.php' ) . '
'; } } $size = themify_get( 'setting-img_php_base_size', 'large',true ); $global = themify_get( 'setting-global_feature_size','',true ); $output = '
' . __( 'Disable', 'themify' ) .themify_help(__( 'Default WordPress image sizes or original images will be used.', 'themify' )) . '
' . $imaging_library_error . '
' . __('Base Image Size', 'themify') .themify_help(__( 'Select the image size that image script will resize thumbnails from. If you\'re not sure, leave it as "Large". Note that this does not affect images already generated.', 'themify' )) . '
' . __('Default Featured Image Size', 'themify') . '
'; return $output; } /** * Outputs module for user to select whether to use a lightbox or not. The lightbox choices can be filtered using the 'themify_lightbox_module_options' filter in a custom-functions.php file. * @param array $data * @return string * @since 1.2.5 */ function themify_gallery_plugins( $data = array() ) { $display_options = apply_filters('themify_lightbox_module_options', array( __( 'Enable', 'themify' ) => 'lightbox', __( 'Disable', 'themify' ) => 'none' )); $gallery_lightbox = themify_get( 'setting-gallery_lightbox',null,true ); $out = '

' . __( 'WordPress Gallery', 'themify' ) . '

'; $out .= '

'; $out .= '

'. __( 'All links to jpg, png, and gif will open in lightbox.', 'themify' ) .'

'; return $out; } /** * Template to display a link in Links module, also used when creating a link. * @param array $data * @return string * @since 1.2.7 */ function themify_add_link_template( $fid, $data = array(), $ajax = false, $type = 'image-icon' ) { $pre = 'setting-link_'; $type_name = $pre.'type_'.$fid; if ( $ajax ) { $type_val = $type; } else { $type_val = isset($data[$type_name])? $data[$type_name] : 'image-icon'; } $title_name = $pre.'title_'.$fid; $title_val = isset($data[$title_name])? esc_attr(trim($data[$title_name])): ''; $link_name = $pre.'link_'.$fid; $link_val = isset($data[$link_name])? esc_attr(trim($data[$link_name])) : ''; $img_name = $pre.'img_'.$fid; $img_val = ! isset( $data[$img_name] ) || '' == $data[$img_name]? '' : esc_attr($data[$img_name]); $ficon_name = $pre.'ficon_'.$fid; $ficon_val = trim( isset($data[$ficon_name])? esc_attr($data[$ficon_name]) : '' ); $ficolor_name = $pre.'ficolor_'.$fid; $ficolor_val = isset($data[$ficolor_name])? esc_attr($data[$ficolor_name]) : ''; $fibgcolor_name = $pre.'fibgcolor_'.$fid; $fibgcolor_val = isset($data[$fibgcolor_name])? esc_attr($data[$fibgcolor_name]) : ''; /** * TODO: Add appearance checkboxes */ $out = ' '; return $out; } /** * Outputs module to manage links to be shown using the corresponding widget * @param array $data * @return string * @since 1.2.7 */ function themify_manage_links( $data = array() ) { $data = themify_get_data(); $pre = 'setting-link_'; $field_hash = !empty( $data[$pre.'field_hash'] )? (int)$data[$pre.'field_hash'] : 8; $start = array(); for ( $i=0; $i < $field_hash; ++$i ) { $start['themify-link-'.$i] = 'themify-link-'.$i; } //$data[$pre.'field_ids'] = json_encode($start); $field_ids=themify_get( $pre.'field_ids',false,true ); if ( $field_ids) { $field_ids=json_decode( $field_ids, true ); if ( ! is_array( $field_ids ) ) { $field_ids = array(); } } else { $field_ids = $start; // Image Icons $data[$pre.'type_themify-link-0'] = 'image-icon'; $data[$pre.'type_themify-link-1'] = 'image-icon'; $data[$pre.'type_themify-link-2'] = 'image-icon'; $data[$pre.'type_themify-link-3'] = 'image-icon'; $data[$pre.'title_themify-link-0'] = 'Twitter'; $data[$pre.'title_themify-link-1'] = 'Facebook'; $data[$pre.'title_themify-link-2'] = 'YouTube'; $data[$pre.'title_themify-link-3'] = 'Pinterest'; $data[$pre.'link_themify-link-0'] = ''; $data[$pre.'link_themify-link-1'] = ''; $data[$pre.'link_themify-link-2'] = ''; $data[$pre.'link_themify-link-3'] = ''; $data[$pre.'img_themify-link-0'] = THEMIFY_URI . '/img/social/twitter.png'; $data[$pre.'img_themify-link-1'] = THEMIFY_URI . '/img/social/facebook.png'; $data[$pre.'img_themify-link-2'] = THEMIFY_URI . '/img/social/youtube.png'; $data[$pre.'img_themify-link-3'] = THEMIFY_URI . '/img/social/pinterest.png'; // Font Icons $data[$pre.'type_themify-link-4'] = 'font-icon'; $data[$pre.'type_themify-link-5'] = 'font-icon'; $data[$pre.'type_themify-link-6'] = 'font-icon'; $data[$pre.'type_themify-link-7'] = 'font-icon'; $data[$pre.'title_themify-link-4'] = 'Twitter'; $data[$pre.'title_themify-link-5'] = 'Facebook'; $data[$pre.'title_themify-link-6'] = 'YouTube'; $data[$pre.'title_themify-link-7'] = 'Pinterest'; $data[$pre.'link_themify-link-4'] = ''; $data[$pre.'link_themify-link-5'] = ''; $data[$pre.'link_themify-link-6'] = ''; $data[$pre.'link_themify-link-7'] = ''; $data[$pre.'ficon_themify-link-4'] = 'fa-twitter'; $data[$pre.'ficon_themify-link-5'] = 'fa-facebook'; $data[$pre.'ficon_themify-link-6'] = 'fa-youtube'; $data[$pre.'ficon_themify-link-7'] = 'fa-pinterest'; $data[$pre.'ficolor_themify-link-4'] = ''; $data[$pre.'ficolor_themify-link-5'] = ''; $data[$pre.'ficolor_themify-link-6'] = ''; $data[$pre.'ficolor_themify-link-7'] = ''; $data[$pre.'fibgcolor_themify-link-4'] = ''; $data[$pre.'fibgcolor_themify-link-5'] = ''; $data[$pre.'fibgcolor_themify-link-6'] = ''; $data[$pre.'fibgcolor_themify-link-7'] = ''; $data = apply_filters('themify_default_social_links', $data); } $out = ''; $out .= '