Support

Account

Home Forums Feedback ACF Postbox classes / CSS identifiers Reply To: ACF Postbox classes / CSS identifiers

  • Thanks!

    Ended up with this:

    	function change_style_test($content) {
    		
    		switch ($content['title']) {
    			case 'Title1':
    				$content['style'] = 'acf-postbox-title1';
    			break;
    			case 'Title2':
    				$content['style'] = 'acf-postbox-title2';
    			break;
    			
    			default:
    				$content['style'] = 'seamless';
    			break;
    		}
    		
    		/*
    			// Test to see output 
    			echo '<pre>';
    			print_r($content);
    			echo '</pre>';
    		*/
    		
    		
    		return $content;
    		
    	}
    	
    	add_filter('acf/get_field_group', 'change_style_test');
    

    It can be automized though, sanitize the title and add that as a class.

    BTW, i’m not that experienced with using filters in WordPress. Is it possible to get an overview of filters and actions launched in a plugin? Or is it just digging around?

    But, it would still be great to have some <wrapper start> and </wrapper end> field in ACF so you have more control of the structure and looks of ACF.