Version Description
Download this release
Release Info
Developer | machothemes |
Plugin | Simple Custom Post Order |
Version | 2.4.3 |
Comparing to | |
See all releases |
Code changes from version 2.4.2 to 2.4.3
- class-colorlib-dashboard-widget-extend-feed.php +90 -0
- readme.txt +4 -1
- settings.php +173 -14
- simple-custom-post-order.php +3 -3
class-colorlib-dashboard-widget-extend-feed.php
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! class_exists( 'Colorlib_Dashboard_Widget_Extend_Feed' ) ) {
|
4 |
+
|
5 |
+
class Colorlib_Dashboard_Widget_Extend_Feed {
|
6 |
+
|
7 |
+
public function __construct() {
|
8 |
+
|
9 |
+
// Actions.
|
10 |
+
add_action( 'wp_feed_options', array( $this, 'dashboard_update_feed_urls' ), 10, 2 );
|
11 |
+
|
12 |
+
// Filters.
|
13 |
+
add_filter( 'dashboard_secondary_items', array( $this, 'dashboard_items_count' ) );
|
14 |
+
|
15 |
+
}
|
16 |
+
|
17 |
+
public function dashboard_items_count() {
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Apply the filters am_dashboard_feed_count for letting an admin
|
21 |
+
* override this count.
|
22 |
+
*/
|
23 |
+
return (int) apply_filters( 'colorlib_dashboard_feed_count', 6 );
|
24 |
+
}
|
25 |
+
|
26 |
+
public function dashboard_update_feed_urls( $feed, $url ) {
|
27 |
+
|
28 |
+
global $pagenow;
|
29 |
+
|
30 |
+
// Return early if not on the right page.
|
31 |
+
if ( 'admin-ajax.php' !== $pagenow ) {
|
32 |
+
return;
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Return early if not on the right feed.
|
37 |
+
* We want to modify the feed URLs only for the
|
38 |
+
* WordPress Events & News Dashboard Widget
|
39 |
+
*/
|
40 |
+
if ( is_array( $url ) ) {
|
41 |
+
if ( ! in_array( 'https://planet.wordpress.org/feed/', $url ) ) {
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
}else{
|
45 |
+
if ( strpos( $url, 'planet.wordpress.org' ) === false ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
// Build the feed sources.
|
51 |
+
$all_feed_urls = $this->get_feed_urls( $url );
|
52 |
+
|
53 |
+
// Update the feed sources.
|
54 |
+
$feed->set_feed_url( $all_feed_urls );
|
55 |
+
}
|
56 |
+
|
57 |
+
public function get_feed_urls( $url ) {
|
58 |
+
|
59 |
+
// Initialize the feeds array.
|
60 |
+
$feed_urls = array( $url );
|
61 |
+
|
62 |
+
$check = get_transient( 'colorlib_dashboard_feed' );
|
63 |
+
$feeds = array();
|
64 |
+
if ( ! $check ) {
|
65 |
+
|
66 |
+
$feed_working = 'not-working';
|
67 |
+
|
68 |
+
// Load SimplePie Instance
|
69 |
+
$feed = fetch_feed( array( 'https://colorlib.com/wp/feed/' ) );
|
70 |
+
|
71 |
+
// TODO report error when is an error loading the feed
|
72 |
+
if ( ! is_wp_error( $feed ) ) {
|
73 |
+
$feed_urls[] = 'https://colorlib.com/wp/feed/';
|
74 |
+
$feed_working = 'working';
|
75 |
+
}
|
76 |
+
|
77 |
+
set_transient( 'colorlib_dashboard_feed', $feed_working, 12 * HOUR_IN_SECONDS );
|
78 |
+
|
79 |
+
}elseif ( 'working' == $check ) {
|
80 |
+
$feed_urls[] = 'https://colorlib.com/wp/feed/';
|
81 |
+
}
|
82 |
+
|
83 |
+
// Return the feed URLs.
|
84 |
+
return array_unique( $feed_urls );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
// Create an instance.
|
89 |
+
new Colorlib_Dashboard_Widget_Extend_Feed();
|
90 |
+
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: custom post order, post order, js post order, page order, posts order, cat
|
|
4 |
Requires at least: 4.6
|
5 |
Requires PHP: 5.6
|
6 |
Tested up to: 5.1
|
7 |
-
Stable tag: 2.4.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -36,6 +36,9 @@ An answer to that question.
|
|
36 |
|
37 |
== Changelog ==
|
38 |
|
|
|
|
|
|
|
39 |
= Version 2.4.2 =
|
40 |
* Fixed potential bug with other plugins
|
41 |
* Fixed table breaking on re-ordering when Yoast SEO installed
|
4 |
Requires at least: 4.6
|
5 |
Requires PHP: 5.6
|
6 |
Tested up to: 5.1
|
7 |
+
Stable tag: 2.4.3
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
36 |
|
37 |
== Changelog ==
|
38 |
|
39 |
+
= Version 2.4.3 =
|
40 |
+
* Minor UI update added toggles
|
41 |
+
|
42 |
= Version 2.4.2 =
|
43 |
* Fixed potential bug with other plugins
|
44 |
* Fixed table breaking on re-ordering when Yoast SEO installed
|
settings.php
CHANGED
@@ -3,7 +3,100 @@ $scporder_options = get_option('scporder_options');
|
|
3 |
$scporder_objects = isset($scporder_options['objects']) ? $scporder_options['objects'] : array();
|
4 |
$scporder_tags = isset($scporder_options['tags']) ? $scporder_options['tags'] : array();
|
5 |
?>
|
|
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
<div class="wrap">
|
8 |
<h2><?php _e('Simple Custom Post Order Settings', 'simple-custom-post-order'); ?></h2>
|
9 |
<?php if (isset($_GET['msg'])) : ?>
|
@@ -25,7 +118,23 @@ $scporder_tags = isset($scporder_options['tags']) ? $scporder_options['tags'] :
|
|
25 |
<tr valign="top">
|
26 |
<th scope="row"><?php _e('Check to Sort Post Types', 'simple-custom-post-order') ?></th>
|
27 |
<td>
|
28 |
-
<label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
<?php
|
30 |
$post_types = get_post_types(array(
|
31 |
'show_ui' => true,
|
@@ -36,13 +145,30 @@ $scporder_tags = isset($scporder_options['tags']) ? $scporder_options['tags'] :
|
|
36 |
if ($post_type->name == 'attachment')
|
37 |
continue;
|
38 |
?>
|
39 |
-
<label
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
-
|
45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
<?php
|
47 |
}
|
48 |
?>
|
@@ -60,7 +186,23 @@ $scporder_tags = isset($scporder_options['tags']) ? $scporder_options['tags'] :
|
|
60 |
<tr valign="top">
|
61 |
<th scope="row"><?php _e('Check to Sort Taxonomies', 'simple-custom-post-order') ?></th>
|
62 |
<td>
|
63 |
-
<label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
<?php
|
65 |
$taxonomies = get_taxonomies(array(
|
66 |
'show_ui' => true,
|
@@ -70,13 +212,30 @@ $scporder_tags = isset($scporder_options['tags']) ? $scporder_options['tags'] :
|
|
70 |
if ($taxonomy->name == 'post_format')
|
71 |
continue;
|
72 |
?>
|
73 |
-
<label
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
<?php
|
81 |
}
|
82 |
?>
|
3 |
$scporder_objects = isset($scporder_options['objects']) ? $scporder_options['objects'] : array();
|
4 |
$scporder_tags = isset($scporder_options['tags']) ? $scporder_options['tags'] : array();
|
5 |
?>
|
6 |
+
<style>
|
7 |
|
8 |
+
.epsilon-toggle {
|
9 |
+
position: relative;
|
10 |
+
display:inline-block;
|
11 |
+
user-select: none;
|
12 |
+
}
|
13 |
+
|
14 |
+
.epsilon-toggle__items {
|
15 |
+
box-sizing: border-box;
|
16 |
+
}
|
17 |
+
|
18 |
+
.epsilon-toggle__items > * {
|
19 |
+
box-sizing: inherit;
|
20 |
+
}
|
21 |
+
|
22 |
+
.epsilon-toggle__input[type=checkbox] {
|
23 |
+
border-radius: 2px;
|
24 |
+
border: 2px solid #6c7781;
|
25 |
+
margin-right: 12px;
|
26 |
+
transition: none;
|
27 |
+
height: 100%;
|
28 |
+
left: 0;
|
29 |
+
top: 0;
|
30 |
+
margin: 0;
|
31 |
+
padding: 0;
|
32 |
+
opacity: 0;
|
33 |
+
position: absolute;
|
34 |
+
width: 100%;
|
35 |
+
z-index: 1;
|
36 |
+
}
|
37 |
+
|
38 |
+
.epsilon-toggle__track {
|
39 |
+
background-color: #fff;
|
40 |
+
border: 2px solid #6c7781;
|
41 |
+
border-radius: 9px;
|
42 |
+
display: inline-block;
|
43 |
+
height: 18px;
|
44 |
+
width: 36px;
|
45 |
+
vertical-align: top;
|
46 |
+
transition: background .2s ease;
|
47 |
+
}
|
48 |
+
|
49 |
+
.epsilon-toggle__thumb {
|
50 |
+
background-color: #6c7781;
|
51 |
+
border: 5px solid #6c7781;
|
52 |
+
border-radius: 50%;
|
53 |
+
display: block;
|
54 |
+
height: 10px;
|
55 |
+
width: 10px;
|
56 |
+
position: absolute;
|
57 |
+
left: 4px;
|
58 |
+
top: 4px;
|
59 |
+
transition: transform .2s ease;
|
60 |
+
}
|
61 |
+
|
62 |
+
.epsilon-toggle__off {
|
63 |
+
position: absolute;
|
64 |
+
right: 6px;
|
65 |
+
top: 6px;
|
66 |
+
color: #6c7781;
|
67 |
+
fill: currentColor;
|
68 |
+
}
|
69 |
+
|
70 |
+
.epsilon-toggle__on {
|
71 |
+
position: absolute;
|
72 |
+
top: 6px;
|
73 |
+
left: 8px;
|
74 |
+
border: 1px solid #fff;
|
75 |
+
outline: 1px solid transparent;
|
76 |
+
outline-offset: -1px;
|
77 |
+
display: none;
|
78 |
+
}
|
79 |
+
|
80 |
+
|
81 |
+
.epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__track {
|
82 |
+
background-color: #11a0d2;
|
83 |
+
border: 9px solid transparent;
|
84 |
+
}
|
85 |
+
|
86 |
+
.epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__thumb {
|
87 |
+
background-color: #fff;
|
88 |
+
border-width: 0;
|
89 |
+
transform: translateX(18px);
|
90 |
+
}
|
91 |
+
|
92 |
+
.epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__off {
|
93 |
+
display: none;
|
94 |
+
}
|
95 |
+
|
96 |
+
.epsilon-toggle__input[type=checkbox]:checked + .epsilon-toggle__items .epsilon-toggle__on {
|
97 |
+
display: inline-block;
|
98 |
+
}
|
99 |
+
</style>
|
100 |
<div class="wrap">
|
101 |
<h2><?php _e('Simple Custom Post Order Settings', 'simple-custom-post-order'); ?></h2>
|
102 |
<?php if (isset($_GET['msg'])) : ?>
|
118 |
<tr valign="top">
|
119 |
<th scope="row"><?php _e('Check to Sort Post Types', 'simple-custom-post-order') ?></th>
|
120 |
<td>
|
121 |
+
<label>
|
122 |
+
<div class="epsilon-toggle">
|
123 |
+
<input id="scporder_allcheck_objects" class="epsilon-toggle__input" type="checkbox">
|
124 |
+
<div class="epsilon-toggle__items">
|
125 |
+
<span class="epsilon-toggle__track"></span>
|
126 |
+
<span class="epsilon-toggle__thumb"></span>
|
127 |
+
<svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true"
|
128 |
+
role="img" focusable="false" viewBox="0 0 6 6">
|
129 |
+
<path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
|
130 |
+
</svg>
|
131 |
+
<svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true"
|
132 |
+
role="img" focusable="false" viewBox="0 0 2 6">
|
133 |
+
<path d="M0 0h2v6H0z"></path>
|
134 |
+
</svg>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
<?php _e('Check All', 'simple-custom-post-order') ?></label><br>
|
138 |
<?php
|
139 |
$post_types = get_post_types(array(
|
140 |
'show_ui' => true,
|
145 |
if ($post_type->name == 'attachment')
|
146 |
continue;
|
147 |
?>
|
148 |
+
<label>
|
149 |
+
<div class="epsilon-toggle">
|
150 |
+
<input class="epsilon-toggle__input" type="checkbox"
|
151 |
+
name="objects[]" value="<?php echo $post_type->name; ?>" <?php
|
152 |
+
if (isset($scporder_objects) && is_array($scporder_objects)) {
|
153 |
+
if (in_array($post_type->name, $scporder_objects)) {
|
154 |
+
echo 'checked="checked"';
|
155 |
+
}
|
156 |
}
|
157 |
+
?>>
|
158 |
+
<div class="epsilon-toggle__items">
|
159 |
+
<span class="epsilon-toggle__track"></span>
|
160 |
+
<span class="epsilon-toggle__thumb"></span>
|
161 |
+
<svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true"
|
162 |
+
role="img" focusable="false" viewBox="0 0 6 6">
|
163 |
+
<path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
|
164 |
+
</svg>
|
165 |
+
<svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true"
|
166 |
+
role="img" focusable="false" viewBox="0 0 2 6">
|
167 |
+
<path d="M0 0h2v6H0z"></path>
|
168 |
+
</svg>
|
169 |
+
</div>
|
170 |
+
</div>
|
171 |
+
<?php echo $post_type->label; ?></label><br>
|
172 |
<?php
|
173 |
}
|
174 |
?>
|
186 |
<tr valign="top">
|
187 |
<th scope="row"><?php _e('Check to Sort Taxonomies', 'simple-custom-post-order') ?></th>
|
188 |
<td>
|
189 |
+
<label>
|
190 |
+
<div class="epsilon-toggle">
|
191 |
+
<input id="scporder_allcheck_tags" class="epsilon-toggle__input" type="checkbox">
|
192 |
+
<div class="epsilon-toggle__items">
|
193 |
+
<span class="epsilon-toggle__track"></span>
|
194 |
+
<span class="epsilon-toggle__thumb"></span>
|
195 |
+
<svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true"
|
196 |
+
role="img" focusable="false" viewBox="0 0 6 6">
|
197 |
+
<path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
|
198 |
+
</svg>
|
199 |
+
<svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true"
|
200 |
+
role="img" focusable="false" viewBox="0 0 2 6">
|
201 |
+
<path d="M0 0h2v6H0z"></path>
|
202 |
+
</svg>
|
203 |
+
</div>
|
204 |
+
</div>
|
205 |
+
<?php _e('Check All', 'simple-custom-post-order') ?></label><br>
|
206 |
<?php
|
207 |
$taxonomies = get_taxonomies(array(
|
208 |
'show_ui' => true,
|
212 |
if ($taxonomy->name == 'post_format')
|
213 |
continue;
|
214 |
?>
|
215 |
+
<label>
|
216 |
+
<div class="epsilon-toggle">
|
217 |
+
<input class="epsilon-toggle__input" type="checkbox"
|
218 |
+
name="tags[]" value="<?php echo $taxonomy->name; ?>" <?php
|
219 |
+
if (isset($scporder_tags) && is_array($scporder_tags)) {
|
220 |
+
if (in_array($taxonomy->name, $scporder_tags)) {
|
221 |
+
echo 'checked="checked"';
|
222 |
+
}
|
223 |
}
|
224 |
+
?>>
|
225 |
+
<div class="epsilon-toggle__items">
|
226 |
+
<span class="epsilon-toggle__track"></span>
|
227 |
+
<span class="epsilon-toggle__thumb"></span>
|
228 |
+
<svg class="epsilon-toggle__off" width="6" height="6" aria-hidden="true"
|
229 |
+
role="img" focusable="false" viewBox="0 0 6 6">
|
230 |
+
<path d="M3 1.5c.8 0 1.5.7 1.5 1.5S3.8 4.5 3 4.5 1.5 3.8 1.5 3 2.2 1.5 3 1.5M3 0C1.3 0 0 1.3 0 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"></path>
|
231 |
+
</svg>
|
232 |
+
<svg class="epsilon-toggle__on" width="2" height="6" aria-hidden="true"
|
233 |
+
role="img" focusable="false" viewBox="0 0 2 6">
|
234 |
+
<path d="M0 0h2v6H0z"></path>
|
235 |
+
</svg>
|
236 |
+
</div>
|
237 |
+
</div>
|
238 |
+
<?php echo $taxonomy->label ?></label><br>
|
239 |
<?php
|
240 |
}
|
241 |
?>
|
simple-custom-post-order.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Simple Custom Post Order
|
4 |
* Plugin URI: https://wordpress.org/plugins-wp/simple-custom-post-order/
|
5 |
* Description: Order Items (Posts, Pages, and Custom Post Types) using a Drag and Drop Sortable JavaScript.
|
6 |
-
* Version: 2.4.
|
7 |
* Author: Colorlib
|
8 |
* Author URI: https://colorlib.com/
|
9 |
* Tested up to: 5.1
|
@@ -36,7 +36,7 @@
|
|
36 |
|
37 |
define('SCPORDER_URL', plugins_url('', __FILE__));
|
38 |
define('SCPORDER_DIR', plugin_dir_path(__FILE__));
|
39 |
-
define('SCPORDER_VERSION', '2.4.
|
40 |
|
41 |
$scporder = new SCPO_Engine();
|
42 |
|
@@ -590,4 +590,4 @@ function scporder_uninstall_db() {
|
|
590 |
delete_option('scporder_install');
|
591 |
}
|
592 |
|
593 |
-
|
3 |
* Plugin Name: Simple Custom Post Order
|
4 |
* Plugin URI: https://wordpress.org/plugins-wp/simple-custom-post-order/
|
5 |
* Description: Order Items (Posts, Pages, and Custom Post Types) using a Drag and Drop Sortable JavaScript.
|
6 |
+
* Version: 2.4.3
|
7 |
* Author: Colorlib
|
8 |
* Author URI: https://colorlib.com/
|
9 |
* Tested up to: 5.1
|
36 |
|
37 |
define('SCPORDER_URL', plugins_url('', __FILE__));
|
38 |
define('SCPORDER_DIR', plugin_dir_path(__FILE__));
|
39 |
+
define('SCPORDER_VERSION', '2.4.3');
|
40 |
|
41 |
$scporder = new SCPO_Engine();
|
42 |
|
590 |
delete_option('scporder_install');
|
591 |
}
|
592 |
|
593 |
+
require_once 'class-colorlib-dashboard-widget-extend-feed.php';
|