Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #132 from Codeinwp/development
Browse files Browse the repository at this point in the history
Updates for Travis
Prepare for retirement notice
  • Loading branch information
rodica-andronache authored Aug 6, 2019
2 parents 7b28993 + 635bf14 commit c45161e
Show file tree
Hide file tree
Showing 19 changed files with 256 additions and 108 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ php:
- '7.1'
- '7.0'
- '5.6'
- '5.5'
- '5.4'
matrix:
include:
- php: '5.3'
dist: precise
env: WP_VERSION=5.1.1
- php: '5.4'
dist: precise
env: WP_VERSION=5.1.1
- php: '5.5'
dist: precise
env: WP_VERSION=5.1.1
sudo: false
branches:
except:
Expand Down
19 changes: 4 additions & 15 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,11 @@

<div id="ob-grid" class="grid-layout">
<?php
while ( have_posts() ) :
while ( have_posts() ) {
the_post();
?>

<?php

/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );

?>

<?php endwhile; ?>
get_template_part( 'content', get_post_format() );
}
?>
</div>

<?php do_action( 'oblique_posts_navigation' ); ?>
Expand Down
28 changes: 14 additions & 14 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,29 @@
</ol><!-- .comment-list -->

<?php
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through
?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'oblique' ); ?></h2>
<div class="nav-links">
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h2 class="screen-reader-text"><?php _e( 'Comment navigation', 'oblique' ); ?></h2>
<div class="nav-links">

<div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'oblique' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'oblique' ) ); ?></div>
<div class="nav-previous"><?php previous_comments_link( __( 'Older Comments', 'oblique' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments', 'oblique' ) ); ?></div>

</div><!-- .nav-links -->
</nav><!-- #comment-nav-below -->
<?php
endif; // check for comment navigation
</div><!-- .nav-links -->
</nav><!-- #comment-nav-below -->
<?php
}
?>

<?php endif; ?>

<?php
// If comments are closed and there are comments, let's leave a little note, shall we?
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
?>
?>
<p class="no-comments"><?php _e( 'Comments are closed.', 'oblique' ); ?></p>
<?php
<?php
endif;
?>

Expand All @@ -70,6 +70,6 @@
'comment_notes_after' => '',
);
comment_form( apply_filters( 'oblique_comments_args', $args ) );
?>
?>

</div><!-- #comments -->
2 changes: 1 addition & 1 deletion content-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'after' => '</div>',
)
);
?>
?>
</div><!-- .entry-content -->

<footer class="entry-footer">
Expand Down
2 changes: 1 addition & 1 deletion content-single.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
'after' => '</div>',
)
);
?>
?>
</div><!-- .entry-content -->

<footer class="entry-footer">
Expand Down
2 changes: 1 addition & 1 deletion content.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
'after' => '</div>',
)
);
?>
?>
</div><!-- .entry-content -->
<?php do_action( 'oblique_post_entry_content_bottom' ); ?>
</div>
Expand Down
208 changes: 201 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package Oblique
*/

define( 'OBLIQUE_VERSION', '2.0.18' );
define( 'OBLIQUE_VERSION', '2.0.19' );

/**
* Themeisle SDK filter.
Expand Down Expand Up @@ -350,13 +350,13 @@ function oblique_posts_navigation() {
*/
function oblique_post_link_to_single() {
if ( ! get_theme_mod( 'read_more' ) ) :
?>
?>
<a href="<?php the_permalink(); ?>">
<div class="read-more">
<?php echo apply_filters( 'oblique_post_read_more', esc_html__( 'Continue reading &hellip;', 'oblique' ) ); ?>
</div>
</a>
<?php
<?php
endif;
}
add_action( 'oblique_link_to_single', 'oblique_post_link_to_single' );
Expand Down Expand Up @@ -482,7 +482,7 @@ function oblique_pro_register_footer_menu() {
*/
function oblique_pro_footer_menu() {

?>
?>
<nav id="footernav" class="footer-navigation col-md-6 col-xs-12" role="navigation">
<?php
wp_nav_menu(
Expand All @@ -495,7 +495,7 @@ function oblique_pro_footer_menu() {
);
?>
</nav><!-- #site-navigation -->
<?php
<?php

}
add_action( 'oblique_footer', 'oblique_pro_footer_menu' );
Expand All @@ -506,10 +506,14 @@ function oblique_pro_footer_menu() {
function oblique_neve_notice() {
global $current_user;
$user_id = $current_user->ID;
$ignored_notice = get_user_meta( $user_id, 'oblique_ignore_neve_notice' );
$ignored_notice = get_user_meta( $user_id, 'oblique_ignore_neve_notice_new' );
if ( ! empty( $ignored_notice ) ) {
return;
}
$should_display_notice = oblique_is_before_date( '2019-09-12' );
if ( ! $should_display_notice ) {
return;
}
$dismiss_button =
sprintf(
/* translators: Install Neve link */
Expand Down Expand Up @@ -537,7 +541,197 @@ function oblique_nag_ignore_neve() {
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['oblique_nag_ignore_neve'] ) && '0' == $_GET['oblique_nag_ignore_neve'] ) {
add_user_meta( $user_id, 'oblique_ignore_neve_notice', 'true', true );
add_user_meta( $user_id, 'oblique_ignore_neve_notice_new', 'true', true );
}
}
add_action( 'admin_init', 'oblique_nag_ignore_neve' );

/**
* Function that decide if current date is before a certain date.
*
* @param string $date Date to compare.
* @return bool
*/
function oblique_is_before_date( $date ) {
$countdown_time = strtotime( $date );
$current_time = time();
return $current_time <= $countdown_time;
}

/**
* Retirement notice
*/
function oblique_retirement_notice() {
global $current_user;
$user_id = $current_user->ID;
$ignored_notice = get_user_meta( $user_id, 'oblique_ignore_retirement_notice' );
if ( ! empty( $ignored_notice ) ) {
return;
}
$should_display_notice = ! oblique_is_before_date( '2019-09-12' );
if ( ! $should_display_notice ) {
return;
}
$dismiss_button =
sprintf(
/* translators: Install Neve link */
'<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
'?oblique_nag_ignore_retirement=0'
);

$theme_args = wp_get_theme();
$name = $theme_args->__get( 'Name' );

$notice_template = '
<div class="nv-notice-wrapper">
%1$s
<hr/>
<div class="nv-notice-column-container">
<div class="nv-notice-column nv-notice-image">%2$s</div>
<div class="nv-notice-column nv-notice-starter-sites">%3$s</div>
<div class="nv-notice-column nv-notice-documentation">%4$s</div>
</div>
</div>
<style>%5$s</style>';

/* translators: 1 - notice title, 2 - notice message */
$notice_header = sprintf(
'<h2>%1$s</h2><p class="about-description">%2$s</p></hr>',
esc_html__( 'Your theme is no longer maintained. A New, Modern WordPress Theme is Here!', 'oblique' ),
sprintf(
/* translators: %s - theme name */
esc_html__( '%s is no longer maintained. Switch to Neve today and get more powerful features (for free).', 'oblique' ),
$name
)
);

$notice_picture = sprintf(
'<picture>
<source srcset="about:blank" media="(max-width: 1024px)">
<img src="%1$s">
</picture>',
esc_url( get_template_directory_uri() . '/images/neve.png' )
);

$notice_right_side_content = sprintf(
'<div><h3> %1$s</h3><p>%2$s</p></div>',
__( 'Switch to Neve today', 'oblique' ),
// translators: %s - theme name
esc_html__( 'With Neve you get a super fast, multi-purpose theme, fully AMP optimized and responsive, that works perfectly with Gutenberg and the most popular page builders like Elementor, Beaver Builder, and many more.', 'oblique' )
);

$notice_left_side_content = sprintf(
'<div><h3> %1$s</h3><p>%2$s</p><p class="nv-buttons-wrapper"><a class="button button-hero button-primary" href="%3$s" target="_blank">%4$s</a></p> </div>',
// translators: %s - theme name
sprintf( esc_html__( '%s is no longer maintained', 'oblique' ), $name ),
// translators: %s - theme name
sprintf( __( 'We\'re saying goodbye to oblique in favor of our more powerful Neve free WordPress theme. This means that there will not be any new features added although we will continue to update the theme for major security issues.', 'oblique' ) ),
esc_url( admin_url( 'theme-install.php?theme=neve' ) ),
esc_html__( 'See Neve theme', 'oblique' )
);

$style = '
.nv-notice-wrapper p{
font-size: 14px;
}
.nv-buttons-wrapper {
padding-top: 20px !important;
}
.nv-notice-wrapper h2{
margin: 0;
font-size: 21px;
font-weight: 400;
line-height: 1.2;
}
.nv-notice-wrapper p.about-description{
color: #72777c;
font-size: 16px;
margin: 0;
padding:0px;
}
.nv-notice-wrapper{
padding: 23px 10px 0;
max-width: 1500px;
}
.nv-notice-wrapper hr {
margin: 20px -23px 0;
border-top: 1px solid #f3f4f5;
border-bottom: none;
}
.nv-notice-column-container h3{
margin: 17px 0 0;
font-size: 16px;
line-height: 1.4;
}
.nv-notice-text p.ti-return-dashboard {
margin-top: 30px;
}
.nv-notice-column-container .nv-notice-column{
padding-right: 60px;
}
.nv-notice-column-container img{
margin-top: 23px;
width: 100%;
border: 1px solid #f3f4f5;
}
.nv-notice-column-container {
display: -ms-grid;
display: grid;
-ms-grid-columns: 24% 32% 32%;
grid-template-columns: 24% 32% 32%;
margin-bottom: 13px;
}
.nv-notice-column-container a.button.button-hero.button-secondary,
.nv-notice-column-container a.button.button-hero.button-primary{
margin:0px;
}
@media screen and (max-width: 1280px) {
.nv-notice-wrapper .nv-notice-column-container {
-ms-grid-columns: 50% 50%;
grid-template-columns: 50% 50%;
}
.nv-notice-column-container a.button.button-hero.button-secondary,
.nv-notice-column-container a.button.button-hero.button-primary{
padding:6px 18px;
}
.nv-notice-wrapper .nv-notice-image {
display: none;
}
}
@media screen and (max-width: 870px) {
.nv-notice-wrapper .nv-notice-column-container {
-ms-grid-columns: 100%;
grid-template-columns: 100%;
}
.nv-notice-column-container a.button.button-hero.button-primary{
padding:12px 36px;
}
}
';

$message = sprintf(
$notice_template,
$notice_header,
$notice_picture,
$notice_left_side_content,
$notice_right_side_content,
$style
);// WPCS: XSS OK.

printf( '<div class="notice updated" style="position:relative; padding-right: 35px;">%1$s<p>%2$s</p></div>', $dismiss_button, $message );
}
add_action( 'admin_notices', 'oblique_retirement_notice' );

/**
* Update the oblique_ignore_retirement_notice option to true, to dismiss the notice from the dashboard
*/
function oblique_nag_ignore_retirement() {
global $current_user;
$user_id = $current_user->ID;
/* If user clicks to ignore the notice, add that to their user meta */
if ( isset( $_GET['oblique_nag_ignore_retirement'] ) && '0' == $_GET['oblique_nag_ignore_retirement'] ) {
add_user_meta( $user_id, 'oblique_ignore_retirement_notice', 'true', true );
}
}
add_action( 'admin_init', 'oblique_nag_ignore_retirement' );
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
}
/* Show only logo */
if ( ! empty( $oblique_custom_logo ) && ! empty( $oblique_custom_logo[0] ) && get_theme_mod( 'logo_style', 'hide-title' ) == 'hide-title' ) :
?>
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>"><img class="site-logo" src="<?php echo esc_url( $oblique_custom_logo[0] ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" /></a>
<?php elseif ( get_theme_mod( 'logo_style', 'hide-title' ) == 'show-title' ) : ?>
<?php if ( ! empty( $oblique_custom_logo ) && ! empty( $oblique_custom_logo[0] ) ) { ?>
Expand Down
Binary file added images/neve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c45161e

Please sign in to comment.