Skip to content

Commit

Permalink
Remove duplicate function call, bail early if revision_id is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Nov 18, 2014
1 parent f9b30d5 commit a0e42d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions connectors/class-wp-stream-connector-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static function action_links( $links, $record ) {
$revision_id = absint( wp_stream_get_meta( $record, 'revision_id', true ) );
$revision_id = self::get_adjacent_post_revision( $revision_id, false );

if ( wp_is_post_revision( $revision_id ) ) {
if ( $revision_id ) {
$links[ esc_html__( 'Revision', 'stream' ) ] = get_edit_post_link( $revision_id );
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ public static function get_post_type_name( $post_type_slug ) {
* @return int $revision_id
*/
public static function get_adjacent_post_revision( $revision_id, $previous = true ) {
if ( ! wp_is_post_revision( $revision_id ) ) {
if ( empty( $revision_id ) || ! wp_is_post_revision( $revision_id ) ) {
return false;
}

Expand Down

0 comments on commit a0e42d2

Please sign in to comment.