action_ef_loaded_load_modules(); } } /** * Share A Draft on WordPress.com breaks when redirect canonical is enabled * get_permalink() doesn't respect custom statuses * * @see http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/canonical.php#L113 */ add_filter( 'redirect_canonical', 'edit_flow_wpcom_redirect_canonical' ); function edit_flow_wpcom_redirect_canonical( $redirect ) { if ( ! empty( $_GET['shareadraft'] ) ) { return false; } return $redirect; } // This should fix a caching race condition that can sometimes create a published post with an empty slug add_filter( 'ef_fix_post_name_post', 'edit_flow_fix_fix_post_name' ); function edit_flow_fix_fix_post_name( $post ) { global $wpdb; $post_status = $wpdb->get_var( $wpdb->prepare( 'SELECT post_status FROM ' . $wpdb->posts . ' WHERE ID = %d', $post->ID ) ); if ( null !== $post_status ) { $post->post_status = $post_status; } return $post; }