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_filter('comment_text', 'make_clickable', 9); |
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 login_with_email_address($username) { | |
| $user = get_user_by('email',$username); | |
| if(!empty($user->user_login)) | |
| $username = $user->user_login; | |
| return $username; | |
| } | |
| add_action('wp_authenticate','login_with_email_address'); | |
| function change_username_wps_text($text){ | |
| if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){ |
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(!is_admin()){ | |
| remove_action('wp_head', 'wp_print_scripts'); | |
| remove_action('wp_head', 'wp_print_head_scripts', 9); | |
| remove_action('wp_head', 'wp_enqueue_scripts', 1); | |
| add_action('wp_footer', 'wp_print_scripts', 5); | |
| add_action('wp_footer', 'wp_enqueue_scripts', 5); | |
| add_action('wp_footer', 'wp_print_head_scripts', 5); | |
| } |
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 wps_force_ssl( $force_ssl, $post_id = 0, $url = '' ) { | |
| if ( $post_id == 25 ) { | |
| return true | |
| } | |
| return $force_ssl; | |
| } | |
| add_filter('force_ssl' , 'wps_force_ssl', 10, 3); |
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_filter('manage_posts_columns', 'posts_columns_id', 5); | |
| add_action('manage_posts_custom_column', 'posts_custom_id_columns', 5, 2); | |
| add_filter('manage_pages_columns', 'posts_columns_id', 5); | |
| add_action('manage_pages_custom_column', 'posts_custom_id_columns', 5, 2); | |
| function posts_columns_id($defaults){ | |
| $defaults['wps_post_id'] = __('ID'); | |
| return $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
| update_option( 'thumbnail_size_h', 0 ); | |
| update_option( 'thumbnail_size_w', 0 ); | |
| update_option( 'medium_size_h', 0 ); | |
| update_option( 'medium_size_w', 0 ); | |
| update_option( 'large_size_h', 0 ); | |
| update_option( 'large_size_w', 0 ); |
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 ajx_sharpen_resized_files( $resized_file ) { | |
| $image = wp_load_image( $resized_file ); | |
| if ( !is_resource( $image ) ) | |
| return new WP_Error( 'error_loading_image', $image, $file ); | |
| $size = @getimagesize( $resized_file ); | |
| if ( !$size ) | |
| return new WP_Error('invalid_image', __('Could not read image size'), $file); | |
| list($orig_w, $orig_h, $orig_type) = $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 fb_change_search_url_rewrite() { | |
| if ( is_search() && ! empty( $_GET['s'] ) ) { | |
| wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) ); | |
| exit(); | |
| } | |
| } | |
| add_action( 'template_redirect', 'fb_change_search_url_rewrite' ); |
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 version info from head and feeds | |
| function complete_version_removal() { | |
| return ''; | |
| } | |
| add_filter('the_generator', 'complete_version_removal'); |
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
| //This code checks for a featured image when updating. If no image exists it will save the current draft without publishing, and display an error message to the writer. This will ensure that no post can go live without a featured image attached. | |
| add_action('save_post', 'wpds_check_thumbnail'); | |
| add_action('admin_notices', 'wpds_thumbnail_error'); | |
| function wpds_check_thumbnail($post_id) { | |
| // change to any custom post type | |
| if(get_post_type($post_id) != 'post') | |
| return; | |
| if ( !has_post_thumbnail( $post_id ) ) { | |
| // set a transient to show the users an admin message |