• Resolved Jeff Cohan

    (@jdcohan)


    It would be helpful if I could assign a CSS class name (or names) to popups.

    This way, if I had several popups that I wanted to display similarly, I wouldn’t have to keep adding new selectors with the popup IDs to my CSS file.

    Any thoughts on whether you might do this in an upcoming update?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support gonzalesc

    (@gonzalesc)

    Hi.

    Currently we dont plan to create a field for that purpose, but you can add a class name using a hook.

    For example: if you want to add a classname to your popups with ID 1000, 1005 and 1009

    <?php
    if( !function_exists('tymersys_class_to_box') ) {
    
    	function tymersys_class_to_box( $box_class, $opts, $css, $box ) {
    		
    		$popups_ids = array(1000, 1005, 1009);
    
    		if( in_array($box->ID, $popups_ids) )
    			$box_class .= ' your-custom-classname ';
    
    		return $box_class;
    	}
    	add_filter( 'spu/popup/box_class', 'tymersys_class_to_box', 10, 4);
    }
    ?>

    Regards

    Thread Starter Jeff Cohan

    (@jdcohan)

    Excellent. Thank you. I will try that.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wishlist: Add CSS class names’ is closed to new replies.