This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Create a Rating metabox for Accolades. | |
| */ | |
| function dbt_accolade_rating_metabox() { | |
| add_meta_box( 'dbt_accolade_rating_metabox', __( 'Testimonial Rating' ), 'dbt_accolade_rating_callback', 'accolade', 'normal', 'default' ); | |
| } | |
| add_action( 'add_meta_boxes', 'dbt_accolade_rating_metabox' ); | |
| function dbt_accolade_rating_callback( $post ) { | |
| wp_nonce_field( 'accolade_rating_check', 'accolade_rating_nonce' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="map" style="height:600px"></div> | |
| <script> | |
| function initMap() { | |
| var myLatLng = { lat: <?php esc_attr_e( sing_post_latitude() ); ?>, lng: <?php esc_attr_e( sing_post_longitude() ); ?> }; | |
| var map = new google.maps.Map(document.getElementById('map'), { | |
| center: myLatLng, | |
| scrollwheel: false, | |
| disableDoubleClickZoom: true, | |
| streetViewControl: false, | |
| mapTypeControl: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_remove_protected_private_in_title( $title ) { | |
| return '%s'; | |
| } | |
| add_filter( 'protected_title_format', 'dbt_remove_protected_private_in_title' ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_custom_archive_title() { | |
| if ( is_category() ) { | |
| $title = single_cat_title( '', false ); | |
| } | |
| elseif ( is_tag() ) { | |
| $title = single_tag_title( '', false ); | |
| } | |
| else { | |
| $title = post_type_archive_title( '', true ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function bhww_embed_handler_gist( $matches, $attr, $url, $rawattr ) { | |
| $embed = sprintf( | |
| '<script src="https://gist.github.com/%1$s.js%2$s"></script>', | |
| esc_attr($matches[1]), | |
| esc_attr($matches[2]) | |
| ); | |
| return apply_filters( 'embed_gist', $embed, $matches, $attr, $url, $rawattr ); | |
| } | |
| wp_embed_register_handler( 'gist', '/https?:\/\/gist\.github\.com\/([a-z0-9]+)(\?file=.*)?/i', 'bhww_embed_handler_gist' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_remove_post_type_support() { | |
| remove_post_type_support( 'post', 'custom-fields' ); // 'page' also a valid value | |
| remove_post_type_support( 'post', 'comments' ); // 'page' and 'attachment' also valid values | |
| remove_post_type_support( 'post', 'trackbacks' ); | |
| } | |
| add_action( 'init', 'dbt_remove_post_type_support' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_add_page_excerpt_support() { | |
| add_post_type_support( 'page', 'excerpt' ); | |
| } | |
| add_action( 'init', 'dbt_add_page_excerpt_support' ); | |
| function dbt_show_page_excerpt_metabox_by_default( $hidden, $screen ) { | |
| if ( 'page' == $screen->id ) { | |
| $hidden = array_flip( $hidden ); | |
| unset( $hidden['postexcerpt'] ); | |
| $hidden = array_flip( $hidden ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_custom_manage_columns( $columns ) { | |
| unset( $columns['author'] ); | |
| unset( $columns['date'] ); | |
| unset( $columns['comments'] ); | |
| return $columns; | |
| } | |
| add_filter( 'manage_edit-page_columns', 'dbt_custom_manage_columns' ); // Pages | |
| add_filter( 'manage_edit-cpt_columns', 'dbt_custom_manage_columns' ); // Custom Post Type - replace 'cpt' with your named CPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_custom_manage_posts_columns( $columns ) { | |
| unset( $columns['author'] ); | |
| unset( $columns['date'] ); | |
| unset( $columns['comments'] ); | |
| unset( $columns['categories'] ); | |
| unset( $columns['tags'] ); | |
| return $columns; | |
| } | |
| add_filter( 'manage_posts_columns', 'dbt_custom_manage_posts_columns' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dbt_remove_mine_view( $views ) { | |
| unset( $views['mine'] ); | |
| return $views; | |
| } | |
| add_action( 'views_edit-page', 'dbt_remove_mine_view' ); |