Exemple #1
0
 /**
  * Get style info
  *
  * @param array $element
  * @param type $output
  * @return type
  */
 static function get_style($element, $output)
 {
     $style = !empty($element['style']) ? $element['style'] : '';
     if (is_array($element['style'])) {
         $styles = array();
         foreach ($element['style'] as $att_name => $att_value) {
             $styles[] = "{$att_name} : {$att_value}";
         }
         $styles = "style = '" . implode(';', $styles) . "'";
     } else {
         $styles = '';
     }
     $output = WR_Megamenu_Helpers_Placeholder::remove_placeholder($output, 'custom_style', $styles);
     return $output;
 }
Exemple #2
0
 /**
  * Do shortcode & Return final html output for frontend
  * @param type $content
  */
 public static function doshortcode_content($wr_megamenu_content)
 {
     // remove placeholder text which was inserted to < and >
     $wr_megamenu_content = WR_Megamenu_Helpers_Placeholder::remove_placeholder($wr_megamenu_content, 'wrapper_append', '');
     $wr_megamenu_content = preg_replace_callback('/\\[wr_megamenu_widget\\s+([A-Za-z0-9_-]+=\\"[^"\']*\\"\\s*)*\\s*\\](.*)\\[\\/wr_megamenu_widget\\]/Us', array('self', 'widget_content'), $wr_megamenu_content);
     $output = do_shortcode($wr_megamenu_content);
     return $output;
 }