/** * Modifies templateß * @param array $otpl Original template data * @return array Template data */ public function filter_template($otpl, $id) { $tpl_key = filter_input(INPUT_GET, 'tpl'); $tpl = ppbpro_get_template($tpl_key); if ($tpl) { $pc = ppbpro_get_tpl_pc_data($tpl_key); if ($pc) { update_post_meta($id, 'pootle-page-customizer', $pc); } return $tpl; } else { return $otpl; } }
display: inline-block; width: 45%; max-width: 500px; min-width: 300px; margin: 2.5%; font-weight: 200; font-size: 25px; text-decoration: none; color: #555; text-align: center; } .ppb-template:hover { color:#333; } </style> <div class="wrap"> <h2>Starter Templates</h2> <div class="ppb-templates"> <?php foreach (ppbpro_get_template() as $Tpl) { $tpl = strtolower($Tpl); $img_url = "{$thmb_url}/{$tpl}.png"; if (!file_exists("{$thmb_pth}/{$tpl}.png")) { $img_url = "http://pootlepress.github.io/pootle-page-builder/tpl-thumbs/{$tpl}.png"; } echo "<a class='ppb-template' href='{$live_page_url}&tpl={$Tpl}'><div class='ppb-tpl-img' style='background-image:url(\"{$img_url}\")'><div class='dashicons dashicons-plus'><div>Add Page with this template</div></div></div>{$Tpl}</a>"; } ?> </div> </div>