Skip to content

Commit

Permalink
module/content: simplifying the logic on post action filters
Browse files Browse the repository at this point in the history
  • Loading branch information
geminorum committed Aug 25, 2020
1 parent 793df13 commit 3567549
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions inc/content.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,27 +471,23 @@ public static function renderActions( $post = NULL, $before = '<li class="-actio
$posttype = gThemeOptions::info( sprintf( 'post_actions_for_%s', $post->post_type ), NULL );

if ( FALSE === $posttype )
return; // bailed!
return; // bailing!

if ( is_null( $posttype ) )
$posttype = gThemeOptions::info( 'post_actions', NULL );

if ( FALSE === $posttype )
return; // bailed!

if ( ! is_null( $posttype ) )
$actions = $posttype;

else
$actions = [
'printlink',
'shortlink',
'bootstrap_qrcode',
'addtoany',
'comments_link',
'edit_post_link',
'editorial_estimated',
];
return; // bailing!

$actions = $posttype ?: [
'printlink',
'shortlink',
'bootstrap_qrcode',
'addtoany',
'comments_link',
'edit_post_link',
'editorial_estimated',
];
}

if ( is_null( $icon ) )
Expand Down

0 comments on commit 3567549

Please sign in to comment.