• Resolved Erich Munz

    (@erich_k4wp)


    i think i would by a nice feature if one could specify a id for the infobox columns:

    function fruitful_info_box ($atts, $content = null) {
    	$image = $title = $column = $class = $styletext = $styletitle = $out = $link = '';
    	$last =  false;
    	extract(shortcode_atts(array(
    	      'id'              => 'info-box-' . rand( 1, 100 ),
    		  'column'			=> '',
    		  'title'	   		=> '',
    		  'class'	   		=> '',
    		  'link'			=> '#',
    		  'image' 			=> '',
    		  'alt' 			=> '',
    		  'icon'			=> 'fa-check-square-o',
    		  'icon_position'	=> 'center',
    		  'styletext'	  	=> 'font-size:13px; ',
    		  'styletitle'		=> 'font-size:20px; text-transform: uppercase; ',
    		  'styleicon'		=> 'background-color:#000; color:#fff; border-radius:50%; ',
    		  'last'			=> ''
         ), $atts));
    
    	 //$id = 'info-box-' . rand( 1, 100 );
    
         if (isset($id)) 		    { $id		    = sanitize_html_class($id); }
         if (isset($column)) 		{ $column		= sanitize_html_class($column); }
    	 if (isset($title)) 		{ $title		= esc_attr($title); }
    	 if (isset($class)) 		{ $class		= sanitize_html_class($class); }
    	 if (isset($image)) 		{ $image		= esc_url ($image); }
    	 if (isset($alt)) 			{ $alt			= esc_html ($alt); }
    	 if (isset($styletext)) 	{ $styletext	= esc_html($styletext); }
    	 if (isset($styletitle)) 	{ $styletitle	= esc_html($styletitle); }
    	 if (isset($last)) 			{ if ($last) $last = 'last'; } else { $last = ''; }
    	 if (isset($icon_position)) { $icon_position = sanitize_html_class($icon_position);}
    	 if (isset($icon))			{ $icon			= sanitize_html_class($icon);} 
    
    	 if ($icon_position == 'left') {
    		$styletext  = 'text-align:left; '.$styletext ;
    		$styletitle = 'text-align:left; '.$styletitle ;
    	 } else if ($icon_position == 'right') {
    		$styletext  = 'text-align:right; '.$styletext ;
    		$styletitle = 'text-align:right; '.$styletitle ;
    	 } else {
    		$styletext  = 'text-align:center; '.$styletext ;
    		$styletitle = 'text-align:center; '.$styletitle	;
    	 }
    
    	 $out .= '<div id="'.$id.'" class="'.$class.' '. $column .' ffs-info-box ' . $icon_position . ' ' . $last . '" >';
    	 if (($link != '') && ($link != '#')) {
    		$out .= '<a href="'.fruitful_sh_esc_link($link).'">';
    	 }
    		if (($image != '') || ($icon != '')) {
    			$out .= '<div class="ffs-icon-box">';
    			if ($image != '') {
    				$out .= '<img class="icon" src="' . esc_url($image) .'" title="' . $title   . '" alt="' . $alt . '" />';
    			} else {
    				if ($icon != '')  $out .= '<span class="ffs-icon-container"><i class="fa '. $icon .'" style="'.$styleicon.'"></i></span>';
    
    			}
    			$out .= '</div>';
    		}
    
    		$out .= '<div class="ffs-content-box">';
    			if ($title   != '') {  $out .= '<div class="infobox-title" style="' . $styletitle .'">'  . $title   . '</div>'; }
    			if ($content != '') {  $out .= '<div class="infobox-text"  style="' . $styletext  .'" >' . fruitful_sh_esc_content_pbr(do_shortcode($content)) . '</div>'; }
    		$out .= '</div>';
    
    		if (($link != '') && ($link != '#')) {
    			$out .= '</a>';
    		}
    	 $out .= '</div>';
    	return $out;
    }
    add_shortcode ("fruitful_ibox", "fruitful_info_box");

    https://www.ads-software.com/plugins/fruitful-shortcodes/

Viewing 1 replies (of 1 total)
  • Plugin Author Fruitful Code

    (@fruitfulcode)

    Hello,

    Thanks for using our plugin and for your suggestion.
    I’ve sent your request to the development department. They will consider your offer.

    Regards

Viewing 1 replies (of 1 total)
  • The topic ‘Suggestion: add "ID" to "fruitful_ibox column"’ is closed to new replies.