1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<?php
class Papi_Property_Divider extends Papi_Property {
public function html() {
$options = $this->get_options();
$text = '';
if ( ! papi_is_empty( $options->description ) ) {
$text = sprintf( '<p>%s</p>', $options->description );
}
papi_render_html_tag( 'div', [
'class' => 'papi-property-divider',
'data-papi-rule' => $this->html_name(),
sprintf( '<h3><span>%s</span></h3>%s', $options->title, $text )
] );
}
protected function render_row_html() {
if ( $this->get_option( 'raw' ) ) {
parent::render_row_html();
} else {
?>
<tr class="<?php echo $this->display ? '' : 'papi-hide'; ?>">
<td colspan="2">
<?php $this->render_property_html(); ?>
</td>
</tr>
<?php
}
}
}