collector->get_data();
$this->before_non_tabular_output();
echo '';
echo '' . esc_html__( 'True Conditionals', 'query-monitor' ) . '
';
echo '';
foreach ( $data->conds['true'] as $cond ) {
echo '' . esc_html( $cond ) . '()
';
}
echo '
';
echo '';
echo '';
echo '
';
echo '
';
echo '' . esc_html__( 'False Conditionals', 'query-monitor' ) . '
';
echo '';
foreach ( $data->conds['false'] as $cond ) {
echo '' . esc_html( $cond ) . '()
';
}
echo '
';
echo '';
$this->after_non_tabular_output();
}
/**
* @param array
$menu
* @return array
*/
public function admin_menu( array $menu ) {
/** @var QM_Data_Conditionals $data */
$data = $this->collector->get_data();
foreach ( $data->conds['true'] as $cond ) {
$id = $this->collector->id() . '-' . $cond;
$menu[ $id ] = $this->menu( array(
'title' => esc_html( $cond . '()' ),
'id' => 'query-monitor-conditionals-' . esc_attr( $cond ),
'meta' => array(
'classname' => 'qm-true qm-ltr',
),
) );
}
return $menu;
}
/**
* @param array $menu
* @return array
*/
public function panel_menu( array $menu ) {
/** @var QM_Data_Conditionals $data */
$data = $this->collector->get_data();
foreach ( $data->conds['true'] as $cond ) {
$id = $this->collector->id() . '-' . $cond;
unset( $menu[ $id ] );
}
$menu[ $this->collector->id() ] = $this->menu( array(
'title' => esc_html__( 'Conditionals', 'query-monitor' ),
'id' => 'query-monitor-conditionals',
) );
return $menu;
}
}
/**
* @param array $output
* @param QM_Collectors $collectors
* @return array
*/
function register_qm_output_html_conditionals( array $output, QM_Collectors $collectors ) {
$collector = QM_Collectors::get( 'conditionals' );
if ( $collector ) {
$output['conditionals'] = new QM_Output_Html_Conditionals( $collector );
}
return $output;
}
add_filter( 'qm/outputter/html', 'register_qm_output_html_conditionals', 50, 2 );