add_control( 'cei_image_custom_class', [ 'label' => __( 'Custom Class', 'plugin-domain' ), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => __( 'your-custom-class', 'plugin-domain' ), ] ); } /** * Add custom class * * Add custom class to HTML img. * * @since 1.0 * * @access public */ public function add_custom_class( $html, $settings, $image_size_key, $image_key ) { if( $settings['cei_image_custom_class'] ) { return preg_replace( '/class="(.*)"/', 'class="'.$settings['cei_image_custom_class'].' \1"', $html ); } else { return $html; } } } ACEI_Init::instance();