Skip to content

Commit

Permalink
Merge pull request #277 from 10up/fix/276
Browse files Browse the repository at this point in the history
Fixed Twitter accounts visibility in the classic editor.
  • Loading branch information
iamdharmesh authored Aug 28, 2023
2 parents 003c164 + 1c10981 commit c2a20e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/admin/post-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ function render_tweet_submitbox( $post ) {
* @param int $post_id The post ID.
*/
function render_twitter_accounts( $post_id ) {
$accounts = ( new Twitter_Accounts() )->get_twitter_accounts( true );
$post_status = get_post_status( $post_id );
$accounts = ( new Twitter_Accounts() )->get_twitter_accounts( true );
if ( empty( $accounts ) ) {
return;
}
Expand All @@ -293,7 +294,7 @@ function render_twitter_accounts( $post_id ) {
if ( empty( $enabled ) ) {
$enabled = Utils\get_default_autoshare_accounts();
}
$display = ( autoshare_enabled( $post_id ) ) ? '' : 'display: none;';
$display = ( autoshare_enabled( $post_id ) || 'publish' === $post_status ) ? '' : 'display: none;';
?>
<div class="autoshare-for-twitter-accounts-wrapper" style="<?php echo esc_attr( $display ); ?>">
<?php
Expand Down

0 comments on commit c2a20e6

Please sign in to comment.