Skip to content

Commit

Permalink
Fix code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-vlasenko committed Nov 3, 2021
1 parent 0a243b3 commit 066bf4a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,16 @@ function gutenberg_disable_block_editor_for_navigation_post_type( $value, $post_
*
* @return string
*/
function gutenberg_disable_edit_links_for_navigation_post_type($url, $post_id) {
$post = get_post($post_id);
function gutenberg_disable_edit_links_for_navigation_post_type( $url, $post_id ) {
$post = get_post( $post_id );
if ( 'wp_navigation' !== $post->post_type ) {
return $url;
}

return 'javascript:void(0)';
}

add_filter( 'get_edit_post_link', 'gutenberg_disable_edit_links_for_navigation_post_type', 10, 2);
add_filter( 'get_edit_post_link', 'gutenberg_disable_edit_links_for_navigation_post_type', 10, 2 );

/**
* This function disables "Edit" row action for wp_navigation type posts.
Expand All @@ -482,13 +483,13 @@ function gutenberg_disable_edit_links_for_navigation_post_type($url, $post_id) {
*
* @return array
*/
function gutenberg_disable_edit_row_action_for_navigation_post_type($actions, $post) {
function gutenberg_disable_edit_row_action_for_navigation_post_type( $actions, $post ) {
if ( 'wp_navigation' !== $post->post_type ) {
return $actions;
}

unset($actions['edit']);
unset( $actions['edit'] );
return $actions;
}

add_filter( 'post_row_actions', 'gutenberg_disable_edit_row_action_for_navigation_post_type', 10, 2);
add_filter( 'post_row_actions', 'gutenberg_disable_edit_row_action_for_navigation_post_type', 10, 2 );

0 comments on commit 066bf4a

Please sign in to comment.