/** * Echo the Page type name. * * @param int $post_id * * @return string */ function the_papi_page_type_name($post_id = 0) { echo papi_get_page_type_name($post_id); }
<div class="papi-debug"> <div> <p>Papi debug info</p> <div class="papi-debug-info"> <table> <thead> <tr> <th>Key</th> <th>Value</th> </tr> </thead> <tbody> <tr> <td>Page Type</td> <td><?php echo empty(papi_get_page_type_name()) ? 'No papi page type' : papi_get_page_type_name(); ?> </td> </tr> <tr> <td>Template</td> <td><?php global $template; echo basename($template); ?> </td> </tr> <tr> <td>Fields</td> <td> <?php
/** * Filter the link query results. * * @param array $results * * @return array */ public function wp_link_query(array $results) { $post_type = papi_get_post_type(); foreach ($results as $index => $value) { $name = papi_get_page_type_name($value['ID']); if (empty($name)) { $name = papi_filter_settings_standard_page_type_name($post_type); } $results[$index]['info'] = esc_html($name); } return $results; }
/** * Echo the page type name. * * @param int $post_id * * @return string */ function the_papi_page_type_name($post_id = 0) { echo esc_html(papi_get_page_type_name($post_id)); }