/** * Generate html markup for data preview */ public function __action_DataPreview() { if (!empty($_POST)) { $data = stripslashes_deep($_POST); meAnjanWqg_Utils::saveData($data); } $wqgData = meAnjanWqg_Utils::getData(); if (empty($wqgData)) { $wqgData = array(); } $gen = new meAnjanWqg_Generator($wqgData); $gen->generateCode(); $args = $gen->getGeneratedArgs(); $query = new WP_Query($args); $posts = $query->get_posts(); require_once ME_ANJAN_PLUGIN_WQG_DIR . 'includes/templates/preview/posts-list.php'; exit; }
<div class="me-anjan-wqg-output-block" id="<?php echo $idPrefix . $main->getConfig('html/ids/generator_output'); ?> "> <p class="me-anjan-wqg-code-help clearfix"> Double click on anywhere in the code to select and copy <button type="button" class="button-secondary me-anjan-wqg-btn-preview">Preview Data </button> </p> <?php $gen = new meAnjanWqg_Generator($wqgData); $generatedCode = $gen->generateCode(); $generatedCode = str_replace('<', '<', $generatedCode); ?> <div class="me-anjan-wqg-sh-code"> <pre class="brush: php"><?php echo $generatedCode; ?> </pre> </div> </div>