Skip to content
Merged
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
36 changes: 0 additions & 36 deletions assets/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,4 @@ jQuery( function($){
$input.filter('[value=""]').prop('checked', true);
}
} );

var $news_template = $('.news__entry.template').remove().removeClass('template');

$.ajax( '/wp-json/dable/v1/news' ).done( function(data) {
// TODO : show error messages

if ( ! data || ! data.list ) return;

var $news = $('ul.news').empty();

data.list.forEach( function(entry) {
var $entry = $news_template.clone();

// title
$entry.find('.news__title > a').text( entry.title );

// thumbnail
if ( entry.thumbnail_link ) {
$entry.find('.news__thumbnail').css('background-image', 'url(' + entry.thumbnail_link + ')');

} else {
$entry.find('.news__thumbnail').remove();
}

// description
var $paragraph = $entry.find('.news__content > a').text( entry.description );

// links
$entry.find('a').attr( 'href', function(){ return entry.link } );

$entry.appendTo( $news );

// clamp
$clamp($paragraph.parent().get(0), {clamp: 'auto'});
} );
} );
} );
12 changes: 0 additions & 12 deletions assets/clamp.min.js

This file was deleted.

68 changes: 0 additions & 68 deletions assets/style-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -157,71 +157,3 @@ label[for*="dable_thumbnail_"] {
display: block;
margin-bottom: 5px;
}

/* news */
.wrap.dable ul.news {
width: 300px;
margin: 0 0 0 50px;
}

@media (max-width: 960px) {
.wrap.dable ul.news {
width: auto;
max-width: 260px;
margin-left: 0;
}
}

.wrap.dable .news__entry {
padding: 0 20px;
margin-bottom: 38px;
}

@media (max-width: 960px) {
.wrap.dable .news__entry {
padding: 0;
}
}

.wrap.dable .news__entry.template {
display: none;
}

.wrap.dable .news__title {
font-size: 18px;
color: #23282d;
margin: 0 0 16px;
}

.wrap.dable .news__title a {
color: inherit;
text-decoration: none;
}

.wrap.dable .news__thumbnail {
background: no-repeat 50% 50%;
background-size: cover;
height: 150px;
background-color: #fff;
margin-bottom: 16px;
}

.wrap.dable .news__thumbnail a {
display: block;
width: 100%;
height: 100%;
}
.wrap.dable .news__thumbnail a:before {
content: ' ';
}

.wrap.dable .news__content {
height: 78px;
margin: 0;
overflow: hidden;
}

.wrap.dable .news__content a {
color: inherit;
text-decoration: none;
}
54 changes: 0 additions & 54 deletions class.dable-api.php

This file was deleted.

8 changes: 4 additions & 4 deletions class.dable.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function print_header() {
return;
}

the_post();
$post = get_post();
$post_id = get_queried_object_id();
$post = get_post( $post_id );

$meta = array(
'dable:item_id' => $post->ID,
'dable:published_time' => get_post_time( 'c', false, $post, false ),
'dable:author' => get_the_author_meta( 'display_name', $post->post_author ),
'dable:author' => get_the_author(),
);

$thumbnail = $this->get_thumbnail( $post );
Expand Down Expand Up @@ -180,7 +180,7 @@ protected function get_widget_code( $key ) {
}

public function add_content_wrapper( $content ) {
if ( is_feed() ) {
if (! is_singular() || ! is_main_query() || ! in_the_loop()) {
return $content;
}

Expand Down
6 changes: 2 additions & 4 deletions dable-for-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Description: Add Dable widgets and meta tags.
Author: Dable
Text Domain: dable
Version: 3.2.6
Version: 3.3.0
Author URI: http://dable.io
Domain Path: /languages
*/
/**
* @package dable
* @version 3.2.6
* @version 3.3.0
*/

define( 'DABLE_PLUGIN_VERSION', '3.2.6' );
Expand All @@ -20,11 +20,9 @@

require_once DABLE_PLUGIN_DIR . 'lib/functions.php';
require_once DABLE_PLUGIN_DIR . 'class.dable.php';
require_once DABLE_PLUGIN_DIR . 'class.dable-api.php';
require_once DABLE_PLUGIN_DIR . 'class.dable-widget.php';

new Dable();
new DableAPI();

if ( is_admin() ) {
require_once DABLE_PLUGIN_DIR . 'class.dable-admin.php';
Expand Down
11 changes: 8 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: dabledev, Taegon Kim
Donate link: http://dable.io/
Tags: dable
Requires at least: 4.6
Tested up to: 5.4
Stable tag: 3.2.6
Tested up to: 6.2
Stable tag: 3.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -110,4 +110,9 @@ No notice

= 3.2.6 =
* Fix bug of thumbnail update
* Refactor API Route
* Refactor API Route

= 3.3.0 =
* Tested compatibility with WordPress 6.2
* Removed the news section.
* Fixed bugs related to the Open Graph Meta Tags feature.
8 changes: 0 additions & 8 deletions views/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,5 @@ class="large-text"

<?php submit_button(); ?>
</form>

<ul class="news">
<li class="news__entry template">
<h3 class="news__title"><a href="#">Subject 1</a></h3>
<div class="news__thumbnail"><a href="#"></a></div>
<p class="news__content"><a href="#" class="more-link">Lorem ipsum</a></p>
</li>
</ul>
</div>
</div>