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_page_quick_edit_inline_action( $actions ) { | |
| unset( $actions['inline hide-if-no-js'] ); | |
| unset( $actions['view'] ); | |
| return $actions; | |
| } | |
| add_filter( 'post_row_actions', 'dbt_remove_page_quick_edit_inline_action', 10, 1 ); // Posts & Post-lik CPT's | |
| add_filter( 'page_row_actions', 'dbt_remove_page_quick_edit_inline_action', 10, 1 ); // Pages |
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_customize_tinymce_editor( $in ) { | |
| $in['block_formats'] = __( 'Heading 2' ) . '=h2;' . __( 'Heading 3' ) . '=h3;' . __( 'Paragraph' ) . '=p;'; | |
| $in['toolbar1'] = 'formatselect,bold,italic,underline,bullist,numlist,blockquote,link,unlink,pastetext'; | |
| $in['toolbar2'] = ''; | |
| $in['toolbar3'] = ''; | |
| $in['toolbar4'] = ''; | |
| $in['object_resizing'] = false; // Disable image re-sizing | |
| $in['paste_as_text'] = true; // Turn paste as plain text on by default |
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_default_inserted_image_link_type() { | |
| return 'none'; // also 'file' (default), 'post', 'custom' | |
| } | |
| add_filter( 'pre_option_image_default_link_type', 'dbt_default_inserted_image_link_type' ); | |
| function dbt_default_inserted_image_size() { | |
| return 'medium'; // also 'thumbnail' (default), 'large', 'full' | |
| } | |
| add_filter( 'pre_option_image_default_size', 'dbt_default_inserted_image_size' ); |
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_gallery_defaults( $settings ) { | |
| $settings['galleryDefaults']['size'] = 'thumbnail'; | |
| $settings['galleryDefaults']['link'] = 'file'; | |
| $settings['galleryDefaults']['columns'] = 2; | |
| return $settings; | |
| } | |
| add_filter( 'media_view_settings', 'dbt_gallery_defaults'); |
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
| if ( current_theme_supports( 'announcement' ) ) { | |
| function announcement_customizer( $wp_customize ) { | |
| $wp_customize->add_section( 'announcement', array( | |
| 'title' => __( 'Announcement' ), | |
| 'description' => __( 'A summary of this page will appear in the header area of your website.' ), | |
| 'priority' => 64, | |
| ) | |
| ); | |
| $wp_customize->add_setting( 'announcement_page', 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
| /** | |
| * Breadcrumbs @ https://wpcom-themes.svn.automattic.com/big-brother/functions.php | |
| */ | |
| function myplugin_breadcrumbs() { ?> | |
| <div class="breadcrumbs"> | |
| <?php | |
| $sep = '<span class="breadcrumbs-seperator">' . __( '»' ) . '</span>'; | |
| $before = '<span class="breadcrumbs-current">' . $sep ; | |
| $after = '</span>'; |
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
| http://stackoverflow.com/questions/23593897/wordpress-global-post-changed-after-query | |
| global $post; | |
| $backup_post = $post; | |
| ... | |
| $post = $backup_post; |
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_add_remove_theme_caps() { | |
| $role = get_role( 'client' ); | |
| // This only works, because it accesses the class instance. | |
| // Would allow the author to edit others' posts for current theme only | |
| $role->remove_cap( 'gravityforms_export_entries' ); | |
| $role->add_cap( 'gravityforms_export_entries' ); | |
| gform_full_access |
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
| // http://webdevstudios.com/2015/02/19/10-things-i-learned-migrating-websites-to-wordpress/ | |
| // In your function where you save the original url, sanitize the filename before you store it | |
| $cleaned_image_filename = santize_file_name( $image_filename ); | |
| update_post_meta( $post_id, ‘_orig_url’, $cleaned_image_filename ); | |
| // In the wds_redirect_old_traffic function update line 9 | |
| $request = santize_file_name( $wp->request ); | |
| // In the wds_get_post_id_from_external_url function update the following on line 35 |
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_post_columns( $columns ) { | |
| unset( $columns['cb'] ); | |
| unset( $columns['title'] ); | |
| unset( $columns['author'] ); | |
| unset( $columns['categories'] ); | |
| unset( $columns['tags'] ); | |
| unset( $columns['comments'] ); | |
| unset( $columns['date'] ); |