Advertisement
Guest User

functions

a guest
Aug 13th, 2016
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.20 KB | None | 0 0
  1. <?php
  2. /**
  3. * Permatex
  4. * (c) Web factory Ltd, 2013
  5. */
  6.  
  7. define('WF_THEME_NAME', 'Permatex');
  8. define('WF_THEME_VERSION', '1.10');
  9. define('WF_THEME_TEXTDOMAIN', 'wf_permatex');
  10.  
  11. require_once get_template_directory() . '/admin/common-functions.php';
  12.  
  13. if(is_demo() && file_exists(get_template_directory() . '/admin/demo-setup.php') && !current_user_can('administrator')) {
  14. require_once get_template_directory() . '/admin/demo-setup.php';
  15. } else {
  16. define('WF_THEME_OPTIONS', 'per_theme_options');
  17. }
  18.  
  19. require_once get_template_directory() . '/admin/theme-customize.php';
  20. require_once get_template_directory() . '/admin/shortcodes.php';
  21. require_once get_template_directory() . '/admin/widgets.php';
  22. require_once get_template_directory() . '/admin/simple-page-ordering.php';
  23.  
  24. if (!version_compare(get_bloginfo('version'), 3.5, '>=')) {
  25. if (is_admin()) {
  26. add_action('admin_notices', 'wf_theme_min_version_notice');
  27. } else {
  28. echo '<p>' . __('<b>' . WF_THEME_NAME . '</b> theme requires <b>WordPress v3.5</b> or higher to function properly. Please upgrade.', WF_THEME_TEXTDOMAIN) . '</p>';
  29. die();
  30. }
  31. }
  32.  
  33. function wf_theme_customize_enqueue() {
  34. wp_enqueue_style('wf-theme-admin', get_template_directory_uri() . '/admin/css/common.css', array(), WF_THEME_VERSION);
  35. wp_enqueue_style('wf-font-icons', get_template_directory_uri() . '/css/font-awesome.min.css', array(), WF_THEME_VERSION);
  36. wp_enqueue_style('wf-font-icons2', get_template_directory_uri() . '/css/font-awesome-ie7.min.css', array(), WF_THEME_VERSION);
  37. wp_enqueue_script('wf-theme-admin', get_template_directory_uri() . '/admin/js/common.js', array('jquery'), WF_THEME_VERSION);
  38. } // wf_theme_customize_enqueue
  39. add_action('customize_controls_enqueue_scripts', 'wf_theme_customize_enqueue');
  40.  
  41. function wf_theme_customizer_js() {
  42. wp_enqueue_script('wf-theme-admin', get_template_directory_uri() . '/admin/js/theme-customizer.js', array('jquery'), WF_THEME_VERSION);
  43. } // wf_theme_cutomizer_js
  44. add_action('customize_preview_init', 'wf_theme_customizer_js');
  45.  
  46. function wf_setup_theme(){
  47. add_theme_support('post-thumbnails');
  48. add_theme_support('automatic-feed-links');
  49.  
  50. add_image_size('per-slider', 360, 480, true);
  51. add_image_size('per-gallery-thumb', 250, 190, true);
  52. add_image_size('per-gallery-thumb-large', 500, 390, true);
  53. add_image_size('per-screenshots', 250, 182, true);
  54. add_image_size('per-loop', 240, 170, true);
  55.  
  56. add_filter('widget_text', 'do_shortcode');
  57. add_filter('widget_title', 'do_shortcode');
  58.  
  59. register_nav_menu('primary', __('Primary Menu', WF_THEME_TEXTDOMAIN));
  60. register_nav_menu('front_page', __('Front Page Menu', WF_THEME_TEXTDOMAIN));
  61.  
  62. global $primary_menu_options;
  63. $primary_menu_options = array('theme_location' => 'primary',
  64. 'menu' => __('Primary', WF_THEME_TEXTDOMAIN),
  65. 'depth' => 2,
  66. 'container' => false,
  67. 'container_class' => false,
  68. 'container_id' => false,
  69. 'menu_class' => false,
  70. 'menu_id' => null,
  71. 'echo' => false,
  72. 'fallback_cb' => null,
  73. 'before' => null,
  74. 'after' => null,
  75. 'link_before' => null,
  76. 'link_after' => null,
  77. 'items_wrap' => '<ul id="main-navigation" class="hidden-phone">%3$s</ul>');
  78. global $front_page_menu_options;
  79. $front_page_menu_options = array('theme_location' => 'front_page',
  80. 'menu' => __('Front Page', WF_THEME_TEXTDOMAIN),
  81. 'depth' => 2,
  82. 'container' => false,
  83. 'container_class' => false,
  84. 'container_id' => false,
  85. 'menu_class' => false,
  86. 'menu_id' => null,
  87. 'echo' => false,
  88. 'fallback_cb' => null,
  89. 'before' => null,
  90. 'after' => null,
  91. 'link_before' => null,
  92. 'link_after' => null,
  93. 'items_wrap' => '<ul id="main-navigation" class="hidden-phone">%3$s</ul>');
  94.  
  95. load_theme_textdomain(WF_THEME_TEXTDOMAIN, get_template_directory() . '/languages');
  96. } // wf_setup_theme
  97. add_action('after_setup_theme', 'wf_setup_theme');
  98.  
  99. function wf_theme_widgets_init() {
  100. register_sidebar(array(
  101. 'name' => __('Widgets Section on Front Page', WF_THEME_TEXTDOMAIN),
  102. 'id' => 'wf-front-page',
  103. 'description' => __('"Text with icon" widget looks best in this sidebar. Use the [fp-widgets] shortcode to place the sidebar anywhere you need it in sections on front page.', WF_THEME_TEXTDOMAIN),
  104. 'before_widget' => '<div id="%1$s" class="span4 box %2$s">',
  105. 'after_widget' => "</div>",
  106. 'before_title' => '<h3>',
  107. 'after_title' => '</h3>',
  108. ));
  109. register_sidebar(array(
  110. 'name' => __('Main Sidebar', WF_THEME_TEXTDOMAIN),
  111. 'id' => 'wf-main',
  112. 'description' => __('Sidebar area for all content except single pages.', WF_THEME_TEXTDOMAIN),
  113. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  114. 'after_widget' => "</div>",
  115. 'before_title' => '<h4 class="widget-title">',
  116. 'after_title' => '</h4>',
  117. ));
  118. register_sidebar(array(
  119. 'name' => __('Pages Sidebar', WF_THEME_TEXTDOMAIN),
  120. 'id' => 'wf-pages',
  121. 'description' => __('Sidebar area for single pages.', WF_THEME_TEXTDOMAIN),
  122. 'before_widget' => '<div id="%1$s" class="widget %2$s">',
  123. 'after_widget' => "</div>",
  124. 'before_title' => '<h4 class="widget-title">',
  125. 'after_title' => '</h4>',
  126. ));
  127. } // wf_theme_widgets_init
  128. add_action('widgets_init', 'wf_theme_widgets_init');
  129.  
  130. function wf_theme_wp_print_scripts() {
  131. if (is_admin()) {
  132. return;
  133. }
  134.  
  135. $out = '';
  136.  
  137. if (wf_theme_get_option('color_main')) {
  138. $out .= '.twitter-image,#navigation ul li a:hover,a:hover.newsletter-btn,.section-black h3.section-title,a:hover.buy-btn,.section-grey .subtitle,.box:hover .box-icon,.box:hover h3,.callus,.logo-fontcon,#calltoaction-form .btn:hover { color: ' . wf_theme_get_option('color_main') . ';} ';
  139. $out .= '.section-colored,#teaser,#teaser-page,#calltoaction-form .btn,.faq .colored,a.buy-btn,a.newsletter-btn, .tagcloud a { background: ' . wf_theme_get_option('color_main') . '; } ';
  140. $out .= '.tagcloud a:before { border-color: transparent ' . wf_theme_get_option('color_main') . ' transparent transparent; } ';
  141. }
  142.  
  143. if (wf_theme_get_option('color_background')) {
  144. $out .= 'body { background-color: ' . wf_theme_get_option('color_background') . '; } ';
  145. }
  146.  
  147. if (wf_theme_get_option('color_header_background')) {
  148. $out .= 'header, .sub-menu { background-color: ' . wf_theme_get_option('color_header_background') . '; } ';
  149. }
  150.  
  151. if (wf_theme_get_option('color_section_dark_background')) {
  152. $out .= '.section-black { background-color: ' . wf_theme_get_option('color_section_dark_background') . '; } ';
  153. }
  154.  
  155. if (wf_theme_get_option('color_section_light_background')) {
  156. $out .= '.section-grey { background-color: ' . wf_theme_get_option('color_section_light_background') . '; } ';
  157. }
  158.  
  159. if (wf_theme_get_option('color_text')) {
  160. $out .= 'body { color: ' . wf_theme_get_option('color_text') . '; } ';
  161. }
  162.  
  163. if (wf_theme_get_option('color_link')) {
  164. $out .= 'a { color: ' . wf_theme_get_option('color_link') . '!important; } ';
  165. }
  166. if (wf_theme_get_option('color_link_menu')) {
  167. $out .= '#main-navigation a { color: ' . wf_theme_get_option('color_link_menu') . '!important; }';
  168. }
  169. if (wf_theme_get_option('color_h1')) {
  170. $out .= 'h1 { color: ' . wf_theme_get_option('color_h1') . '!important; }';
  171. }
  172. if (wf_theme_get_option('color_h2')) {
  173. $out .= 'h2 { color: ' . wf_theme_get_option('color_h2') . '!important; }';
  174. }
  175. if (wf_theme_get_option('color_h3')) {
  176. $out .= 'h3 { color: ' . wf_theme_get_option('color_h3') . '!important; }';
  177. }
  178. if (wf_theme_get_option('color_h4')) {
  179. $out .= 'h4 { color: ' . wf_theme_get_option('color_h4') . '!important; }';
  180. }
  181.  
  182. if (wf_theme_get_option('custom_css')) {
  183. $out .= wf_theme_get_option('custom_css') . ' ';
  184. }
  185.  
  186. if ($out) {
  187. $out = '<style media="all" id="wf-custom-css" type="text/css">' . $out . '</style>';
  188. echo "\n" . $out . "\n";
  189. }
  190. } // wf_theme_wp_print_scripts
  191. add_action('wp_print_scripts', 'wf_theme_wp_print_scripts');
  192.  
  193. function wf_theme_box_post() {
  194. global $post;
  195. $link = get_post_meta($post->ID, '_slide_link', true);
  196.  
  197. wp_nonce_field('wf_theme_save', 'wf_theme_nonce');
  198. echo '<p>' . __('Following settings <b>apply only</b> to posts that are used in the header slider.', WF_THEME_TEXTDOMAIN) . '</p>';
  199. echo '<p><label for="wf_theme_link">' . __('Link:', WF_THEME_TEXTDOMAIN) . '</label> <input type="text" value="' . $link . '" class="regular-text" name="wf_slide_link" id="wf_slide_link" /></p>';
  200. } // wf_theme_box_post
  201.  
  202. function wf_theme_box_section() {
  203. global $post;
  204. $subtitle = get_post_meta($post->ID, '_section_subtitle', true);
  205. $style = get_post_meta($post->ID, '_section_style', true);
  206.  
  207. $styles = array();
  208. $styles[] = array('val' => 'section-black', 'label' => 'Dark');
  209. $styles[] = array('val' => 'section-grey', 'label' => 'Light');
  210. $styles[] = array('val' => 'section-colored', 'label' => 'Main site color');
  211.  
  212. wp_nonce_field('wf_theme_save', 'wf_theme_nonce');
  213. echo '<p>' . __('Following settings <b>apply only</b> to pages with the "Front Page Section" template that are displayed on the front page. Please choose that template from the dropdown menu on the right if you want the page to appear on the front page.', WF_THEME_TEXTDOMAIN) . '</p>';
  214.  
  215. echo '<p><label for="wf_section_subtitle">' . __('Subtitle:', WF_THEME_TEXTDOMAIN) . '</label> <input type="text" value="' . $subtitle . '" class="regular-text" name="wf_section_subtitle" id="wf_section_subtitle" /></p>';
  216. echo '<p><label for="wf_section_style">' . __('Background color:', WF_THEME_TEXTDOMAIN) . '</label> <select name="wf_section_style" id="wf_section_style">' . wf_theme_create_select_options($styles, $style, 0) . '</select></p>';
  217. } // wf_theme_box_section
  218.  
  219. function wf_theme_add_meta_box() {
  220. add_meta_box('wf-theme-fp', __('Front Page Section Options', WF_THEME_TEXTDOMAIN), 'wf_theme_box_section', 'page', 'normal', 'high');
  221.  
  222. add_meta_box('wf-theme-post', __('Slide Options', WF_THEME_TEXTDOMAIN), 'wf_theme_box_post', 'post', 'normal', 'high');
  223.  
  224. add_meta_box('wf-theme-seo', __('SEO Options', WF_THEME_TEXTDOMAIN), 'wf_theme_box_seo', 'page', 'normal', 'high');
  225. add_meta_box('wf-theme-seo', __('SEO Options', WF_THEME_TEXTDOMAIN), 'wf_theme_box_seo', 'post', 'normal', 'high');
  226. } // wf_theme_add_meta_box
  227. add_action('add_meta_boxes', 'wf_theme_add_meta_box');
  228.  
  229. function wf_theme_save_postdata($post_id) {
  230. if (!wp_verify_nonce(@$_POST['wf_theme_nonce'], 'wf_theme_save') || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
  231. return $post_id;
  232. }
  233.  
  234. if (isset($_POST['wf_theme_tagline'])) {
  235. update_post_meta($post_id, '_tagline', $_POST['wf_theme_tagline']);
  236. }
  237. if (isset($_POST['wf_slide_link'])) {
  238. update_post_meta($post_id, '_slide_link', $_POST['wf_slide_link']);
  239. }
  240. if (isset($_POST['wf_section_subtitle'])) {
  241. update_post_meta($post_id, '_section_subtitle', $_POST['wf_section_subtitle']);
  242. update_post_meta($post_id, '_section_style', $_POST['wf_section_style']);
  243. }
  244. if (isset($_POST['wf_theme_title'])) {
  245. update_post_meta($post_id, '_wf_theme_title', $_POST['wf_theme_title']);
  246. update_post_meta($post_id, '_wf_theme_description', $_POST['wf_theme_description']);
  247. update_post_meta($post_id, '_wf_theme_keywords', $_POST['wf_theme_keywords']);
  248. }
  249.  
  250. return $post_id;
  251. } // wf_theme_save_postdata
  252. add_action('save_post', 'wf_theme_save_postdata');
  253.  
  254. function wf_theme_init() {
  255. global $wp_styles;
  256.  
  257. if (!is_admin() && !wf_theme_is_login_page()) {
  258. wp_enqueue_style('wf-reset', get_template_directory_uri() . '/css/reset.css', array(), WF_THEME_VERSION);
  259. wp_enqueue_style('wf-bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), WF_THEME_VERSION);
  260. wp_enqueue_style('wf-bootstrap-responsive', get_template_directory_uri() . '/css/bootstrap-responsive.min.css', array(), WF_THEME_VERSION);
  261. wp_enqueue_style('wf-style', get_template_directory_uri() . '/css/style.css', array(), WF_THEME_VERSION);
  262. wp_enqueue_style('wf-style-responsive', get_template_directory_uri() . '/css/style-responsive.css', array(), WF_THEME_VERSION);
  263. wp_enqueue_style('wf-prettyphoto', get_template_directory_uri() . '/css/prettyPhoto.css', array(), WF_THEME_VERSION);
  264. wp_enqueue_style('wf-fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), WF_THEME_VERSION);
  265. wp_enqueue_style('wf-font', get_template_directory_uri() . '/css/fonts/' . wf_theme_get_option('font') . '.css', array(), WF_THEME_VERSION);
  266. wp_enqueue_style('wf-ie7', get_template_directory_uri() . '/css/font-awesome-ie7.min.css', array(), WF_THEME_VERSION);
  267. $wp_styles->add_data('wf-ie7', 'conditional', 'IE 7');
  268. wp_enqueue_style('wf-ie8', get_template_directory_uri() . '/css/ie8.css', array(), WF_THEME_VERSION);
  269. $wp_styles->add_data('wf-ie8', 'conditional', 'IE 8' );
  270. wp_enqueue_style('wf_flexslider', get_template_directory_uri() . '/css/flexslider.css', array(), WF_THEME_VERSION);
  271.  
  272. wp_enqueue_script('jquery');
  273. wp_enqueue_script('wf_bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), WF_THEME_VERSION, true);
  274. wp_enqueue_script('wf_twitter', get_template_directory_uri() . '/js/jquery.tweet.js', array('jquery'), WF_THEME_VERSION, true);
  275. wp_enqueue_script('wf_prettyphoto', get_template_directory_uri() . '/js/jquery.prettyPhoto.js', array('jquery'), WF_THEME_VERSION, true);
  276. wp_enqueue_script('wf_quvolver', get_template_directory_uri() . '/js/jquery.quovolver.js', array('jquery'), WF_THEME_VERSION, true);
  277. wp_enqueue_script('wf_form', get_template_directory_uri() . '/js/jquery.form.js', array('jquery'), WF_THEME_VERSION, true);
  278. wp_enqueue_script('wf_html5_placeholder', get_template_directory_uri() . '/js/jquery.html5-placeholder-shim.js', array('jquery'), WF_THEME_VERSION, true);
  279. wp_enqueue_script('wf_form_validate', get_template_directory_uri() . '/js/jquery.validate.js', array('jquery'), WF_THEME_VERSION, true);
  280. wp_enqueue_script('wf_flexslider', get_template_directory_uri() . '/js/jquery.flexslider.js', array('jquery'), WF_THEME_VERSION, true);
  281. wp_enqueue_script('wf_theme_common', get_template_directory_uri() . '/js/common.js', array('jquery'), WF_THEME_VERSION, true);
  282. }
  283. if (is_admin()) {
  284. wp_enqueue_style('wf-theme-admin', get_template_directory_uri() . '/admin/css/common.css', array(), WF_THEME_VERSION);
  285. wp_enqueue_script('wf-theme-admin', get_template_directory_uri() . '/admin/js/common.js', array('jquery'), WF_THEME_VERSION);
  286.  
  287. if (strpos($_SERVER['REQUEST_URI'], 'widgets.php') !== false) {
  288. wp_enqueue_style('wf-fontawesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), WF_THEME_VERSION);
  289. wp_enqueue_style('wf-ie7', get_template_directory_uri() . '/css/font-awesome-ie7.min.css', array(), WF_THEME_VERSION);
  290. $wp_styles->add_data('wf-ie7', 'conditional', 'if IE 7');
  291. }
  292. } // if is admin
  293.  
  294. if (!session_id()) {
  295. @session_start();
  296. }
  297. } // wf_theme_init
  298. add_action('init', 'wf_theme_init');
  299.  
  300. function wf_theme_wp() {
  301. $wf_theme_js_vars = array('ajaxurl' => admin_url('admin-ajax.php'),
  302. 'theme_folder' => get_template_directory_uri(),
  303. 'theme_options' => WF_THEME_OPTIONS,
  304. 'is_home' => (int) is_home(),
  305. 'is_front_page' => (int) is_front_page(),
  306. 'newsletter_msg_ok' => wf_theme_get_option('newsletter_msg_ok'),
  307. 'slider_pause' => wf_theme_get_option('slider_pause'),
  308. 'slider_pause_hover' => wf_theme_get_option('slider_pause_hover'),
  309. 'slider_controls' => wf_theme_get_option('slider_controls'),
  310. 'slider_animation' => wf_theme_get_option('slider_animation'),
  311. 'contact_form_msg_ok' => wf_theme_get_option('contact_form_msg_ok'));
  312.  
  313. wp_localize_script('jquery', 'wf_theme', $wf_theme_js_vars);
  314. } // wf_theme_wp
  315. add_action('wp', 'wf_theme_wp');
  316.  
  317. function wf_theme_ajax_newsletter() {
  318. require_once get_template_directory() . '/admin/newsletter-mailchimp.php';
  319. } // wf_theme_ajax_newsletter
  320. add_action('wp_ajax_wf_theme_newsletter', 'wf_theme_ajax_newsletter');
  321. add_action('wp_ajax_nopriv_wf_theme_newsletter', 'wf_theme_ajax_newsletter');
  322.  
  323. function wf_theme_ajax_twitter_api() {
  324. require_once get_template_directory() . '/admin/twitter-api.php';
  325. } // wf_theme_twitter_api
  326. add_action('wp_ajax_wf_theme_twitter_api', 'wf_theme_ajax_twitter_api');
  327. add_action('wp_ajax_nopriv_wf_theme_twitter_api', 'wf_theme_ajax_twitter_api');
  328.  
  329. function wf_theme_ajax_captcha() {
  330. if (isset($_REQUEST['check'])) {
  331. if (sanitize_text_field($_REQUEST['captcha']) == $_SESSION['captcha']) {
  332. die('true');
  333. } else {
  334. die('false');
  335. }
  336. } else {
  337. $a = rand(1, 10);
  338. $b = rand(1, 10);
  339.  
  340. if ($a > $b) {
  341. $out = "$a - $b =";
  342. $_SESSION['captcha'] = $a - $b;
  343. } else {
  344. $out = "$a + $b =";
  345. $_SESSION['captcha'] = $a + $b;
  346. }
  347. die("$out");
  348. }
  349. }
  350. add_action('wp_ajax_wf_theme_captcha', 'wf_theme_ajax_captcha');
  351. add_action('wp_ajax_nopriv_wf_theme_captcha', 'wf_theme_ajax_captcha');
  352.  
  353. function wf_theme_ajax_contact_send() {
  354. $details = $extra_details = '';
  355. $ok = 0;
  356.  
  357. $name = sanitize_text_field($_POST['name']);
  358. $email = sanitize_email($_POST['email']);
  359. $type = sanitize_text_field($_POST['type']);
  360. $message = esc_html($_POST['message']);
  361. if (wf_theme_get_option('contact_form_extra_field')) {
  362. $extra = sanitize_text_field($_POST['extra']);
  363. }
  364.  
  365. $details .= 'Name: ' . $name . "\r\n";
  366. $details .= 'Email: ' . $email . "\r\n";
  367. if ($type) {
  368. $details .= 'Type: ' . $type . "\r\n";
  369. }
  370. $details .= 'Message: ' . $message . "\r\n";
  371. if (wf_theme_get_option('contact_form_extra_field')) {
  372. $details .= 'Extra field: ' . $extra . "\r\n";
  373. }
  374.  
  375. $extra_details .= "\r\n" . 'IP address: ' . $_SERVER['REMOTE_ADDR'] . "\r\n";
  376. $extra_details .= 'User agent: ' . $_SERVER['HTTP_USER_AGENT'] . "\r\n";
  377.  
  378. $admin = "Someone has contacted you trough the site's contact form with the following details:\r\n{$details}{$extra_details}\r\nYou can reply to this email to respond.";
  379.  
  380. $body = wf_theme_get_option('contact_form_email_body');
  381. $body .= "\r\n" . $details . $extra_details;
  382.  
  383. $headers = 'Reply-to: ' . $name . ' <' . $email . '>' . "\r\n";
  384. $headers .= 'From: ' . get_bloginfo('name') . ' <' . get_bloginfo('admin_email') . '>' . "\r\n";
  385. $ok += wp_mail(wf_theme_get_option('contact_form_email_address'), wf_theme_get_option('contact_form_email_subject'), $body, $headers);
  386.  
  387. if ($ok && wf_theme_get_option('contact_form_autoreply') && is_email($email)) {
  388. $headers = 'From: ' . get_bloginfo('name') . ' <' . wf_theme_get_option('contact_form_email_address') . '>' . "\r\n";
  389. $headers .= 'Reply-to: ' . wf_theme_get_option('contact_form_email_address') . "\r\n";
  390. wp_mail($email, wf_theme_get_option('contact_form_autoreply_subject'), wf_theme_get_option('contact_form_autoreply_body'), $headers);
  391. }
  392.  
  393. die("$ok");
  394. }
  395. add_action('wp_ajax_wf_theme_contact_send', 'wf_theme_ajax_contact_send');
  396. add_action('wp_ajax_nopriv_wf_theme_contact_send', 'wf_theme_ajax_contact_send');
  397.  
  398. function wf_theme_dequeue_scripts() {
  399. global $twitter_js, $contact_js, $quote_js, $prettyphoto_js, $filterable_js, $flexslider_js;
  400.  
  401. if (!$twitter_js) {
  402. wp_dequeue_script('wf_twitter');
  403. }
  404. if (!$contact_js) {
  405. wp_dequeue_script('wf_form');
  406. wp_dequeue_script('wf_form_validate');
  407. }
  408. if (!$quote_js) {
  409. wp_dequeue_script('wf_quvolver');
  410. }
  411. if (!$prettyphoto_js) {
  412. wp_dequeue_script('wf_prettyphoto');
  413. }
  414. if (!$flexslider_js) {
  415. wp_dequeue_script('wf_flexslider');
  416. wp_dequeue_style('wf_flexslider');
  417. }
  418. }
  419. add_action('wp_footer', 'wf_theme_dequeue_scripts');
  420.  
  421. function wf_theme_get_icons_list() {
  422. $icons_raw = 'icon-adjust,icon-adn,icon-align-center,icon-align-justify,icon-align-left,icon-align-right,icon-ambulance,icon-anchor,icon-android,icon-angle-down,icon-angle-left,icon-angle-right,icon-angle-up,icon-apple,icon-archive,icon-arrow-down,icon-arrow-left,icon-arrow-right,icon-arrow-up,icon-asterisk,icon-backward,icon-ban-circle,icon-bar-chart,icon-barcode,icon-beaker,icon-beer,icon-bell,icon-bell-alt,icon-bitbucket,icon-bitbucket-sign,icon-bold,icon-bolt,icon-book,icon-bookmark,icon-bookmark-empty,icon-briefcase,icon-btc,icon-bug,icon-building,icon-bullhorn,icon-bullseye,icon-calendar,icon-calendar-empty,icon-camera,icon-camera-retro,icon-caret-down,icon-caret-left,icon-caret-right,icon-caret-up,icon-certificate,icon-check,icon-check-empty,icon-check-minus,icon-check-sign,icon-chevron-down,icon-chevron-left,icon-chevron-right,icon-chevron-sign-down,icon-chevron-sign-left,icon-chevron-sign-right,icon-chevron-sign-up,icon-chevron-up,icon-circle,icon-circle-arrow-down,icon-circle-arrow-left,icon-circle-arrow-right,icon-circle-arrow-up,icon-circle-blank,icon-cloud,icon-cloud-download,icon-cloud-upload,icon-cny,icon-code,icon-code-fork,icon-coffee,icon-cog,icon-cogs,icon-collapse,icon-collapse-alt,icon-collapse-top,icon-columns,icon-comment,icon-comment-alt,icon-comments,icon-comments-alt,icon-compass,icon-copy,icon-credit-card,icon-crop,icon-css3,icon-cut,icon-dashboard,icon-desktop,icon-double-angle-down,icon-double-angle-left,icon-double-angle-right,icon-double-angle-up,icon-download,icon-download-alt,icon-dribbble,icon-dropbox,icon-edit,icon-edit-sign,icon-eject,icon-ellipsis-horizontal,icon-ellipsis-vertical,icon-envelope,icon-envelope-alt,icon-eraser,icon-eur,icon-exchange,icon-exclamation,icon-exclamation-sign,icon-expand,icon-expand-alt,icon-external-link,icon-external-link-sign,icon-eye-close,icon-eye-open,icon-facebook,icon-facebook-sign,icon-facetime-video,icon-fast-backward,icon-fast-forward,icon-female,icon-fighter-jet,icon-file,icon-file-alt,icon-file-text,icon-file-text-alt,icon-film,icon-filter,icon-fire,icon-fire-extinguisher,icon-flag,icon-flag-alt,icon-flag-checkered,icon-flickr,icon-folder-close,icon-folder-close-alt,icon-folder-open,icon-folder-open-alt,icon-font,icon-food,icon-forward,icon-foursquare,icon-frown,icon-fullscreen,icon-gamepad,icon-gbp,icon-gift,icon-github,icon-github-alt,icon-github-sign,icon-gittip,icon-glass,icon-globe,icon-google-plus,icon-google-plus-sign,icon-group,icon-hand-down,icon-hand-left,icon-hand-right,icon-hand-up,icon-hdd,icon-headphones,icon-heart,icon-heart-empty,icon-home,icon-hospital,icon-h-sign,icon-html5,icon-inbox,icon-indent-left,icon-indent-right,icon-info,icon-info-sign,icon-inr,icon-instagram,icon-italic,icon-jpy,icon-key,icon-keyboard,icon-krw,icon-laptop,icon-leaf,icon-legal,icon-lemon,icon-level-down,icon-level-up,icon-lightbulb,icon-link,icon-linkedin,icon-linkedin-sign,icon-linux,icon-list,icon-list-alt,icon-list-ol,icon-list-ul,icon-location-arrow,icon-lock,icon-long-arrow-down,icon-long-arrow-left,icon-long-arrow-right,icon-long-arrow-up,icon-magic,icon-magnet,icon-mail-reply-all,icon-male,icon-map-marker,icon-maxcdn,icon-medkit,icon-meh,icon-microphone,icon-microphone-off,icon-minus,icon-minus-sign,icon-minus-sign-alt,icon-mobile-phone,icon-money,icon-moon,icon-move,icon-music,icon-off,icon-ok,icon-ok-circle,icon-ok-sign,icon-paper-clip,icon-paste,icon-pause,icon-pencil,icon-phone,icon-phone-sign,icon-picture,icon-pinterest,icon-pinterest-sign,icon-plane,icon-play,icon-play-circle,icon-play-sign,icon-plus,icon-plus-sign,icon-plus-sign-alt,icon-print,icon-pushpin,icon-puzzle-piece,icon-qrcode,icon-question,icon-question-sign,icon-quote-left,icon-quote-right,icon-random,icon-refresh,icon-remove,icon-remove-circle,icon-remove-sign,icon-reorder,icon-repeat,icon-reply,icon-reply-all,icon-resize-full,icon-resize-horizontal,icon-resize-small,icon-resize-vertical,icon-retweet,icon-road,icon-rocket,icon-rss,icon-rss-sign,icon-save,icon-screenshot,icon-search,icon-share,icon-share-alt,icon-share-sign,icon-shield,icon-shopping-cart,icon-signal,icon-sign-blank,icon-signin,icon-signout,icon-sitemap,icon-skype,icon-smile,icon-sort,icon-sort-by-alphabet,icon-sort-by-alphabet-alt,icon-sort-by-attributes,icon-sort-by-attributes-alt,icon-sort-by-order,icon-sort-by-order-alt,icon-sort-down,icon-sort-up,icon-spinner,icon-stackexchange,icon-star,icon-star-empty,icon-star-half,icon-star-half-empty,icon-step-backward,icon-step-forward,icon-stethoscope,icon-stop,icon-strikethrough,icon-subscript,icon-suitcase,icon-sun,icon-superscript,icon-table,icon-tablet,icon-tag,icon-tags,icon-tasks,icon-terminal,icon-text-height,icon-text-width,icon-th,icon-th-large,icon-th-list,icon-thumbs-down,icon-thumbs-down-alt,icon-thumbs-up,icon-thumbs-up-alt,icon-ticket,icon-time,icon-tint,icon-trash,icon-trello,icon-trophy,icon-truck,icon-tumblr,icon-tumblr-sign,icon-twitter,icon-twitter-sign,icon-umbrella,icon-underline,icon-undo,icon-unlink,icon-unlock,icon-unlock-alt,icon-upload,icon-upload-alt,icon-usd,icon-user,icon-user-md,icon-vk,icon-volume-down,icon-volume-off,icon-volume-up,icon-warning-sign,icon-weibo,icon-windows,icon-wrench,icon-xing,icon-xing-sign,icon-youtube,icon-youtube-play,icon-youtube-sign,icon-zoom-in,icon-zoom-out';
  423.  
  424. $icons_raw = explode(',', $icons_raw);
  425. $icons[''] = 'no icon';
  426. foreach ($icons_raw as $icon) {
  427. $icon = trim($icon);
  428. $tmp = str_replace('icon-', '', $icon);
  429. $tmp = str_replace('-', ' ', $tmp);
  430. $icons[$icon] = $tmp;
  431. }
  432.  
  433. return $icons;
  434. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement