Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added updated rating notice #25

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions assets/css/bsf-custom-fonts.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.bsf-custom-fonts-file-wrap.form-field{
position: relative;
margin: 1.5em 0;
position: relative;
margin: 1.5em 0;
}
.bsf-custom-fonts-upload.button {
float: right;
Expand All @@ -10,4 +10,44 @@

.bsf-custom-font-select-field {
width: 95%;
}

.astra-review-notice-container {
display: flex;
align-items: center;
padding-top: 10px;
}

.astra-review-notice-container .dashicons {
font-size: 1.4em;
padding-left: 10px;
}

.astra-review-notice-container a {
padding-left: 5px;
text-decoration: none;
}

.astra-review-notice-container .dashicons:first-child {
padding-left: 0;
}

.notice-image img {
max-width: 90px;
}

.notice-content .notice-heading {
padding-bottom: 5px;
}

.notice-content {
margin-left: 15px;
}

.notice-container {
padding-top: 10px;
padding-bottom: 10px;
display: flex;
justify-content: left;
align-items: center;
}
Binary file added assets/images/custom-fonts-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions custom-fonts.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,60 @@
* BSF Custom Fonts
*/
require_once BSF_CUSTOM_FONTS_DIR . 'classes/class-bsf-custom-fonts.php';
require_once BSF_CUSTOM_FONTS_DIR . 'includes/lib/notices/class-astra-notices.php';

if ( ! function_exists( 'register_notices' ) ) :

/**
* Ask Theme Rating
*
* @since 1.4.0
*/
function register_notices() {
$image_path = BSF_CUSTOM_FONTS_URI . 'assets/images/custom-fonts-icon.png';
Astra_Notices::add_notice(
array(
'id' => 'custom-fonts-rating',
'type' => '',
'message' => sprintf(
'<div class="notice-image">
<img src="%1$s" class="custom-logo" alt="Custom Fonts" itemprop="logo"></div>
<div class="notice-content">
<div class="notice-heading">
%2$s
</div>
%3$s<br />
<div class="astra-review-notice-container">
<a href="%4$s" class="astra-notice-close astra-review-notice button-primary" target="_blank">
%5$s
</a>
<span class="dashicons dashicons-calendar"></span>
<a href="#" data-repeat-notice-after="%6$s" class="astra-notice-close astra-review-notice">
%7$s
</a>
<span class="dashicons dashicons-smiley"></span>
<a href="#" class="astra-notice-close astra-review-notice">
%8$s
</a>
</div>
</div>',
$image_path,
__( 'Hello! Seems like you have used Custom Fonts to build this website — Thanks a ton!', 'custom-fonts' ),
__( 'Could you please do us a BIG favor and give it a 5-star rating on WordPress? This would boost our motivation and help other users make a comfortable decision while choosing the Custom Fonts.', 'custom-fonts' ),
'https://wordpress.org/support/plugin/custom-fonts/reviews/?filter=5#new-post',
__( 'Ok, you deserve it', 'custom-fonts' ),
MONTH_IN_SECONDS,
__( 'Nope, maybe later', 'custom-fonts' ),
__( 'I already did', 'custom-fonts' )
),
'repeat-notice-after' => MONTH_IN_SECONDS,
'priority' => 25,
'display-with-other-notices' => false,
)
);
}

add_action( 'admin_notices', 'register_notices' );

endif;

Loading