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
| // Remove default columns from manage view. | |
| function myplugin_custom_manage_testimonial_columns( $columns ) { | |
| unset( $columns['author'] ); | |
| unset( $columns['date'] ); | |
| $columns['description'] = __( 'Excerpt' ); | |
| //$columns['menu_order_testimonial'] = __( 'Order' ); | |
| return $columns; | |
| } | |
| add_filter( 'manage_edit-testimonial_columns', 'myplugin_custom_manage_testimonial_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
| add_theme_support( 'myplugin-testimonials' ); // functions.php | |
| if ( function_exists('myplugin_testimonial_html') ) { myplugin_testimonial_html(); } // template file | |
| // Order by MENU ORDER > ASC when displayed in an archive. | |
| function rc_modify_query_get_design_projects( $query ) { | |
| if ( ! is_admin() && $query->is_main_query() && is_post_type_archive( 'testimonial' ) ) { | |
| $query->set('orderby', 'menu_order' ); |
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
| attachment_url_to_postid() |
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
| <?php | |
| if ( current_theme_supports( 'onehundred-header-image' ) ) { | |
| function myplugin_header_image_customize_register( $wp_customize ) { | |
| // Pre-selected header images. | |
| $wp_customize->add_setting( 'header_image_selection', array( | |
| 'default' => 'default', | |
| 'sanitize_callback' => 'myplugin_sanitize_header_image_select_choice', | |
| 'transport' => 'postMessage', |
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
| /** Resulting image is actually really big :-( */ | |
| function smashing_jpeg_quality() { | |
| return 100; | |
| } | |
| add_filter( 'jpeg_quality', 'smashing_jpeg_quality' ); |
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 myplugin_admin_custom_ui() { | |
| if ( is_admin() ) { | |
| // Remove All Dashboard Widgets. | |
| remove_meta_box( 'dashboard_activity', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); | |
| remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); |
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
| /** | |
| * Disable Google Open Sans font in the Admin area . Implementation idea from ... https://wordpress.org/plugins/disable-google-fonts/ | |
| */ | |
| function myplugin_admin_area_minus_open_sans_style() { | |
| // Remove Open Sans. Doesn't work :-( | |
| // See 'Disable_Google_Fonts' class below as an alternative. | |
| wp_dequeue_style('open-sans-css'); | |
| // Add custom style definitions to compensate for the removal of Open Sans | |
| wp_enqueue_style('myplugin-admin-minus-open-sans', plugins_url( 'css/admin-minus-open-sans.css', __FILE__ ), false, '1.0.0', 'all'); |
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 mytheme_remove_default_widgets() { | |
| $widgets = array( | |
| 'WP_Nav_Menu_Widget', | |
| 'WP_Widget_Archives', | |
| 'WP_Widget_Calendar', | |
| 'WP_Widget_Categories', | |
| 'WP_Widget_Meta', | |
| 'WP_Widget_Pages', | |
| 'WP_Widget_Recent_Comments', | |
| 'WP_Widget_Recent_Posts', |
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 mytheme_get_color_schemes() { | |
| $industry = get_option( 'mytheme_industry', 'construction' ); | |
| $function_name = 'mytheme_' . $industry . '_get_color_schemes'; | |
| return $function_name(); | |
| } |
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
| $button_slug = 'fetch'; | |
| $js_button_data = array( | |
| 'qt_button_text' => __( 'iframe' ), | |
| 'button_tooltip' => __( 'iframe' ), | |
| 'icon' => 'dashicons-admin-appearance', | |
| 'l10ncancel' => __( 'Cancel' ), | |
| 'l10ninsert' => __( 'Insert' ), | |
| 'modalHeight' => '400', | |
| //'width' => 500, |