Advertisement
linccce

Shortcode panaudos scenarijus

May 3rd, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. function horizontal_form($atts)
  2. {
  3.  
  4.     $atts = shortcode_atts(array(
  5.         'type'=>'default'
  6.     ), $atts);
  7.  
  8.     wp_enqueue_style('horizontal_form', get_template_directory_uri() . '/assets/css/horizontal_form.css');
  9.  
  10.     $template = file_get_contents(get_template_directory() . '/assets/html/horizontal_form.html');
  11.  
  12.     if($atts['type']=='hp'){
  13.         wp_enqueue_script('moment');
  14.         wp_enqueue_script('bootstrap-datetimepicker');
  15.         $template = file_get_contents(get_template_directory() . '/assets/html/hp_horizontal_form.html');
  16.     }
  17.     $data = array(
  18.         'segment' => 'adult',
  19.         'niche' => 'general',
  20.         'ip' => $_SERVER['REMOTE_ADDR'],
  21.         'site_lang' => 'Swedish',
  22.         'site_name' => get_bloginfo('name'),
  23.         'dating_platform' => 'Dating Factory',
  24.     );
  25.  
  26.     return html_parser::parse_tpl($template, $data);
  27. }
  28.  
  29. add_shortcode('horizontal_form', 'horizontal_form');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement