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
| /** | |
| * Enable Administrators to add a Custom CSS Control to the Customiser. | |
| */ | |
| function onehundred_enable_custom_css() { | |
| if ( current_user_can('create_users') ) { | |
| function onehundred_enable_custom_css_option() { | |
| register_setting('general', 'onehundred_enable_custom_css', 'wp_filter_nohtml_kses'); | |
| add_settings_field('onehundred_enable_custom_css', __('Enable Custom CSS?', 'onehundred') , 'onehundred_enable_custom_css_form', 'general'); |
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 onehundred_testimonials_register_post_type() { | |
| $args = array( | |
| 'labels' => array( | |
| 'name' => _x( 'Testimonials', 'post type general name', 'onehundred' ), | |
| 'singular_name' => _x( 'Testimonial', 'post type singular name', 'onehundred' ), | |
| 'add_new' => _x( 'Add New', 'location', 'onehundred' ), | |
| 'add_new_item' => __( 'Add Testimonial', 'onehundred' ), | |
| 'edit_item' => __( 'Edit Testimonial', 'onehundred' ), | |
| 'new_item' => __( 'New Testimonial', 'onehundred' ), | |
| 'all_items' => __( 'All Testimonials', 'onehundred' ), |
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
| $wp_customize->add_section( 'header_background', array( | |
| 'title' => __( 'Custom Header Image', 'onehundred' ), | |
| 'priority' => 40, | |
| ) ); | |
| $wp_customize->add_setting( 'header_background', array( | |
| 'sanitize_callback' => 'construction_sanitize_file_url', | |
| ) ); | |
| $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'header_background', array( |
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, |
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
| 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
| /** | |
| * 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 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
| /** 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
| <?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', |