#mt-debug-bar .mt-debug-bar-title {
margin-bottom: 1em;
}
#mt-debug-bar .mt-debug-bar-context-table {
width: 100%;
font-size: 120%;
}
#mt-debug-bar .mt-debug-bar-context-table td {
padding: .5em .5em .5em 1em;
border: black solid 1px;
}
#mt-debug-bar .mt-debug-bar-context-table th {
padding: 1em;
border: black solid 1px;
}
';
$html .= '
';
$html .= '
' . esc_html__( 'The Events Calendar Context', 'tribe-common' ) . '
';
$html .= '
';
$html .= '';
$html .= '';
$html .= '';
$html .= '' . __( 'Key', 'tribe-common' ) . ' | ';
$html .= '' . __( 'Value', 'tribe-common' ) . ' | ';
$html .= '' . __( 'ORM arg', 'tribe-common' ) . ' | ';
$html .= '' . __( 'Reads', 'tribe-common' ) . ' | ';
$html .= '' . __( 'Writes', 'tribe-common' ) . ' | ';
$html .= '
';
$html .= '';
$locations = tribe_context()->get_locations();
$context = tribe_context()->to_array();
$orm_args = tribe_context()->get_orm_args();
foreach ( $locations as $key => $rw_data ) {
$orm_arg_key = Arr::get( $locations, [ $key, 'orm_arg' ], $key );
$orm_arg_value = Arr::get( $orm_args, $orm_arg_key, null );
$html .= '';
$html .= '' . $key . ' | ';
$html .= '' . ( isset( $context[ $key ] ) ? print_r( $context[ $key ], true ) : 'undefined' ) . ' | ';
$html .= '' . ( false !== $orm_arg_key ? '' . print_r( $orm_arg_key, true ) . ' => ' . print_r( $orm_arg_value, true ) . ' ' : '' ) . ' | ';
$html .= '' . ( isset( $locations[ $key ]['read'] ) ? 'yes' : 'no' ) . ' | ';
$html .= '' . ( isset( $locations[ $key ]['write'] ) ? 'yes' : 'no' ) . ' | ';
$html .= '
';
}
$html .= '
';
$html .= '';
$html .= '';
$state = tribe_context()->get_state();
$html .= '
';
$html .= '' . json_encode( $state, JSON_PRETTY_PRINT ) . '
';
$html .= '
';
echo $html;
}
}