Skip to content

Commit

Permalink
Merge pull request #142 from 10up/feat/55
Browse files Browse the repository at this point in the history
feat/55: add colored icons for autoshare status
  • Loading branch information
jeffpaul authored Feb 22, 2022
2 parents e0e1116 + 3df3307 commit db3a247
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 6 deletions.
20 changes: 16 additions & 4 deletions assets/css/admin-autoshare-for-twitter.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ span.over-limit {
}

.autoshare-for-twitter-status-logo::before {
background-image: url('../images/twitter_black.svg');
background-image: url('../images/twitter_default.svg');
background-repeat: no-repeat;
background-size: 25px 25px;
content: ' ';
Expand All @@ -127,6 +127,18 @@ span.over-limit {
width: 25px;
}

tbody .autoshare-for-twitter-status-logo:hover::before {
background-image: url('../images/twitter_blue.svg');
}
tbody .autoshare-for-twitter-status-logo--published::before {
background-image: url('../images/twitter_tweeted.svg');
}

tbody .autoshare-for-twitter-status-logo--error::before {
background-image: url('../images/twitter_failed.svg');
}

tbody .autoshare-for-twitter-status-logo--enabled::before {
background-image: url('../images/twitter_enabled.svg');
}

tbody .autoshare-for-twitter-status-logo--disabled::before {
background-image: url('../images/twitter_disabled.svg');
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/twitter_disabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/twitter_enabled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/twitter_failed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions assets/images/twitter_tweeted.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion includes/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use TenUp\AutoshareForTwitter\Utils;
use const TenUp\AutoshareForTwitter\Core\Post_Meta\TWITTER_STATUS_KEY;
use function TenUp\AutoshareForTwitter\Utils\autoshare_enabled;

const POST_TYPE_SUPPORT_FEATURE = 'autoshare-for-twitter';

Expand Down Expand Up @@ -134,8 +135,20 @@ function modify_post_type_add_tweet_status( $column_name, $post_id ) {

printf(
'<a href="' . esc_url( $twitter_url ) . '" target="_blank" title="' . esc_attr( $tweet_title ) . '">
<span class="autoshare-for-twitter-status-logo"></span>
<span class="autoshare-for-twitter-status-logo autoshare-for-twitter-status-logo--published"></span>
</a>'
);
} elseif ( 'publish' === $post_status && 'error' === $status ) {
printf(
'<span class="autoshare-for-twitter-status-logo autoshare-for-twitter-status-logo--error"></span>'
);
} elseif ( 'future' === $post_status && autoshare_enabled( $post_id ) ) {
printf(
'<span class="autoshare-for-twitter-status-logo autoshare-for-twitter-status-logo--enabled"></span>'
);
} else {
printf(
'<span class="autoshare-for-twitter-status-logo autoshare-for-twitter-status-logo--disabled"></span>'
);
}
}

0 comments on commit db3a247

Please sign in to comment.