Version Description
Download this release
Release Info
Developer | wponlinesupport |
Plugin | WP News and Scrolling Widgets |
Version | 4.4 |
Comparing to | |
See all releases |
Code changes from version 4.2 to 4.4
- admin/settings/premium.php +0 -178
- admin/wpnw-how-it-work.php +0 -298
- assets/css/blocks.editor.build.css +1 -0
- assets/css/sp-news-admin.css +14 -0
- assets/css/{stylenews.css → sp-news-public.css} +19 -17
- assets/js/blocks.build.js +1 -0
- assets/js/elementor/wpnw-elementor.js +12 -0
- assets/js/jcarousellite.js +0 -1
- assets/js/jquery.newstape.js +276 -9
- assets/js/sp-news-admin.js +16 -0
- assets/js/sp-news-public.js +25 -13
- {admin → includes/admin}/class-wpnw-admin.php +19 -3
- {admin → includes/admin}/settings/hire-us.php +33 -37
- includes/admin/settings/premium.php +187 -0
- includes/admin/supports/gutenberg-block.php +144 -0
- includes/admin/wpnw-how-it-work.php +271 -0
- includes/class-wpnw-script.php +123 -0
- includes/functions.php +130 -0
- includes/shortcode/sp-news-shortcode.php +205 -0
- includes/sp-news-post-type.php +20 -28
- includes/sp-news-shortcode.php +0 -214
- includes/widgets/class-wpnw-latest-news-widget.php +221 -0
- includes/widgets/class-wpnw-news-scrolling-widget.php +250 -0
- includes/widgets/class-wpnw-news-thumbnail-widget.php +221 -0
- includes/widgets/wpnw-widgets.php +26 -0
- languages/sp-news-and-widget-en_US-wpnw-block-js.json +1 -0
- languages/sp-news-and-widget.pot +376 -0
- readme.txt +96 -77
- sp-news-and-widget.php +130 -96
- widget_function.php +0 -543
- wpos-analytics/includes/class-anylc-admin.php +27 -44
- wpos-analytics/includes/class-anylc-script.php +4 -3
- wpos-analytics/includes/wpos-anylc-function.php +30 -12
- wpos-analytics/templates/analytic.php +3 -8
- wpos-analytics/templates/optout-popup.php +11 -2
- wpos-analytics/wpos-analytics.php +1 -1
admin/settings/premium.php
DELETED
@@ -1,178 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Premium Offer Page
|
4 |
-
*
|
5 |
-
* @package WP News and Scrolling Widgets
|
6 |
-
* @since 1.0.0
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( !defined( 'ABSPATH' ) ) {
|
10 |
-
exit; // Exit if accessed directly
|
11 |
-
}
|
12 |
-
?>
|
13 |
-
<div class="wrap">
|
14 |
-
|
15 |
-
<h2><?php _e( 'WP News and Scrolling Widgets - Features', 'sp-news-and-widget' ); ?></h2><br />
|
16 |
-
|
17 |
-
<style>
|
18 |
-
.wprps-notice{padding: 10px; color: #3c763d; background-color: #dff0d8; border:1px solid #d6e9c6; margin: 0 0 20px 0;}
|
19 |
-
.wpos-plugin-pricing-table thead th h2{font-weight: 400; font-size: 2.4em; line-height:normal; margin:0px; color: #2ECC71;}
|
20 |
-
.wpos-plugin-pricing-table thead th h2 + p{font-size: 1.25em; line-height: 1.4; color: #999; margin:5px 0 5px 0;}
|
21 |
-
|
22 |
-
table.wpos-plugin-pricing-table{width:90%; text-align: left; border-spacing: 0; border-collapse: collapse; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
|
23 |
-
|
24 |
-
.wpos-plugin-pricing-table th, .wpos-plugin-pricing-table td{font-size:14px; line-height:normal; color:#444; vertical-align:middle; padding:12px;}
|
25 |
-
|
26 |
-
.wpos-plugin-pricing-table colgroup:nth-child(1) { width: 31%; border: 0 none; }
|
27 |
-
.wpos-plugin-pricing-table colgroup:nth-child(2) { width: 22%; border: 1px solid #ccc; }
|
28 |
-
.wpos-plugin-pricing-table colgroup:nth-child(3) { width: 25%; border: 10px solid #2ECC71; }
|
29 |
-
|
30 |
-
/* Tablehead */
|
31 |
-
.wpos-plugin-pricing-table thead th {background-color: #fff; background:linear-gradient(to bottom, #ffffff 0%, #ffffff 100%); text-align: center; position: relative; border-bottom: 1px solid #ccc; padding: 1em 0 1em; font-weight:400; color:#999;}
|
32 |
-
.wpos-plugin-pricing-table thead th:nth-child(1) {background: transparent;}
|
33 |
-
.wpos-plugin-pricing-table thead th:nth-child(3) {padding:1em 2px 3.5em 2px; }
|
34 |
-
.wpos-plugin-pricing-table thead th:nth-child(3) p{color:#000;}
|
35 |
-
.wpos-plugin-pricing-table thead th p.promo {font-size: 14px; color: #fff; position: absolute; bottom:0; left: -17px; z-index: 1000; width: 100%; margin: 0; padding: .625em 17px .75em; background-color: #ca4a1f; box-shadow: 0 2px 4px rgba(0,0,0,.25); border-bottom: 1px solid #ca4a1f;}
|
36 |
-
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
|
37 |
-
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
|
38 |
-
|
39 |
-
/* Tablebody */
|
40 |
-
.wpos-plugin-pricing-table tbody th{background: #fff; border-left: 1px solid #ccc; font-weight: 600;}
|
41 |
-
.wpos-plugin-pricing-table tbody th span{font-weight: normal; font-size: 87.5%; color: #999; display: block;}
|
42 |
-
|
43 |
-
.wpos-plugin-pricing-table tbody td{background: #fff; text-align: center;}
|
44 |
-
.wpos-plugin-pricing-table tbody td .dashicons{height: auto; width: auto; font-size:30px;}
|
45 |
-
.wpos-plugin-pricing-table tbody td .dashicons-no-alt{color: #ca4a1f;}
|
46 |
-
.wpos-plugin-pricing-table tbody td .dashicons-yes{color: #2ECC71;}
|
47 |
-
|
48 |
-
.wpos-plugin-pricing-table tbody tr:nth-child(even) th,
|
49 |
-
.wpos-plugin-pricing-table tbody tr:nth-child(even) td { background: #f5f5f5; border: 1px solid #ccc; border-width: 1px 0 1px 1px; }
|
50 |
-
.wpos-plugin-pricing-table tbody tr:last-child td {border-bottom: 0 none;}
|
51 |
-
|
52 |
-
/* Table Footer */
|
53 |
-
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
|
54 |
-
.pricing-footer a{margin-bottom:5px;}
|
55 |
-
.wpos-plugin-pricing-table tfoot .wpos-button{font-weight: 600; color: #fff; text-decoration: none; border:0px; cursor:pointer; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #59c7fb; border-radius: .2em;}
|
56 |
-
</style>
|
57 |
-
|
58 |
-
<table class="wpos-plugin-pricing-table">
|
59 |
-
<colgroup></colgroup>
|
60 |
-
<colgroup></colgroup>
|
61 |
-
<colgroup></colgroup>
|
62 |
-
<thead>
|
63 |
-
<tr>
|
64 |
-
<th></th>
|
65 |
-
<th>
|
66 |
-
<h2>Free</h2>
|
67 |
-
<p>$0 USD</p>
|
68 |
-
</th>
|
69 |
-
<th>
|
70 |
-
<h2>Premium</h2>
|
71 |
-
<p>Gain access to <strong>WP News and Scrolling Widgets</strong> and <strong>all other products</strong> with a single purchase.</p>
|
72 |
-
<p class="promo">Our most valuable package!</p>
|
73 |
-
</th>
|
74 |
-
</tr>
|
75 |
-
</thead>
|
76 |
-
|
77 |
-
<tfoot>
|
78 |
-
<tr>
|
79 |
-
<th></th>
|
80 |
-
<td></td>
|
81 |
-
<td><p>Gain access to <strong>WP News and Scrolling Widgets</strong> and <strong>all other products</strong> with a single purchase.</p>
|
82 |
-
<a href="https://www.wponlinesupport.com/pricing/?ref=WposPratik" class="wpos-button" target="_blank">View Pricing Options</a></td>
|
83 |
-
</tr>
|
84 |
-
</tfoot>
|
85 |
-
<tbody>
|
86 |
-
<tr>
|
87 |
-
<th>Designs <span class="subtext">Designs that make your website better</span></th>
|
88 |
-
<td>2</td>
|
89 |
-
<td>120+</td>
|
90 |
-
</tr>
|
91 |
-
<tr>
|
92 |
-
<th>Shortcodes <span class="subtext">Shortcode provide output to the front-end side</span></th>
|
93 |
-
<td>1 (Grid, List)</td>
|
94 |
-
<td>6 (Grid, Slider, Carousel, List, Gridbox, GridBox Slider, News Ticke )</td>
|
95 |
-
</tr>
|
96 |
-
<tr>
|
97 |
-
<th>Shortcode Parameters <span class="subtext">Add extra power to the shortcode</span></th>
|
98 |
-
<td>9</td>
|
99 |
-
<td>30+</td>
|
100 |
-
</tr>
|
101 |
-
<tr>
|
102 |
-
<th>Shortcode Generator <span class="subtext">Play with all shortcode parameters with preview panel. No documentation required!!</span></th>
|
103 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
104 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
105 |
-
</tr>
|
106 |
-
<tr>
|
107 |
-
<th>WP Templating Features <span class="subtext">You can modify plugin html/designs in your current theme.</span></th>
|
108 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
109 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
110 |
-
</tr>
|
111 |
-
<tr>
|
112 |
-
<th>Widgets<span class="subtext"> WordPress Widgets to your sidebars.</span></th>
|
113 |
-
<td>2</td>
|
114 |
-
<td>7</td>
|
115 |
-
</tr>
|
116 |
-
<tr>
|
117 |
-
<th>Drag & Drop Post Order Change <span class="subtext">Arrange your desired post with your desired order and display</span></th>
|
118 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
119 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
120 |
-
</tr>
|
121 |
-
<tr>
|
122 |
-
<th>WPBakery Page Builder Supports <span class="subtext">Use this plugin with WPBakery Page Builder easily</span></th>
|
123 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
124 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
125 |
-
</tr>
|
126 |
-
<tr>
|
127 |
-
<th>Custom Read More link for Post <span class="subtext">Redirect post to third party destination if any</span></th>
|
128 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
129 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
130 |
-
</tr>
|
131 |
-
<tr>
|
132 |
-
<th>Publicize <span class="subtext"> Support with Jetpack to publish your News post on</span></th>
|
133 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
134 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
135 |
-
</tr>
|
136 |
-
<tr>
|
137 |
-
<th>Display Desired Post <span class="subtext">Display only the post you want</span></th>
|
138 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
139 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
140 |
-
</tr>
|
141 |
-
<tr>
|
142 |
-
<th>Display Post for Particular Categories <span class="subtext">Display only the posts with particular category</span></th>
|
143 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
144 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
145 |
-
</tr>
|
146 |
-
<tr>
|
147 |
-
<th>Exclude Some Posts <span class="subtext">Do not display the posts you want</span></th>
|
148 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
149 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
150 |
-
</tr>
|
151 |
-
<tr>
|
152 |
-
<th>Exclude Some Categories <span class="subtext">Do not display the posts for particular categories</span></th>
|
153 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
154 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
155 |
-
</tr>
|
156 |
-
<tr>
|
157 |
-
<th>Post Order / Order By Parameters <span class="subtext">Display post according to date, title and etc</span></th>
|
158 |
-
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
159 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
160 |
-
</tr>
|
161 |
-
<tr>
|
162 |
-
<th>Multiple Slider Parameters <span class="subtext">Slider parameters like autoplay, number of slide, sider dots and etc.</span></th>
|
163 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
164 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
165 |
-
</tr>
|
166 |
-
<tr>
|
167 |
-
<th>Slider RTL Support <span class="subtext">Slider supports for RTL website</span></th>
|
168 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
169 |
-
<td><i class="dashicons dashicons-yes"> </i></td>
|
170 |
-
</tr>
|
171 |
-
<tr>
|
172 |
-
<th>Support <span class="subtext">Get support for plugin</span></th>
|
173 |
-
<td>Limited</td>
|
174 |
-
<td>1 Year</td>
|
175 |
-
</tr>
|
176 |
-
</tbody>
|
177 |
-
</table>
|
178 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/wpnw-how-it-work.php
DELETED
@@ -1,298 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Pro Designs and Plugins Feed
|
4 |
-
*
|
5 |
-
* @package WP News and Scrolling Widgets
|
6 |
-
* @since 1.0.0
|
7 |
-
*/
|
8 |
-
|
9 |
-
// Exit if accessed directly
|
10 |
-
if ( !defined( 'ABSPATH' ) ) exit;
|
11 |
-
|
12 |
-
// Action to add menu
|
13 |
-
add_action('admin_menu', 'wpnw_register_design_page');
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Register plugin design page in admin menu
|
17 |
-
*
|
18 |
-
* @package WP News and Scrolling Widgets
|
19 |
-
* @since 1.0.0
|
20 |
-
*/
|
21 |
-
function wpnw_register_design_page() {
|
22 |
-
add_submenu_page( 'edit.php?post_type='.WPNW_POST_TYPE, __('How it works - WP News and Scrolling Widgets', 'sp-news-and-widget'), __('How It Works', 'sp-news-and-widget'), 'edit_posts', 'wpnw-designs', 'wpnw_designs_page' );
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* Function to display plugin design HTML
|
27 |
-
*
|
28 |
-
* @package WP News and Scrolling Widgets
|
29 |
-
* @since 1.0.0
|
30 |
-
*/
|
31 |
-
function wpnw_designs_page() {
|
32 |
-
|
33 |
-
$wpos_feed_tabs = wpnw_help_tabs();
|
34 |
-
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'how-it-work';
|
35 |
-
?>
|
36 |
-
|
37 |
-
<div class="wrap wpnwm-wrap">
|
38 |
-
|
39 |
-
<h2 class="nav-tab-wrapper">
|
40 |
-
<?php
|
41 |
-
foreach ($wpos_feed_tabs as $tab_key => $tab_val) {
|
42 |
-
$tab_name = $tab_val['name'];
|
43 |
-
$active_cls = ($tab_key == $active_tab) ? 'nav-tab-active' : '';
|
44 |
-
$tab_link = add_query_arg( array( 'post_type' => WPNW_POST_TYPE, 'page' => 'wpnw-designs', 'tab' => $tab_key), admin_url('edit.php') );
|
45 |
-
?>
|
46 |
-
|
47 |
-
<a class="nav-tab <?php echo $active_cls; ?>" href="<?php echo $tab_link; ?>"><?php echo $tab_name; ?></a>
|
48 |
-
|
49 |
-
<?php } ?>
|
50 |
-
</h2>
|
51 |
-
|
52 |
-
<div class="wpnwm-tab-cnt-wrp">
|
53 |
-
<?php
|
54 |
-
if( isset($active_tab) && $active_tab == 'how-it-work' ) {
|
55 |
-
wpnw_howitwork_page();
|
56 |
-
}
|
57 |
-
else if( isset($active_tab) && $active_tab == 'plugins-feed' ) {
|
58 |
-
echo wpnw_get_plugin_design( 'plugins-feed' );
|
59 |
-
} else {
|
60 |
-
echo wpnw_get_plugin_design( 'offers-feed' );
|
61 |
-
}
|
62 |
-
?>
|
63 |
-
</div><!-- end .wpnwm-tab-cnt-wrp -->
|
64 |
-
|
65 |
-
</div><!-- end .wpnwm-wrap -->
|
66 |
-
|
67 |
-
<?php
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Gets the plugin design part feed
|
72 |
-
*
|
73 |
-
* @package WP News and Scrolling Widgets
|
74 |
-
* @since 1.0.0
|
75 |
-
*/
|
76 |
-
function wpnw_get_plugin_design( $feed_type = '' ) {
|
77 |
-
|
78 |
-
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : '';
|
79 |
-
|
80 |
-
// If tab is not set then return
|
81 |
-
if( empty($active_tab) ) {
|
82 |
-
return false;
|
83 |
-
}
|
84 |
-
|
85 |
-
// Taking some variables
|
86 |
-
$wpos_feed_tabs = wpnw_help_tabs();
|
87 |
-
$transient_key = isset($wpos_feed_tabs[$active_tab]['transient_key']) ? $wpos_feed_tabs[$active_tab]['transient_key'] : 'wpnwm_' . $active_tab;
|
88 |
-
$url = isset($wpos_feed_tabs[$active_tab]['url']) ? $wpos_feed_tabs[$active_tab]['url'] : '';
|
89 |
-
$transient_time = isset($wpos_feed_tabs[$active_tab]['transient_time']) ? $wpos_feed_tabs[$active_tab]['transient_time'] : 172800;
|
90 |
-
$cache = get_transient( $transient_key );
|
91 |
-
|
92 |
-
if ( false === $cache ) {
|
93 |
-
|
94 |
-
$feed = wp_remote_get( esc_url_raw( $url ), array( 'timeout' => 120, 'sslverify' => false ) );
|
95 |
-
$response_code = wp_remote_retrieve_response_code( $feed );
|
96 |
-
|
97 |
-
if ( ! is_wp_error( $feed ) && $response_code == 200 ) {
|
98 |
-
if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
|
99 |
-
$cache = wp_remote_retrieve_body( $feed );
|
100 |
-
set_transient( $transient_key, $cache, $transient_time );
|
101 |
-
}
|
102 |
-
} else {
|
103 |
-
$cache = '<div class="error"><p>' . __( 'There was an error retrieving the data from the server. Please try again later.', 'sp-news-and-widget' ) . '</div>';
|
104 |
-
}
|
105 |
-
}
|
106 |
-
return $cache;
|
107 |
-
}
|
108 |
-
|
109 |
-
/**
|
110 |
-
* Function to get plugin feed tabs
|
111 |
-
*
|
112 |
-
* @package WP News and Scrolling Widgets
|
113 |
-
* @since 1.0.0
|
114 |
-
*/
|
115 |
-
function wpnw_help_tabs() {
|
116 |
-
$wpos_feed_tabs = array(
|
117 |
-
'how-it-work' => array(
|
118 |
-
'name' => __('How It Works', 'sp-news-and-widget'),
|
119 |
-
),
|
120 |
-
'plugins-feed' => array(
|
121 |
-
'name' => __('Our Plugins', 'sp-news-and-widget'),
|
122 |
-
'url' => 'http://wponlinesupport.com/plugin-data-api/plugins-data.php',
|
123 |
-
'transient_key' => 'wpos_plugins_feed',
|
124 |
-
'transient_time' => 172800
|
125 |
-
),
|
126 |
-
'offers-feed' => array(
|
127 |
-
'name' => __('WPOS Offers', 'sp-news-and-widget'),
|
128 |
-
'url' => 'http://wponlinesupport.com/plugin-data-api/wpos-offers.php',
|
129 |
-
'transient_key' => 'wpos_offers_feed',
|
130 |
-
'transient_time' => 86400,
|
131 |
-
)
|
132 |
-
);
|
133 |
-
return $wpos_feed_tabs;
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* Function to get 'How It Works' HTML
|
138 |
-
*
|
139 |
-
* @package WP News and Scrolling Widgets
|
140 |
-
* @since 1.0.0
|
141 |
-
*/
|
142 |
-
function wpnw_howitwork_page() { ?>
|
143 |
-
|
144 |
-
<style type="text/css">
|
145 |
-
.wpos-pro-box .hndle{background-color:#0073AA; color:#fff;}
|
146 |
-
.wpos-pro-box .postbox{background:#dbf0fa none repeat scroll 0 0; border:1px solid #0073aa; color:#191e23;}
|
147 |
-
.postbox-container .wpos-list li:before{font-family: dashicons; content: "\f139"; font-size:20px; color: #0073aa; vertical-align: middle;}
|
148 |
-
.wpnwm-wrap .wpos-button-full{display:block; text-align:center; box-shadow:none; border-radius:0;}
|
149 |
-
.wpnwm-shortcode-preview{background-color: #e7e7e7; font-weight: bold; padding: 2px 5px; display: inline-block; margin:0 0 2px 0;}
|
150 |
-
</style>
|
151 |
-
|
152 |
-
<div class="post-box-container">
|
153 |
-
<div id="poststuff">
|
154 |
-
<div id="post-body" class="metabox-holder columns-2">
|
155 |
-
|
156 |
-
<!--How it workd HTML -->
|
157 |
-
<div id="post-body-content">
|
158 |
-
<div class="metabox-holder">
|
159 |
-
<div class="meta-box-sortables ui-sortable">
|
160 |
-
<div class="postbox">
|
161 |
-
|
162 |
-
<h3 class="hndle">
|
163 |
-
<span><?php _e( 'How It Works - Display and Shortcode', 'sp-news-and-widget' ); ?></span>
|
164 |
-
</h3>
|
165 |
-
|
166 |
-
<div class="inside">
|
167 |
-
<table class="form-table">
|
168 |
-
<tbody>
|
169 |
-
<tr>
|
170 |
-
<th>
|
171 |
-
<label><?php _e('Geeting Started', 'sp-news-and-widget'); ?></label>
|
172 |
-
</th>
|
173 |
-
<td>
|
174 |
-
<ul>
|
175 |
-
<li><?php _e('Step-1: This plugin create a News menu tab in WordPress menu with custom post type.".', 'sp-news-and-widget'); ?></li>
|
176 |
-
<li><?php _e('Step-2: Go to "News > Add news item tab".', 'sp-news-and-widget'); ?></li>
|
177 |
-
<li><?php _e('Step-3: Add news title, description, category, and image as featured image.', 'sp-news-and-widget'); ?></li>
|
178 |
-
<li><?php _e('Step-4: Repeat this process and add multiple news item.', 'sp-news-and-widget'); ?></li>
|
179 |
-
<li><?php _e('Step-4: To display news category wise you can use category shortcode under "News > News category"', 'sp-news-and-widget'); ?></li>
|
180 |
-
</ul>
|
181 |
-
</td>
|
182 |
-
</tr>
|
183 |
-
|
184 |
-
<tr>
|
185 |
-
<th>
|
186 |
-
<label><?php _e('How Shortcode Works', 'sp-news-and-widget'); ?></label>
|
187 |
-
</th>
|
188 |
-
<td>
|
189 |
-
<ul>
|
190 |
-
<li><?php _e('Step-1. Create a page like Our News OR Latest News.', 'sp-news-and-widget'); ?></li>
|
191 |
-
<li><?php _e('<b>Please make sure that Permalink link should not be "/news" Otherwise all your news will go to archive page. You can give it other name like "/ournews, /latestnews etc"</b>', 'sp-news-and-widget'); ?></li>
|
192 |
-
<li><?php _e('Step-2. Put below shortcode as per your need.', 'sp-news-and-widget'); ?></li>
|
193 |
-
</ul>
|
194 |
-
</td>
|
195 |
-
</tr>
|
196 |
-
|
197 |
-
<tr>
|
198 |
-
<th>
|
199 |
-
<label><?php _e('All Shortcodes', 'sp-news-and-widget'); ?></label>
|
200 |
-
</th>
|
201 |
-
<td>
|
202 |
-
<span class="wpnwm-shortcode-preview">[sp_news grid="list"]</span> – <?php _e('News in List View', 'sp-news-and-widget'); ?> <br />
|
203 |
-
<span class="wpnwm-shortcode-preview">[sp_news grid="1"]</span> – <?php _e('Display News in grid 1', 'sp-news-and-widget'); ?> <br />
|
204 |
-
<span class="wpnwm-shortcode-preview">[sp_news grid="2"]</span> – <?php _e('Display News in grid 2', 'sp-news-and-widget'); ?> <br />
|
205 |
-
<span class="wpnwm-shortcode-preview">[sp_news grid="3"]</span> – <?php _e('Display News in grid 3', 'sp-news-and-widget'); ?>
|
206 |
-
</td>
|
207 |
-
</tr>
|
208 |
-
|
209 |
-
<tr>
|
210 |
-
<th>
|
211 |
-
<label><?php _e('Need Support?', 'sp-news-and-widget'); ?></label>
|
212 |
-
</th>
|
213 |
-
<td>
|
214 |
-
<p><?php _e('Check plugin document for shortcode parameters and demo for designs.', 'sp-news-and-widget'); ?></p> <br/>
|
215 |
-
<a class="button button-primary" href="http://docs.wponlinesupport.com/wp-news-and-scrolling-widgets/" target="_blank"><?php _e('Documentation', 'sp-news-and-widget'); ?></a>
|
216 |
-
<a class="button button-primary" href="http://demo.wponlinesupport.com/sp-news/" target="_blank"><?php _e('Demo for Designs', 'sp-news-and-widget'); ?></a>
|
217 |
-
</td>
|
218 |
-
</tr>
|
219 |
-
</tbody>
|
220 |
-
</table>
|
221 |
-
</div><!-- .inside -->
|
222 |
-
</div><!-- #general -->
|
223 |
-
</div><!-- .meta-box-sortables ui-sortable -->
|
224 |
-
</div><!-- .metabox-holder -->
|
225 |
-
</div><!-- #post-body-content -->
|
226 |
-
|
227 |
-
<!--Upgrad to Pro HTML -->
|
228 |
-
<div id="postbox-container-1" class="postbox-container">
|
229 |
-
<div class="metabox-holder wpos-pro-box">
|
230 |
-
<div class="meta-box-sortables ui-sortable">
|
231 |
-
<div class="postbox" style="">
|
232 |
-
|
233 |
-
<h3 class="hndle">
|
234 |
-
<span><?php _e( 'Upgrate to Pro', 'sp-news-and-widget' ); ?></span>
|
235 |
-
</h3>
|
236 |
-
<div class="inside">
|
237 |
-
<ul class="wpos-list">
|
238 |
-
<li>120+ stunning and cool designs</li>
|
239 |
-
<li>6 shortcodes</li>
|
240 |
-
<li>50 Designs for News Grid Layout.</li>
|
241 |
-
<li>45 Designs for News Slider/Carousel Layout.</li>
|
242 |
-
<li>8 Designs for News List View.</li>
|
243 |
-
<li>3 Designs News Grid Box.</li>
|
244 |
-
<li>8 Designs News Grid Box Slider.</li>
|
245 |
-
<li>Visual Composer Page Builder Support</li>
|
246 |
-
<li>News Ticker.</li>
|
247 |
-
<li>7 different types of Latest News widgets.</li>
|
248 |
-
<li>Recent News Slider</li>
|
249 |
-
<li>Recent News Carousel</li>
|
250 |
-
<li>Recent News in Grid view</li>
|
251 |
-
<li>Create a News Page OR News website</li>
|
252 |
-
<li>Custom Read More link for News Post</li>
|
253 |
-
<li>News display with categories</li>
|
254 |
-
<li>Drag & Drop feature to display News post in your desired order and other 6 types of order parameter</li>
|
255 |
-
<li>Publicize' support with Jetpack to publish your News post on your social network</li>
|
256 |
-
<li>Custom CSS</li>
|
257 |
-
<li>100% Multi language</li>
|
258 |
-
</ul>
|
259 |
-
<a class="button button-primary wpos-button-full" href="https://www.wponlinesupport.com/wp-plugin/sp-news-and-scrolling-widgets/" target="_blank"><?php _e('Go Premium ', 'sp-news-and-widget'); ?></a>
|
260 |
-
<p><a class="button button-primary wpos-button-full" href="http://demo.wponlinesupport.com/prodemo/news-plugin-pro/" target="_blank"><?php _e('View PRO Demo ', 'sp-news-and-widget'); ?></a> </p>
|
261 |
-
</div><!-- .inside -->
|
262 |
-
</div><!-- #general -->
|
263 |
-
</div><!-- .meta-box-sortables ui-sortable -->
|
264 |
-
</div><!-- .metabox-holder -->
|
265 |
-
|
266 |
-
<div class="metabox-holder wpos-pro-box">
|
267 |
-
<div class="meta-box-sortables ui-sortable">
|
268 |
-
<div class="postbox">
|
269 |
-
<h3 class="hndle">
|
270 |
-
<span><?php _e('Need PRO Support?', 'sp-news-and-widget'); ?></span>
|
271 |
-
</h3>
|
272 |
-
<div class="inside">
|
273 |
-
<p><?php _e('Hire our experts for WordPress website support.', 'sp-news-and-widget'); ?></p>
|
274 |
-
<p><a class="button button-primary wpos-button-full" href="https://www.wponlinesupport.com/projobs-support/" target="_blank"><?php _e('PRO Support', 'sp-news-and-widget'); ?></a></p>
|
275 |
-
</div><!-- .inside -->
|
276 |
-
</div><!-- #general -->
|
277 |
-
</div><!-- .meta-box-sortables ui-sortable -->
|
278 |
-
</div><!-- .metabox-holder -->
|
279 |
-
|
280 |
-
<!-- Help to improve this plugin! -->
|
281 |
-
<div class="metabox-holder">
|
282 |
-
<div class="meta-box-sortables ui-sortable">
|
283 |
-
<div class="postbox">
|
284 |
-
<h3 class="hndle">
|
285 |
-
<span><?php _e( 'Help to improve this plugin!', 'sp-news-and-widget' ); ?></span>
|
286 |
-
</h3>
|
287 |
-
<div class="inside">
|
288 |
-
<p>Enjoyed this plugin? You can help by rate this plugin <a href="https://wordpress.org/support/plugin/sp-news-and-widget/reviews/" target="_blank">5 stars!</a></p>
|
289 |
-
</div><!-- .inside -->
|
290 |
-
</div><!-- #general -->
|
291 |
-
</div><!-- .meta-box-sortables ui-sortable -->
|
292 |
-
</div><!-- .metabox-holder -->
|
293 |
-
</div><!-- #post-container-1 -->
|
294 |
-
|
295 |
-
</div><!-- #post-body -->
|
296 |
-
</div><!-- #poststuff -->
|
297 |
-
</div><!-- #post-box-container -->
|
298 |
-
<?php }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/blocks.editor.build.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.wpos-guten-shrt{border:1px solid #ccc;padding:8px;line-height:22px;background-color:#eee;font-size:13px;text-align:center;color:#32373c;font-family:arial, sans-serif}.wpos-guten-shrt-title span{border-bottom:2px solid #32373c;margin-bottom:10px;display:inline-block;font-size:16px;font-weight:600}.wpos-guten-shrt .wpos-guten-shrt-footer{margin:10px 0 0 0}.wpos-guten-shrt .wpos-guten-shrt-footer span{display:block;border-top:2px solid #ccc;width:50px;margin:5px auto}.components-disabled{opacity:0.5}.components-disabled .wpos-hidden-opts-desc a{pointer-events:auto}
|
assets/css/sp-news-admin.css
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Widget CSS for Page Builder */
|
2 |
+
.wpnw-widget-wrap hr{margin: 7px 0 !important;}
|
3 |
+
.wpnw-widget-wrap p{margin: 10px 0;}
|
4 |
+
.wpnw-widget-wrap p em{font-size: 12px; display: block;}
|
5 |
+
.wpnw-widget-wrap p em span,
|
6 |
+
.wpnw-widget-wrap p em label{cursor: pointer; font-weight: bold;}
|
7 |
+
.so-content .wpnw-widget-wrap p label,
|
8 |
+
.fl-builder-settings-fields .wpnw-widget-wrap p label{font-weight: 500; width: 100%; vertical-align: middle;}
|
9 |
+
.so-content .wpnw-widget-wrap p input,
|
10 |
+
.so-content .wpnw-widget-wrap p select,
|
11 |
+
.fl-builder-settings-fields .wpnw-widget-wrap p input,
|
12 |
+
.fl-builder-settings-fields .wpnw-widget-wrap p select{width: 100%; max-width: 100%; margin: 5px 0 8px 0 !important;}
|
13 |
+
.so-content .wpnw-widget-wrap p input[type="checkbox"],
|
14 |
+
.fl-builder-settings-fields .wpnw-widget-wrap p input[type="checkbox"]{width: auto; vertical-align: middle;}
|
assets/css/{stylenews.css → sp-news-public.css}
RENAMED
@@ -1,6 +1,6 @@
|
|
|
|
1 |
.news-clearfix:before, .news-clearfix:after{content: "";display: table;}
|
2 |
.news-clearfix::after{clear: both;}
|
3 |
-
.wpnawfree-plugin{margin:0 -15px !important;}
|
4 |
.news-col-3, .news-col-4, .news-col-2{margin-bottom:30px;}
|
5 |
.news-col-3, .news-col-4, .news-col-2, .news-col-1, .news-col-list{-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
|
6 |
.news-col-1 .news-inner-wrap-view, .news-col-list .news-inner-wrap-view{ border-bottom:1px solid #d1d1d1; padding-bottom:20px; margin-bottom:20px;}
|
@@ -53,42 +53,44 @@
|
|
53 |
.news_thumb_left a{display:block; margin-right:10px;}
|
54 |
.news_thumb_left img{height: 100% !important;width: 100% !important;object-fit: cover;object-position: top center; }
|
55 |
.news_thumb_right{display:table-cell; vertical-align:top; }
|
56 |
-
.news_pagination{clear:both; margin:20px 0px 10px 0px; float:left; width:100%;text-align: center;}
|
57 |
-
.news_pagination .button-news-p{width:40%; float:right; text-align:right;}
|
58 |
-
.news_pagination .button-news-n{width:40%; float:left; text-align:left;}
|
59 |
-
.page-numbers.current{background:#f4f4f4; padding: 7px 10px; border:1px solid #f1f1f1}
|
60 |
-
.news_pagination a,
|
61 |
-
.news_pagination a{color: #fff !important;background: #333; border-radius:2px; -webkit-transition: all .3s;transition: all .3s;padding: 7px 10px;display: inline-block;text-align: center;line-height: normal;box-shadow: none;text-shadow: none;font-size: 14px;text-transform: uppercase;border: 1px solid #333;text-decoration: none !important;}
|
62 |
-
.news_pagination a:hover,
|
63 |
-
.news_pagination a:focus,
|
64 |
-
.news_pagination a:hover,
|
65 |
-
.news_pagination a:focus{color: #333 !important;background: transparent;}
|
66 |
.recent-news-items{clear:both;}
|
67 |
.recent-news-items.no_p h6{margin:5px 0 !important;}
|
68 |
.recent-news-items p{font-size:13px !important; margin-bottom:10px !important}
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
.news-col-1.has-no-date .post-content-text{margin-left:0px; width:100%;}
|
71 |
.news-more-link{padding:5px 15px; background:#555; color:#fff; border-radius:2px; display:inline-block; clear:both; text-decoration:none !important; -webkit-transition: all .3s;transition: all .3s;}
|
72 |
.news-more-link:hover{background:#f1f1f1; color:#555}
|
73 |
|
74 |
.widget ul li.news_li::before{content:none !important}
|
75 |
.type-news:last-child .news-inner-wrap-view{border:0px; padding:0px; margin:0px;}
|
|
|
|
|
76 |
@media all and (max-width: 768px) {
|
77 |
-
.news-col-3, .news-col-4{width:50%;}
|
78 |
-
.news.wpnaw-first{clear: none !important;}
|
79 |
}
|
80 |
|
81 |
@media all and (max-width: 640px) {
|
82 |
-
.news-col-3, .news-col-2, .news-col-4{width:100%;}
|
83 |
-
.news-col-list .news-thumb{margin-bottom:15px;}
|
84 |
}
|
85 |
|
86 |
@media all and (max-width: 500px) {
|
87 |
-
|
88 |
.news-col-list .news-thumb{float:left; width:100%;}
|
89 |
.news-col-list .news-content{float:left; margin-left:0% ; width:100%; clear:both; }
|
90 |
.news-col-1 .grid-news-thumb{height:250px}
|
91 |
-
|
92 |
|
93 |
@media all and (max-width: 400px) {
|
94 |
.news-col-1 .grid-news-thumb{height:200px}
|
1 |
+
/* General CSS */
|
2 |
.news-clearfix:before, .news-clearfix:after{content: "";display: table;}
|
3 |
.news-clearfix::after{clear: both;}
|
|
|
4 |
.news-col-3, .news-col-4, .news-col-2{margin-bottom:30px;}
|
5 |
.news-col-3, .news-col-4, .news-col-2, .news-col-1, .news-col-list{-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }
|
6 |
.news-col-1 .news-inner-wrap-view, .news-col-list .news-inner-wrap-view{ border-bottom:1px solid #d1d1d1; padding-bottom:20px; margin-bottom:20px;}
|
53 |
.news_thumb_left a{display:block; margin-right:10px;}
|
54 |
.news_thumb_left img{height: 100% !important;width: 100% !important;object-fit: cover;object-position: top center; }
|
55 |
.news_thumb_right{display:table-cell; vertical-align:top; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
.recent-news-items{clear:both;}
|
57 |
.recent-news-items.no_p h6{margin:5px 0 !important;}
|
58 |
.recent-news-items p{font-size:13px !important; margin-bottom:10px !important}
|
59 |
|
60 |
+
/* Pagination CSS Start */
|
61 |
+
.news_pagination {width:100%; padding:10px 0.9375em 10px 0.9375em; text-align:center; color:#666; clear:both;}
|
62 |
+
.news_pagination a {color: #fff !important; background: #666; padding: 7px 10px; margin:0 1px 6px 2px; display: inline-block; text-align: center; line-height: normal; box-shadow: none; text-shadow: none; font-size: 14px; border: 1px solid #666; text-decoration: none !important; -webkit-transition: all .3s ease; transition: all .3s ease; outline:0;}
|
63 |
+
.news_pagination .page-numbers.current {color: #666; background: transparent; padding: 7px 10px; margin:0 1px 6px 2px; display: inline-block; text-align: center; line-height: normal; box-shadow: none; text-shadow: none; font-size: 14px; text-transform: uppercase; border: 1px solid #666; text-decoration: none !important;}
|
64 |
+
.news_pagination a:hover, .news_pagination a:focus, .news_pagination a:visited:hover {color: #666 !important; background: #fff; outline:0;}
|
65 |
+
.news_pagination a.prev, .news_pagination a.next {min-width:90px;}
|
66 |
+
.news_pagination .button-news-p{float:right;}
|
67 |
+
.news_pagination .button-news-n{float:left;}
|
68 |
+
.news_pagination .wpnw-pagi-btn a {min-width:90px;}
|
69 |
+
/* Pagination CSS End */
|
70 |
+
|
71 |
.news-col-1.has-no-date .post-content-text{margin-left:0px; width:100%;}
|
72 |
.news-more-link{padding:5px 15px; background:#555; color:#fff; border-radius:2px; display:inline-block; clear:both; text-decoration:none !important; -webkit-transition: all .3s;transition: all .3s;}
|
73 |
.news-more-link:hover{background:#f1f1f1; color:#555}
|
74 |
|
75 |
.widget ul li.news_li::before{content:none !important}
|
76 |
.type-news:last-child .news-inner-wrap-view{border:0px; padding:0px; margin:0px;}
|
77 |
+
|
78 |
+
/* Responsive CSS */
|
79 |
@media all and (max-width: 768px) {
|
80 |
+
.news-col-3, .news-col-4{width:50%;}
|
81 |
+
.news.wpnaw-first{clear: none !important;}
|
82 |
}
|
83 |
|
84 |
@media all and (max-width: 640px) {
|
85 |
+
.news-col-3, .news-col-2, .news-col-4{width:100%;}
|
86 |
+
.news-col-list .news-thumb{margin-bottom:15px;}
|
87 |
}
|
88 |
|
89 |
@media all and (max-width: 500px) {
|
|
|
90 |
.news-col-list .news-thumb{float:left; width:100%;}
|
91 |
.news-col-list .news-content{float:left; margin-left:0% ; width:100%; clear:both; }
|
92 |
.news-col-1 .grid-news-thumb{height:250px}
|
93 |
+
}
|
94 |
|
95 |
@media all and (max-width: 400px) {
|
96 |
.news-col-1 .grid-news-thumb{height:200px}
|
assets/js/blocks.build.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(e){function t(a){if(n[a])return n[a].exports;var l=n[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,t),l.l=!0,l.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var a=n(2),l=(n.n(a),n(3)),s=(n.n(l),n(4)),__=wp.i18n.__;(0,wp.blocks.registerBlockType)("wpnw/sp-news",{title:__("News Grid","sp-news-and-widget"),description:__("Display news post in a grid view with various layouts.","sp-news-and-widget"),icon:"feedback",category:"wpos_guten_block",keywords:[__("wpos"),__("sp news","sp-news-and-widget"),__("sp-news")],supports:{html:!1,multiple:!0},getEditWrapperProps:function(e){var t=e.align;if(["wide","full"].includes(t))return{"data-align":t,"data-block-type":"wpnw-grid"}},edit:s.a,save:function(){return null}})},function(e,t){},function(e,t){},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function s(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=wp.element,o=r.Component,p=r.Fragment,d=wp.components,w=d.PanelBody,m=d.Disabled,c=d.TextControl,u=d.ToggleControl,g=d.RangeControl,h=d.SelectControl,__=wp.i18n.__,f=(wp.data.select,wp.editor),E=f.InspectorControls,b=f.BlockControls,v=f.BlockAlignmentToolbar,_=function(e){function t(){a(this,t);var e=l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.state={isLoading:!1},e}return s(t,e),i(t,[{key:"ObjToString",value:function(e){var t=wp.blocks.getBlockAttributes("wpnw/sp-news"),n=["content_tail"],a="";for(var l in e)e.hasOwnProperty(l)&&"undefined"!==typeof e[l]&&e[l]!==t[l]&&(""!=jQuery.trim(e[l])||jQuery.inArray(l,n)>=0)&&(a+=l+'="'+e[l]+'" ');return a}},{key:"GetBooleanDropdown",value:function(){return[{value:"true",label:__("True","sp-news-and-widget")},{value:"false",label:__("False","sp-news-and-widget")}]}},{key:"GetDesigns",value:function(){return[{value:"design-1",label:__("Design 1","sp-news-and-widget")}]}},{key:"Getgridcolumns",value:function(){return[{value:"1",label:__("Grid 1","sp-news-and-widget")},{value:"2",label:__("Grid 2","sp-news-and-widget")},{value:"3",label:__("Grid 3","sp-news-and-widget")},{value:"4",label:__("Grid 4","sp-news-and-widget")},{value:"list",label:__("List","sp-news-and-widget")}]}},{key:"GetPaginationType",value:function(){return[{value:"numeric",label:__("Numeric","sp-news-and-widget")},{value:"prev-next",label:__("Previous - Next","sp-news-and-widget")}]}},{key:"GetLinkTargetDropdown",value:function(){return[{value:"self",label:__("Same Window","sp-news-and-widget")}]}},{key:"GetPostOrderby",value:function(){return[{value:"date",label:__("Post Date","sp-news-and-widget")},{value:"modified",label:__("Post Modified Date","sp-news-and-widget")},{value:"title",label:__("Post Title","sp-news-and-widget")},{value:"name",label:__("Post Slug","sp-news-and-widget")},{value:"ID",label:__("Post ID","sp-news-and-widget")},{value:"rand",label:__("Random","sp-news-and-widget")}]}},{key:"GetPostOrder",value:function(){return[{value:"desc",label:__("Descending","sp-news-and-widget")},{value:"asc",label:__("Ascending","sp-news-and-widget")}]}},{key:"componentDidMount",value:function(){}},{key:"componentDidUpdate",value:function(e){var t=this.props.attributes.content_words_limit,n=wp.data.select("core/editor").getEditorSettings(),a=n.alignWide;e.attributes;(parseInt(t)<=0||isNaN(parseInt(t)))&&this.props.setAttributes({content_words_limit:20}),a||this.props.setAttributes({align:void 0})}},{key:"render",value:function(){var e=this.props,t=e.attributes,n=e.setAttributes,a=t.grid,l=t.show_date,s=t.show_category_name,i=t.show_content,r=t.show_full_content,o=t.content_words_limit,d=t.limit,f=t.orderby,_=t.order,k=t.category,y=t.pagination_type,P=t.align,C=(t.className,this.state.isLoading,wp.element.createElement(E,null,wp.element.createElement(w,{title:__("General Parameters","sp-news-and-widget")},wp.element.createElement(m,null,wp.element.createElement(h,{label:__("Design","sp-news-and-widget"),options:this.GetDesigns(),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Choose design. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("News Heading","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Enter news heading. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(h,{label:__("Number of Columns","sp-news-and-widget"),value:a,options:this.Getgridcolumns(),onChange:function(e){return n({grid:e})}}),wp.element.createElement(m,null,wp.element.createElement(u,{label:__("Show Author","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Display post author. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(u,{label:__("Show Date","sp-news-and-widget"),checked:!!l,onChange:function(){return n({show_date:!l})}}),wp.element.createElement(u,{label:__("Show Category Name","sp-news-and-widget"),checked:!!s,onChange:function(){return n({show_category_name:!s})}}),wp.element.createElement(u,{label:__("Show Content","sp-news-and-widget"),checked:!!i,onChange:function(){return n({show_content:!i})}}),i&&wp.element.createElement(u,{label:__("Show Full Content","sp-news-and-widget"),checked:!!r,onChange:function(){return n({show_full_content:!r})}}),i&&!r&&wp.element.createElement(g,{label:__("Content Words Limit","sp-news-and-widget"),value:o,onChange:function(e){return n({content_words_limit:e})},min:1,help:__("Enter content word limit.","sp-news-and-widget")}),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Content Tail","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Display dots after the post content as continue reading. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(h,{label:__("Read More","sp-news-and-widget"),options:this.GetBooleanDropdown(),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Display read more. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Read More Text","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Enter read more text. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(h,{label:__("Link Behavior","sp-news-and-widget"),options:this.GetLinkTargetDropdown(),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Choose link behaviour. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(g,{label:__("Image Height","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Control height of the featured image. You can enter any numeric number. e.g 500. Leave empty for default height. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Media Size","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Choose WordPress registered image size. e.g thumbnail, medium, large, full. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(h,{label:__("Image Fit","sp-news-and-widget"),options:this.GetBooleanDropdown(),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Fill the news image in a whole container. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))}))),wp.element.createElement(w,{title:__("Query Parameters","sp-news-and-widget"),initialOpen:!1},wp.element.createElement(g,{label:__("Limit","sp-news-and-widget"),value:d,onChange:function(e){return n({limit:e})},min:-1,help:__("Enter number of news post to be displayed. Enter -1 to display all.","sp-news-and-widget")}),wp.element.createElement(h,{label:__("Order By","sp-news-and-widget"),value:f,options:this.GetPostOrderby(),onChange:function(e){return n({orderby:e})}}),wp.element.createElement(h,{label:__("Order","sp-news-and-widget"),value:_,options:this.GetPostOrder(),onChange:function(e){return n({order:e})}}),wp.element.createElement(c,{label:__("Display Specific Category","sp-news-and-widget"),value:k,onChange:function(e){return n({category:e})},help:wp.element.createElement("span",{title:__("You can pass multiple ids with comma seperated. You can find id at relevant category listing page.","sp-news-and-widget")},__("Enter category id to display categories wise.","sp-news-and-widget")," [?]")}),wp.element.createElement(m,null,wp.element.createElement(h,{label:__("Disply Child Category","sp-news-and-widget"),options:this.GetBooleanDropdown(),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("If you are using parent category then whether to display child category or not. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Exclude Category","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Exclude post category. Works only if `Category` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant category listing page. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Display Specific Posts","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Enter id of the post which you want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Exclude Post","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Enter id of the post which you do not want to display. You can pass multiple ids with comma seperated. You can find id at relevant post listing page. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Include Author","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Enter author id to display posts of particular author. You can pass multiple ids with comma seperated. You can find id at users listing page. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(c,{label:__("Exclude Author","sp-news-and-widget"),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Enter author id to hide post of particular author. Works only if `Include Author` field is empty. You can pass multiple ids with comma seperated. You can find id at relevant users listing page. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(m,null,wp.element.createElement(h,{label:__("Pagination","sp-news-and-widget"),options:this.GetBooleanDropdown(),help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Display pagination. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})),wp.element.createElement(h,{label:__("Pagination Type","sp-news-and-widget"),value:y,options:this.GetPaginationType(),onChange:function(e){return n({pagination_type:e})}}),wp.element.createElement(m,null,wp.element.createElement(g,{label:__("Query Offset","sp-news-and-widget"),min:0,help:wp.element.createElement("div",{className:"wpos-hidden-opts-desc"},wp.element.createElement("span",null,__("Exclude number of posts from starting. e.g if you pass 5 then it will skip first five post. Note: This will not work with limit=-1. Upgarade to ","sp-news-and-widget"),wp.element.createElement("a",{href:Wpnwf_Block.pro_link,target:"_blank"},__("Premium version ","sp-news-and-widget")),__("to get this option.","sp-news-and-widget")))})))));return wp.element.createElement(p,null,C,wp.element.createElement(b,null,wp.element.createElement(v,{value:P,onChange:function(e){return n({align:e})},controls:["wide","full"]})),wp.element.createElement("div",{className:this.props.className},this.renderOutput()))}},{key:"renderOutput",value:function(){var e=this.props.attributes,t=this.ObjToString(e);t=t.trim();var n=t?"[sp_news "+t+"]":"[sp_news]";return wp.element.createElement("div",{class:"wpos-guten-shrt"},wp.element.createElement("div",{class:"wpos-guten-shrt-title"},wp.element.createElement("span",null,__("WP News and Scrolling Widgets - Grid","sp-news-and-widget"))),n,wp.element.createElement("div",{class:"wpos-guten-shrt-footer"},wp.element.createElement("span",null),__("Do you want to check demo of this plugin.","sp-news-and-widget")," ",wp.element.createElement("a",{href:Wpnwf_Block.free_demo_link,target:"_blank"},__("Click here","sp-news-and-widget"))),wp.element.createElement("div",{class:"wpos-guten-shrt-footer"},__("Do you also want to check premium version demo of this plugin.","sp-news-and-widget")," ",wp.element.createElement("a",{href:Wpnwf_Block.pro_demo_link,target:"_blank"},__("Click here","sp-news-and-widget"))))}}]),t}(o);t.a=_}]);
|
assets/js/elementor/wpnw-elementor.js
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
( function($) {
|
2 |
+
|
3 |
+
'use strict';
|
4 |
+
|
5 |
+
jQuery(window).on('elementor/frontend/init', function() {
|
6 |
+
|
7 |
+
/* Latest News vertical scrolling widget */
|
8 |
+
elementorFrontend.hooks.addAction( 'frontend/element_ready/wp-widget-sp_news_s_widget.default', function() {
|
9 |
+
news_scrolling_slider_init();
|
10 |
+
});
|
11 |
+
});
|
12 |
+
})(jQuery);
|
assets/js/jcarousellite.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
/*!
|
|
assets/js/jquery.newstape.js
CHANGED
@@ -1,12 +1,279 @@
|
|
|
|
|
|
1 |
|
2 |
-
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Vertical News Ticker 1.21
|
3 |
|
4 |
+
Original by: Tadas Juozapaitis ( kasp3rito [eta] gmail (dot) com )
|
5 |
+
https://github.com/kasp3r/vTicker
|
6 |
|
7 |
+
Forked/Modified by: Richard Hollis @richhollis - richhollis.co.uk
|
8 |
+
*/
|
9 |
+
(function($) {
|
10 |
+
var defaults, internal, methods;
|
11 |
+
defaults = {
|
12 |
+
speed: 700,
|
13 |
+
pause: 4000,
|
14 |
+
showItems: 1,
|
15 |
+
mousePause: true,
|
16 |
+
height: 0,
|
17 |
+
animate: true,
|
18 |
+
margin: 0,
|
19 |
+
padding: 0,
|
20 |
+
startPaused: false,
|
21 |
+
autoAppend: true
|
22 |
+
};
|
23 |
+
internal = {
|
24 |
+
moveUp: function(state, attribs) {
|
25 |
+
return internal.showNextItem(state, attribs, 'up');
|
26 |
+
},
|
27 |
+
moveDown: function(state, attribs) {
|
28 |
+
return internal.showNextItem(state, attribs, 'down');
|
29 |
+
},
|
30 |
+
nextItemState: function(state, dir) {
|
31 |
+
var height, obj;
|
32 |
+
obj = state.element.children('ul');
|
33 |
+
height = state.itemHeight;
|
34 |
+
if (state.options.height > 0) {
|
35 |
+
height = obj.children('li:first').height();
|
36 |
+
}
|
37 |
+
height += state.options.margin + state.options.padding * 2;
|
38 |
+
return {
|
39 |
+
height: height,
|
40 |
+
options: state.options,
|
41 |
+
el: state.element,
|
42 |
+
obj: obj,
|
43 |
+
selector: dir === 'up' ? 'li:first' : 'li:last',
|
44 |
+
dir: dir
|
45 |
+
};
|
46 |
+
},
|
47 |
+
showNextItem: function(state, attribs, dir) {
|
48 |
+
var clone, nis;
|
49 |
+
nis = internal.nextItemState(state, dir);
|
50 |
+
nis.el.trigger('vticker.beforeTick');
|
51 |
+
clone = nis.obj.children(nis.selector).clone(true);
|
52 |
+
if (nis.dir === 'down') {
|
53 |
+
nis.obj.css('top', '-' + nis.height + 'px').prepend(clone);
|
54 |
+
}
|
55 |
+
if (attribs && attribs.animate) {
|
56 |
+
if (!state.animating) {
|
57 |
+
internal.animateNextItem(nis, state);
|
58 |
+
}
|
59 |
+
} else {
|
60 |
+
internal.nonAnimatedNextItem(nis);
|
61 |
+
}
|
62 |
+
if (nis.dir === 'up' && state.options.autoAppend) {
|
63 |
+
clone.appendTo(nis.obj);
|
64 |
+
}
|
65 |
+
return nis.el.trigger('vticker.afterTick');
|
66 |
+
},
|
67 |
+
animateNextItem: function(nis, state) {
|
68 |
+
var opts;
|
69 |
+
state.animating = true;
|
70 |
+
opts = nis.dir === 'up' ? {
|
71 |
+
top: '-=' + nis.height + 'px'
|
72 |
+
} : {
|
73 |
+
top: 0
|
74 |
+
};
|
75 |
+
return nis.obj.animate(opts, state.options.speed, function() {
|
76 |
+
$(nis.obj).children(nis.selector).remove();
|
77 |
+
$(nis.obj).css('top', '0px');
|
78 |
+
return state.animating = false;
|
79 |
+
});
|
80 |
+
},
|
81 |
+
nonAnimatedNextItem: function(nis) {
|
82 |
+
nis.obj.children(nis.selector).remove();
|
83 |
+
return nis.obj.css('top', '0px');
|
84 |
+
},
|
85 |
+
nextUsePause: function() {
|
86 |
+
var options, state;
|
87 |
|
88 |
+
if( ! $(this).is(":visible") ) {
|
89 |
+
internal.stopInterval.call(this);
|
90 |
+
return;
|
91 |
+
}
|
92 |
+
|
93 |
+
state = $(this).data('state');
|
94 |
+
options = state.options;
|
95 |
+
if (state.isPaused || internal.hasSingleItem(state)) {
|
96 |
+
return;
|
97 |
+
}
|
98 |
+
return methods.next.call(this, {
|
99 |
+
animate: options.animate
|
100 |
+
});
|
101 |
+
},
|
102 |
+
startInterval: function() {
|
103 |
+
var options, state;
|
104 |
+
state = $(this).data('state');
|
105 |
+
options = state.options;
|
106 |
+
return state.intervalId = setInterval((function(_this) {
|
107 |
+
return function() {
|
108 |
+
return internal.nextUsePause.call(_this);
|
109 |
+
};
|
110 |
+
})(this), options.pause);
|
111 |
+
},
|
112 |
+
stopInterval: function() {
|
113 |
+
var state;
|
114 |
+
if (!(state = $(this).data('state'))) {
|
115 |
+
return;
|
116 |
+
}
|
117 |
+
if (state.intervalId) {
|
118 |
+
clearInterval(state.intervalId);
|
119 |
+
}
|
120 |
+
return state.intervalId = void 0;
|
121 |
+
},
|
122 |
+
restartInterval: function() {
|
123 |
+
internal.stopInterval.call(this);
|
124 |
+
return internal.startInterval.call(this);
|
125 |
+
},
|
126 |
+
getState: function(from, elem) {
|
127 |
+
var state;
|
128 |
+
if (!(state = $(elem).data('state'))) {
|
129 |
+
throw new Error("vTicker: No state available from " + from);
|
130 |
+
}
|
131 |
+
return state;
|
132 |
+
},
|
133 |
+
isAnimatingOrSingleItem: function(state) {
|
134 |
+
return state.animating || this.hasSingleItem(state);
|
135 |
+
},
|
136 |
+
hasMultipleItems: function(state) {
|
137 |
+
return state.itemCount > 1;
|
138 |
+
},
|
139 |
+
hasSingleItem: function(state) {
|
140 |
+
return !internal.hasMultipleItems(state);
|
141 |
+
},
|
142 |
+
bindMousePausing: (function(_this) {
|
143 |
+
return function(el, state) {
|
144 |
+
return el.bind('mouseenter', function() {
|
145 |
+
if (state.isPaused) {
|
146 |
+
return;
|
147 |
+
}
|
148 |
+
state.pausedByCode = true;
|
149 |
+
internal.stopInterval.call(this);
|
150 |
+
return methods.pause.call(this, true);
|
151 |
+
}).bind('mouseleave', function() {
|
152 |
+
if (state.isPaused && !state.pausedByCode) {
|
153 |
+
return;
|
154 |
+
}
|
155 |
+
state.pausedByCode = false;
|
156 |
+
methods.pause.call(this, false);
|
157 |
+
return internal.startInterval.call(this);
|
158 |
+
});
|
159 |
+
};
|
160 |
+
})(this),
|
161 |
+
setItemLayout: function(el, state, options) {
|
162 |
+
var box;
|
163 |
+
el.css({
|
164 |
+
overflow: 'hidden',
|
165 |
+
position: 'relative'
|
166 |
+
}).children('ul').css({
|
167 |
+
position: 'absolute',
|
168 |
+
margin: 0,
|
169 |
+
padding: 0
|
170 |
+
}).children('li').css({
|
171 |
+
margin: options.margin,
|
172 |
+
padding: options.padding
|
173 |
+
});
|
174 |
+
if (isNaN(options.height) || options.height === 0) {
|
175 |
+
el.children('ul').children('li').each(function() {
|
176 |
+
if ($(this).height() > state.itemHeight) {
|
177 |
+
return state.itemHeight = $(this).height();
|
178 |
+
}
|
179 |
+
});
|
180 |
+
el.children('ul').children('li').each(function() {
|
181 |
+
return $(this).height(state.itemHeight);
|
182 |
+
});
|
183 |
+
box = options.margin + options.padding * 2;
|
184 |
+
return el.height((state.itemHeight + box) * options.showItems + options.margin);
|
185 |
+
} else {
|
186 |
+
return el.height(options.height);
|
187 |
+
}
|
188 |
+
},
|
189 |
+
defaultStateAttribs: function(el, options) {
|
190 |
+
return {
|
191 |
+
itemCount: el.children('ul').children('li').length,
|
192 |
+
itemHeight: 0,
|
193 |
+
itemMargin: 0,
|
194 |
+
element: el,
|
195 |
+
animating: false,
|
196 |
+
options: options,
|
197 |
+
isPaused: options.startPaused,
|
198 |
+
pausedByCode: false
|
199 |
+
};
|
200 |
+
}
|
201 |
+
};
|
202 |
+
methods = {
|
203 |
+
init: function(options) {
|
204 |
+
var clonedDefaults, el, state;
|
205 |
+
if (state = $(this).data('state')) {
|
206 |
+
methods.stop.call(this);
|
207 |
+
}
|
208 |
+
state = null;
|
209 |
+
clonedDefaults = jQuery.extend({}, defaults);
|
210 |
+
options = $.extend(clonedDefaults, options);
|
211 |
+
el = $(this);
|
212 |
+
state = internal.defaultStateAttribs(el, options);
|
213 |
+
$(this).data('state', state);
|
214 |
+
internal.setItemLayout(el, state, options);
|
215 |
+
if (!options.startPaused) {
|
216 |
+
internal.startInterval.call(this);
|
217 |
+
}
|
218 |
+
if (options.mousePause) {
|
219 |
+
return internal.bindMousePausing(el, state);
|
220 |
+
}
|
221 |
+
},
|
222 |
+
pause: function(pauseState) {
|
223 |
+
var el, state;
|
224 |
+
state = internal.getState('pause', this);
|
225 |
+
if (!internal.hasMultipleItems(state)) {
|
226 |
+
return false;
|
227 |
+
}
|
228 |
+
state.isPaused = pauseState;
|
229 |
+
el = state.element;
|
230 |
+
if (pauseState) {
|
231 |
+
$(this).addClass('paused');
|
232 |
+
return el.trigger('vticker.pause');
|
233 |
+
} else {
|
234 |
+
$(this).removeClass('paused');
|
235 |
+
return el.trigger('vticker.resume');
|
236 |
+
}
|
237 |
+
},
|
238 |
+
next: function(attribs) {
|
239 |
+
var state;
|
240 |
+
state = internal.getState('next', this);
|
241 |
+
if (internal.isAnimatingOrSingleItem(state)) {
|
242 |
+
return false;
|
243 |
+
}
|
244 |
+
internal.restartInterval.call(this);
|
245 |
+
return internal.moveUp(state, attribs);
|
246 |
+
},
|
247 |
+
prev: function(attribs) {
|
248 |
+
var state;
|
249 |
+
state = internal.getState('prev', this);
|
250 |
+
if (internal.isAnimatingOrSingleItem(state)) {
|
251 |
+
return false;
|
252 |
+
}
|
253 |
+
internal.restartInterval.call(this);
|
254 |
+
return internal.moveDown(state, attribs);
|
255 |
+
},
|
256 |
+
stop: function() {
|
257 |
+
var state;
|
258 |
+
state = internal.getState('stop', this);
|
259 |
+
return internal.stopInterval.call(this);
|
260 |
+
},
|
261 |
+
remove: function() {
|
262 |
+
var el, state;
|
263 |
+
state = internal.getState('remove', this);
|
264 |
+
internal.stopInterval.call(this);
|
265 |
+
el = state.element;
|
266 |
+
el.unbind();
|
267 |
+
return el.remove();
|
268 |
+
}
|
269 |
+
};
|
270 |
+
return $.fn.vTicker = function(method) {
|
271 |
+
if (methods[method]) {
|
272 |
+
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
273 |
+
}
|
274 |
+
if (typeof method === 'object' || !method) {
|
275 |
+
return methods.init.apply(this, arguments);
|
276 |
+
}
|
277 |
+
return $.error('Method ' + method + ' does not exist on jQuery.vTicker');
|
278 |
+
};
|
279 |
+
})(jQuery);
|
assets/js/sp-news-admin.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( document ).ready(function($) {
|
2 |
+
|
3 |
+
/* Drag widget event to render layout for Beaver Builder */
|
4 |
+
$('.fl-builder-content').on( 'fl-builder.preview-rendered', wpnw_fl_render_preview );
|
5 |
+
|
6 |
+
/* Save widget event to render layout for Beaver Builder */
|
7 |
+
$('.fl-builder-content').on( 'fl-builder.layout-rendered', wpnw_fl_render_preview );
|
8 |
+
|
9 |
+
/* Publish button event to render layout for Beaver Builder */
|
10 |
+
$('.fl-builder-content').on( 'fl-builder.didSaveNodeSettings', wpnw_fl_render_preview );
|
11 |
+
});
|
12 |
+
|
13 |
+
/* Function to render shortcode preview for Beaver Builder */
|
14 |
+
function wpnw_fl_render_preview() {
|
15 |
+
news_scrolling_slider_init();
|
16 |
+
}
|
assets/js/sp-news-public.js
CHANGED
@@ -1,17 +1,29 @@
|
|
1 |
-
|
2 |
|
3 |
-
|
4 |
-
$( '.sp-news-scrolling-slider' ).each(function( index ) {
|
5 |
-
var slider_id = $(this).attr('id');
|
6 |
-
var slider_conf = $.parseJSON( $(this).attr('data-conf') );
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
height : parseInt(slider_conf.height),
|
11 |
-
padding :10,
|
12 |
-
pause : parseInt(slider_conf.pause)
|
13 |
-
});
|
14 |
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
|
3 |
+
"use strict";
|
|
|
|
|
|
|
4 |
|
5 |
+
/* News vertical ticker Initialize */
|
6 |
+
news_scrolling_slider_init();
|
|
|
|
|
|
|
|
|
7 |
|
8 |
+
})(jQuery);
|
9 |
+
|
10 |
+
/* Function to Initialize news vertical ticker */
|
11 |
+
function news_scrolling_slider_init() {
|
12 |
+
|
13 |
+
/* Initialize news vertical ticker */
|
14 |
+
jQuery( '.sp-news-scrolling-slider' ).each(function( index ) {
|
15 |
+
var slider_id = jQuery(this).attr('id');
|
16 |
+
var slider_conf = jQuery(this).attr('data-conf');
|
17 |
+
slider_conf = (slider_conf) ? jQuery.parseJSON( slider_conf ) : '';
|
18 |
|
19 |
+
if( typeof(slider_id) != 'undefined' && slider_id != '' ) {
|
20 |
+
|
21 |
+
jQuery('#'+slider_id).vTicker({
|
22 |
+
padding : 10,
|
23 |
+
speed : parseInt( slider_conf.speed ),
|
24 |
+
height : parseInt( slider_conf.height ),
|
25 |
+
pause : parseInt( slider_conf.pause )
|
26 |
+
});
|
27 |
+
}
|
28 |
+
});
|
29 |
+
}
|
{admin → includes/admin}/class-wpnw-admin.php
RENAMED
@@ -8,7 +8,7 @@
|
|
8 |
* @since 1.0
|
9 |
*/
|
10 |
|
11 |
-
if ( !defined( 'ABSPATH' ) ) {
|
12 |
exit; // Exit if accessed directly
|
13 |
}
|
14 |
|
@@ -24,6 +24,9 @@ class Wpnw_Admin {
|
|
24 |
|
25 |
// Filter to add row action in category table
|
26 |
add_filter( WPNW_CAT.'_row_actions', array($this, 'wpnw_add_tax_row_data'), 10, 2 );
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
/**
|
@@ -48,7 +51,7 @@ class Wpnw_Admin {
|
|
48 |
* @since 1.0.0
|
49 |
*/
|
50 |
function wpnw_premium_page() {
|
51 |
-
include_once( WPNW_DIR . '/admin/settings/premium.php' );
|
52 |
}
|
53 |
|
54 |
/**
|
@@ -58,7 +61,7 @@ class Wpnw_Admin {
|
|
58 |
* @since 1.0.0
|
59 |
*/
|
60 |
function wpnw_hireus_page() {
|
61 |
-
include_once( WPNW_DIR . '/admin/settings/hire-us.php' );
|
62 |
}
|
63 |
|
64 |
/**
|
@@ -84,6 +87,19 @@ class Wpnw_Admin {
|
|
84 |
return array_merge( array( 'wpnw_id' => "<span style='color:#555'>ID: {$tag->term_id}</span>" ), $actions );
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
|
89 |
$wpnw_Admin = new Wpnw_Admin();
|
8 |
* @since 1.0
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
exit; // Exit if accessed directly
|
13 |
}
|
14 |
|
24 |
|
25 |
// Filter to add row action in category table
|
26 |
add_filter( WPNW_CAT.'_row_actions', array($this, 'wpnw_add_tax_row_data'), 10, 2 );
|
27 |
+
|
28 |
+
// Filter to add display news tag
|
29 |
+
add_filter( 'pre_get_posts', array($this, 'wpnw_display_news_tags') );
|
30 |
}
|
31 |
|
32 |
/**
|
51 |
* @since 1.0.0
|
52 |
*/
|
53 |
function wpnw_premium_page() {
|
54 |
+
include_once( WPNW_DIR . '/includes/admin/settings/premium.php' );
|
55 |
}
|
56 |
|
57 |
/**
|
61 |
* @since 1.0.0
|
62 |
*/
|
63 |
function wpnw_hireus_page() {
|
64 |
+
include_once( WPNW_DIR . '/includes/admin/settings/hire-us.php' );
|
65 |
}
|
66 |
|
67 |
/**
|
87 |
return array_merge( array( 'wpnw_id' => "<span style='color:#555'>ID: {$tag->term_id}</span>" ), $actions );
|
88 |
}
|
89 |
|
90 |
+
/**
|
91 |
+
* Function to display news tag filter
|
92 |
+
*
|
93 |
+
* @package WP News and Scrolling Widgets
|
94 |
+
* @since 1.0
|
95 |
+
*/
|
96 |
+
function wpnw_display_news_tags( $query ) {
|
97 |
+
if( is_tag() && $query->is_main_query() ) {
|
98 |
+
$post_types = array( 'post', WPNW_POST_TYPE );
|
99 |
+
$query->set( 'post_type', $post_types );
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
}
|
104 |
|
105 |
$wpnw_Admin = new Wpnw_Admin();
|
{admin → includes/admin}/settings/hire-us.php
RENAMED
@@ -6,7 +6,7 @@
|
|
6 |
* @since 1.0.0
|
7 |
*/
|
8 |
|
9 |
-
if ( !defined( 'ABSPATH' ) ) {
|
10 |
exit; // Exit if accessed directly
|
11 |
}
|
12 |
?>
|
@@ -16,12 +16,12 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
16 |
|
17 |
<div class="support-data">
|
18 |
<h3 style="margin-bottom:5px;"><?php _e( 'Highlight of Hiring:', 'sp-news-and-widget' ); ?></h3>
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
|
26 |
</div>
|
27 |
|
@@ -48,8 +48,6 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
48 |
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
|
49 |
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
|
50 |
|
51 |
-
|
52 |
-
|
53 |
/* Table Footer */
|
54 |
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
|
55 |
.wpos-plugin-pricing-table tfoot a{font-weight: 600; color: #fff; text-decoration: none; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #59c7fb; border-radius: .2em;}
|
@@ -60,37 +58,35 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
60 |
<colgroup></colgroup>
|
61 |
<colgroup></colgroup>
|
62 |
<colgroup></colgroup>
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
<th>
|
74 |
-
<h2>Hire us for 30 Hrs</h2>
|
75 |
-
<p>$499 USD</p>
|
76 |
-
<p class="promo">Our most valuable package!</p>
|
77 |
-
</th>
|
78 |
<th>
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=5&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
91 |
</tr>
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
</table>
|
96 |
</div>
|
6 |
* @since 1.0.0
|
7 |
*/
|
8 |
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
exit; // Exit if accessed directly
|
11 |
}
|
12 |
?>
|
16 |
|
17 |
<div class="support-data">
|
18 |
<h3 style="margin-bottom:5px;"><?php _e( 'Highlight of Hiring:', 'sp-news-and-widget' ); ?></h3>
|
19 |
+
<ul>
|
20 |
+
<li>Hire once, get unlimited jobs done</li>
|
21 |
+
<li>Quick ticket support, quick solution</li>
|
22 |
+
<li>Any sort of WP work with no extra cost</li>
|
23 |
+
<li>Dedicated expert working only for you!</li>
|
24 |
+
</ul>
|
25 |
|
26 |
</div>
|
27 |
|
48 |
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
|
49 |
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
|
50 |
|
|
|
|
|
51 |
/* Table Footer */
|
52 |
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
|
53 |
.wpos-plugin-pricing-table tfoot a{font-weight: 600; color: #fff; text-decoration: none; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #59c7fb; border-radius: .2em;}
|
58 |
<colgroup></colgroup>
|
59 |
<colgroup></colgroup>
|
60 |
<colgroup></colgroup>
|
61 |
+
<thead>
|
62 |
+
<tr>
|
63 |
+
<th>
|
64 |
+
<h2>Hire us for 1 Hr</h2>
|
65 |
+
<p>$20 USD</p>
|
66 |
+
</th>
|
67 |
+
<th>
|
68 |
+
<h2>Hire us for 5 Hrs</h2>
|
69 |
+
<p>$99 USD</p>
|
70 |
+
</th>
|
|
|
|
|
|
|
|
|
|
|
71 |
<th>
|
72 |
+
<h2>Hire us for 30 Hrs</h2>
|
73 |
+
<p>$499 USD</p>
|
74 |
+
<p class="promo">Our most valuable package!</p>
|
75 |
+
</th>
|
76 |
+
<th>
|
77 |
+
<h2>Hire us for 70 Hrs</h2>
|
78 |
+
<p>$999 USD</p>
|
79 |
+
</th>
|
80 |
+
</tr>
|
81 |
+
</thead>
|
82 |
|
83 |
+
<tfoot>
|
84 |
+
<tr>
|
85 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=6&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
86 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=3&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
87 |
+
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=4&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
88 |
<td><a href="https://www.wponlinesupport.com/checkout/?edd_action=add_to_cart&download_id=6044&edd_options[price_id]=5&ref=wposthemeplugin" target="_blank">Hire Us</a></td>
|
89 |
</tr>
|
90 |
+
</tfoot>
|
|
|
|
|
91 |
</table>
|
92 |
</div>
|
includes/admin/settings/premium.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Premium Offer Page
|
4 |
+
*
|
5 |
+
* @package WP News and Scrolling Widgets
|
6 |
+
* @since 1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
?>
|
13 |
+
<div class="wrap">
|
14 |
+
|
15 |
+
<h2><?php _e( 'WP News and Scrolling Widgets - Features', 'sp-news-and-widget' ); ?></h2><br />
|
16 |
+
|
17 |
+
<style>
|
18 |
+
.wprps-notice{padding: 10px; color: #3c763d; background-color: #dff0d8; border:1px solid #d6e9c6; margin: 0 0 20px 0;}
|
19 |
+
.wpos-plugin-pricing-table thead th h2{font-weight: 400; font-size: 2.4em; line-height:normal; margin:0px; color: #2ECC71;}
|
20 |
+
.wpos-plugin-pricing-table thead th h2 + p{font-size: 1.25em; line-height: 1.4; color: #999; margin:5px 0 5px 0;}
|
21 |
+
|
22 |
+
table.wpos-plugin-pricing-table{width:90%; text-align: left; border-spacing: 0; border-collapse: collapse; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}
|
23 |
+
|
24 |
+
.wpos-plugin-pricing-table th, .wpos-plugin-pricing-table td{font-size:14px; line-height:normal; color:#444; vertical-align:middle; padding:12px;}
|
25 |
+
|
26 |
+
.wpos-plugin-pricing-table colgroup:nth-child(1) { width: 31%; border: 0 none; }
|
27 |
+
.wpos-plugin-pricing-table colgroup:nth-child(2) { width: 22%; border: 1px solid #ccc; }
|
28 |
+
.wpos-plugin-pricing-table colgroup:nth-child(3) { width: 25%; border: 10px solid #2ECC71; }
|
29 |
+
|
30 |
+
/* Tablehead */
|
31 |
+
.wpos-plugin-pricing-table thead th {background-color: #fff; background:linear-gradient(to bottom, #ffffff 0%, #ffffff 100%); text-align: center; position: relative; border-bottom: 1px solid #ccc; padding: 1em 0 1em; font-weight:400; color:#999;}
|
32 |
+
.wpos-plugin-pricing-table thead th:nth-child(1) {background: transparent;}
|
33 |
+
.wpos-plugin-pricing-table thead th:nth-child(3) {padding:1em 2px 3.5em 2px; }
|
34 |
+
.wpos-plugin-pricing-table thead th:nth-child(3) p{color:#000;}
|
35 |
+
.wpos-plugin-pricing-table thead th p.promo {font-size: 14px; color: #fff; position: absolute; bottom:0; left: -17px; z-index: 1000; width: 100%; margin: 0; padding: .625em 17px .75em; background-color: #ca4a1f; box-shadow: 0 2px 4px rgba(0,0,0,.25); border-bottom: 1px solid #ca4a1f;}
|
36 |
+
.wpos-plugin-pricing-table thead th p.promo:before {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent #900 transparent transparent; bottom: -7px; left: 0;}
|
37 |
+
.wpos-plugin-pricing-table thead th p.promo:after {content: ""; position: absolute; display: block; width: 0px; height: 0px; border-style: solid; border-width: 7px 7px 0 0; border-color: #900 transparent transparent transparent; bottom: -7px; right: 0;}
|
38 |
+
|
39 |
+
/* Tablebody */
|
40 |
+
.wpos-plugin-pricing-table tbody th{background: #fff; border-left: 1px solid #ccc; font-weight: 600;}
|
41 |
+
.wpos-plugin-pricing-table tbody th span{font-weight: normal; font-size: 87.5%; color: #999; display: block;}
|
42 |
+
|
43 |
+
.wpos-plugin-pricing-table tbody td{background: #fff; text-align: center;}
|
44 |
+
.wpos-plugin-pricing-table tbody td .dashicons{height: auto; width: auto; font-size:30px;}
|
45 |
+
.wpos-plugin-pricing-table tbody td .dashicons-no-alt{color: #ca4a1f;}
|
46 |
+
.wpos-plugin-pricing-table tbody td .dashicons-yes{color: #2ECC71;}
|
47 |
+
|
48 |
+
.wpos-plugin-pricing-table tbody tr:nth-child(even) th,
|
49 |
+
.wpos-plugin-pricing-table tbody tr:nth-child(even) td { background: #f5f5f5; border: 1px solid #ccc; border-width: 1px 0 1px 1px; }
|
50 |
+
.wpos-plugin-pricing-table tbody tr:last-child td {border-bottom: 0 none;}
|
51 |
+
|
52 |
+
/* Table Footer */
|
53 |
+
.wpos-plugin-pricing-table tfoot th, .wpos-plugin-pricing-table tfoot td{text-align: center; border-top: 1px solid #ccc;}
|
54 |
+
.wpos-plugin-pricing-table tfoot a{font-weight: 600; color: #fff; text-decoration: none; text-transform: uppercase; display: inline-block; padding: 1em 2em; background: #ca4a1f; border-radius: .2em;}
|
55 |
+
</style>
|
56 |
+
|
57 |
+
<table class="wpos-plugin-pricing-table">
|
58 |
+
<colgroup></colgroup>
|
59 |
+
<colgroup></colgroup>
|
60 |
+
<colgroup></colgroup>
|
61 |
+
<thead>
|
62 |
+
<tr>
|
63 |
+
<th></th>
|
64 |
+
<th>
|
65 |
+
<h2>Free</h2>
|
66 |
+
<p>$0 USD</p>
|
67 |
+
</th>
|
68 |
+
<th>
|
69 |
+
<h2>Premium</h2>
|
70 |
+
<p>Gain access to <strong>WP News and Scrolling Widgets</strong> included in <br /><strong>Essential Plugin Bundle</p>
|
71 |
+
<p class="promo">Our most valuable package!</p>
|
72 |
+
</th>
|
73 |
+
</tr>
|
74 |
+
</thead>
|
75 |
+
|
76 |
+
<tfoot>
|
77 |
+
<tr>
|
78 |
+
<th></th>
|
79 |
+
<td></td>
|
80 |
+
<td><p>Gain access to <strong>WP News and Scrolling Widgets</strong> included in <br /><strong>Essential Plugin Bundle</p>
|
81 |
+
<a href="https://www.wponlinesupport.com/pricing/?ref=WposPratik&utm_source=WP&utm_medium=News&utm_campaign=Upgrade-PRO" target="_blank">View Buying Options</a></td>
|
82 |
+
</tr>
|
83 |
+
</tfoot>
|
84 |
+
<tbody>
|
85 |
+
<tr>
|
86 |
+
<th>Designs <span class="subtext">Designs that make your website better</span></th>
|
87 |
+
<td>2</td>
|
88 |
+
<td>120+</td>
|
89 |
+
</tr>
|
90 |
+
<tr>
|
91 |
+
<th>Shortcodes <span class="subtext">Shortcode provide output to the front-end side</span></th>
|
92 |
+
<td>1 (Grid, List)</td>
|
93 |
+
<td>6 (Grid, Slider, Carousel, List, Gridbox, GridBox Slider, News Ticke )</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<th>Shortcode Parameters <span class="subtext">Add extra power to the shortcode</span></th>
|
97 |
+
<td>9</td>
|
98 |
+
<td>30+</td>
|
99 |
+
</tr>
|
100 |
+
<tr>
|
101 |
+
<th>Shortcode Generator <span class="subtext">Play with all shortcode parameters with preview panel. No documentation required!!</span></th>
|
102 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
103 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
104 |
+
</tr>
|
105 |
+
<tr>
|
106 |
+
<th>WP Templating Features <span class="subtext">You can modify plugin html/designs in your current theme.</span></th>
|
107 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
108 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
109 |
+
</tr>
|
110 |
+
<tr>
|
111 |
+
<th>Widgets<span class="subtext"> WordPress Widgets to your sidebars.</span></th>
|
112 |
+
<td>2</td>
|
113 |
+
<td>7</td>
|
114 |
+
</tr>
|
115 |
+
<tr>
|
116 |
+
<th>Drag & Drop Post Order Change <span class="subtext">Arrange your desired post with your desired order and display</span></th>
|
117 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
118 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
119 |
+
</tr>
|
120 |
+
<tr>
|
121 |
+
<th>Gutenberg Block Supports <span>Use this plugin with Gutenberg easily</span></th>
|
122 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
123 |
+
<td><i class="dashicons dashicons-yes"></i></td>
|
124 |
+
</tr>
|
125 |
+
<tr>
|
126 |
+
<th>WPBakery Page Builder Supports <span class="subtext">Use this plugin with WPBakery Page Builder easily</span></th>
|
127 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
128 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
129 |
+
</tr>
|
130 |
+
<tr>
|
131 |
+
<th>Custom Read More link for Post <span class="subtext">Redirect post to third party destination if any</span></th>
|
132 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
133 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<th>Publicize <span class="subtext"> Support with Jetpack to publish your News post on</span></th>
|
137 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
138 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
139 |
+
</tr>
|
140 |
+
<tr>
|
141 |
+
<th>Display Desired Post <span class="subtext">Display only the post you want</span></th>
|
142 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
143 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
144 |
+
</tr>
|
145 |
+
<tr>
|
146 |
+
<th>Display Post for Particular Categories <span class="subtext">Display only the posts with particular category</span></th>
|
147 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
148 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
149 |
+
</tr>
|
150 |
+
<tr>
|
151 |
+
<th>Exclude Some Posts <span class="subtext">Do not display the posts you want</span></th>
|
152 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
153 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
154 |
+
</tr>
|
155 |
+
<tr>
|
156 |
+
<th>Exclude Some Categories <span class="subtext">Do not display the posts for particular categories</span></th>
|
157 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
158 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
159 |
+
</tr>
|
160 |
+
<tr>
|
161 |
+
<th>Post Order / Order By Parameters <span class="subtext">Display post according to date, title and etc</span></th>
|
162 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
163 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
164 |
+
</tr>
|
165 |
+
<tr>
|
166 |
+
<th>Multiple Slider Parameters <span class="subtext">Slider parameters like autoplay, number of slide, sider dots and etc.</span></th>
|
167 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
168 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
169 |
+
</tr>
|
170 |
+
<tr>
|
171 |
+
<th>Slider RTL Support <span class="subtext">Slider supports for RTL website</span></th>
|
172 |
+
<td><i class="dashicons dashicons-no-alt"> </i></td>
|
173 |
+
<td><i class="dashicons dashicons-yes"> </i></td>
|
174 |
+
</tr>
|
175 |
+
<tr>
|
176 |
+
<th>Automatic Update <span>Get automatic plugin updates </span></th>
|
177 |
+
<td>Lifetime</td>
|
178 |
+
<td>Lifetime</td>
|
179 |
+
</tr>
|
180 |
+
<tr>
|
181 |
+
<th>Support <span class="subtext">Get support for plugin</span></th>
|
182 |
+
<td>Limited</td>
|
183 |
+
<td>1 Year</td>
|
184 |
+
</tr>
|
185 |
+
</tbody>
|
186 |
+
</table>
|
187 |
+
</div>
|
includes/admin/supports/gutenberg-block.php
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Blocks Initializer
|
4 |
+
*
|
5 |
+
* @package WP News and Scrolling Widgets
|
6 |
+
* @since 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly.
|
11 |
+
}
|
12 |
+
|
13 |
+
function wpnw_register_guten_block() {
|
14 |
+
|
15 |
+
// Block Editor Script
|
16 |
+
wp_register_script( 'wpnw-block-js', WPNW_URL.'assets/js/blocks.build.js', array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor', 'wp-components' ), WPNW_VERSION, true );
|
17 |
+
wp_localize_script( 'wpnw-block-js', 'Wpnwf_Block', array(
|
18 |
+
'pro_demo_link' => 'https://demo.wponlinesupport.com/prodemo/news-plugin-pro/',
|
19 |
+
'free_demo_link' => 'https://demo.wponlinesupport.com/sp-news/',
|
20 |
+
'pro_link' => WPNW_PLUGIN_LINK,
|
21 |
+
));
|
22 |
+
|
23 |
+
// Register block and explicit attributes for grid
|
24 |
+
register_block_type( 'wpnw/sp-news', array(
|
25 |
+
'attributes' => array(
|
26 |
+
'grid' => array(
|
27 |
+
'type' => 'string',
|
28 |
+
'default' => '1',
|
29 |
+
),
|
30 |
+
'show_date' => array(
|
31 |
+
'type' => 'boolean',
|
32 |
+
'default' => true,
|
33 |
+
),
|
34 |
+
'show_category_name' => array(
|
35 |
+
'type' => 'boolean',
|
36 |
+
'default' => true,
|
37 |
+
),
|
38 |
+
'show_content' => array(
|
39 |
+
'type' => 'boolean',
|
40 |
+
'default' => true,
|
41 |
+
),
|
42 |
+
'show_full_content' => array(
|
43 |
+
'type' => 'boolean',
|
44 |
+
'default' => false,
|
45 |
+
),
|
46 |
+
'content_words_limit' => array(
|
47 |
+
'type' => 'number',
|
48 |
+
'default' => 20,
|
49 |
+
),
|
50 |
+
'limit' => array(
|
51 |
+
'type' => 'number',
|
52 |
+
'default' => 10,
|
53 |
+
),
|
54 |
+
'orderby' => array(
|
55 |
+
'type' => 'string',
|
56 |
+
'default' => 'date',
|
57 |
+
),
|
58 |
+
'order' => array(
|
59 |
+
'type' => 'string',
|
60 |
+
'default' => 'desc',
|
61 |
+
),
|
62 |
+
'category' => array(
|
63 |
+
'type' => 'string',
|
64 |
+
'default' => '',
|
65 |
+
),
|
66 |
+
'pagination_type' => array(
|
67 |
+
'type' => 'string',
|
68 |
+
'default' => 'numeric',
|
69 |
+
),
|
70 |
+
'align' => array(
|
71 |
+
'type' => 'string',
|
72 |
+
'default' => '',
|
73 |
+
),
|
74 |
+
'className' => array(
|
75 |
+
'type' => 'string',
|
76 |
+
'default' => '',
|
77 |
+
),
|
78 |
+
),
|
79 |
+
'render_callback' => 'wpnw_get_news_shortcode',
|
80 |
+
));
|
81 |
+
|
82 |
+
if ( function_exists( 'wp_set_script_translations' ) ) {
|
83 |
+
wp_set_script_translations( 'wpnw-block-js', 'sp-news-and-widget', WPNW_DIR . '/languages' );
|
84 |
+
}
|
85 |
+
|
86 |
+
}
|
87 |
+
add_action( 'init', 'wpnw_register_guten_block' );
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Enqueue Gutenberg block assets for both frontend + backend.
|
91 |
+
*
|
92 |
+
* @package WP News and Scrolling Widgets
|
93 |
+
* @since 1.0
|
94 |
+
*/
|
95 |
+
function wpnw_block_assets() {
|
96 |
+
}
|
97 |
+
add_action( 'enqueue_block_assets', 'wpnw_block_assets' );
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Enqueue Gutenberg block assets for backend editor.
|
101 |
+
*
|
102 |
+
* @uses {wp-blocks} for block type registration & related functions.
|
103 |
+
* @uses {wp-element} for WP Element abstraction — structure of blocks.
|
104 |
+
* @uses {wp-i18n} to internationalize the block's text.
|
105 |
+
* @uses {wp-editor} for WP editor styles.
|
106 |
+
*
|
107 |
+
* @package WP News and Scrolling Widgets
|
108 |
+
* @since 1.0
|
109 |
+
*/
|
110 |
+
function wpnw_editor_assets() {
|
111 |
+
|
112 |
+
// Block Editor CSS
|
113 |
+
if( ! wp_style_is( 'wpos-free-guten-block-css', 'registered' ) ) {
|
114 |
+
wp_register_style( 'wpos-free-guten-block-css', WPNW_URL.'assets/css/blocks.editor.build.css', array( 'wp-edit-blocks' ), WPNW_VERSION );
|
115 |
+
}
|
116 |
+
|
117 |
+
// Block Editor Script
|
118 |
+
wp_enqueue_style( 'wpos-free-guten-block-css' );
|
119 |
+
wp_enqueue_script( 'wpnw-block-js' );
|
120 |
+
|
121 |
+
}
|
122 |
+
add_action( 'enqueue_block_editor_assets', 'wpnw_editor_assets' );
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Adds an extra category to the block inserter
|
126 |
+
*
|
127 |
+
* @package WP News and Scrolling Widgets
|
128 |
+
* @since 1.0
|
129 |
+
*/
|
130 |
+
function wpnw_add_block_category( $categories ) {
|
131 |
+
|
132 |
+
$guten_cats = wp_list_pluck( $categories, 'slug' );
|
133 |
+
|
134 |
+
if( ! in_array( 'wpos_guten_block', $guten_cats ) ) {
|
135 |
+
$categories[] = array(
|
136 |
+
'slug' => 'wpos_guten_block',
|
137 |
+
'title' => __('WPOS Blocks', 'sp-news-and-widget'),
|
138 |
+
'icon' => null,
|
139 |
+
);
|
140 |
+
}
|
141 |
+
|
142 |
+
return $categories;
|
143 |
+
}
|
144 |
+
add_filter( 'block_categories', 'wpnw_add_block_category' );
|
includes/admin/wpnw-how-it-work.php
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Pro Designs and Plugins Feed
|
4 |
+
*
|
5 |
+
* @package WP News and Scrolling Widgets
|
6 |
+
* @since 1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
// Exit if accessed directly
|
10 |
+
if ( ! defined( 'ABSPATH' ) ) exit;
|
11 |
+
|
12 |
+
// Action to add menu
|
13 |
+
add_action('admin_menu', 'wpnw_register_design_page');
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Register plugin design page in admin menu
|
17 |
+
*
|
18 |
+
* @package WP News and Scrolling Widgets
|
19 |
+
* @since 1.0.0
|
20 |
+
*/
|
21 |
+
function wpnw_register_design_page() {
|
22 |
+
add_submenu_page( 'edit.php?post_type='.WPNW_POST_TYPE, __('How it works - WP News and Scrolling Widgets', 'sp-news-and-widget'), __('How It Works', 'sp-news-and-widget'), 'edit_posts', 'wpnw-designs', 'wpnw_designs_page' );
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Function to display plugin design HTML
|
27 |
+
*
|
28 |
+
* @package WP News and Scrolling Widgets
|
29 |
+
* @since 1.0.0
|
30 |
+
*/
|
31 |
+
function wpnw_designs_page() {
|
32 |
+
|
33 |
+
$wpos_feed_tabs = wpnw_help_tabs();
|
34 |
+
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'how-it-work';
|
35 |
+
?>
|
36 |
+
|
37 |
+
<div class="wrap wpnwm-wrap">
|
38 |
+
<h2 class="nav-tab-wrapper">
|
39 |
+
<?php
|
40 |
+
foreach ($wpos_feed_tabs as $tab_key => $tab_val) {
|
41 |
+
$tab_name = $tab_val['name'];
|
42 |
+
$active_cls = ($tab_key == $active_tab) ? 'nav-tab-active' : '';
|
43 |
+
$tab_link = add_query_arg( array( 'post_type' => WPNW_POST_TYPE, 'page' => 'wpnw-designs', 'tab' => $tab_key), admin_url('edit.php') );
|
44 |
+
?>
|
45 |
+
|
46 |
+
<a class="nav-tab <?php echo $active_cls; ?>" href="<?php echo $tab_link; ?>"><?php echo $tab_name; ?></a>
|
47 |
+
|
48 |
+
<?php } ?>
|
49 |
+
</h2>
|
50 |
+
|
51 |
+
<div class="wpnwm-tab-cnt-wrp">
|
52 |
+
<?php
|
53 |
+
if( isset($active_tab) && $active_tab == 'how-it-work' ) {
|
54 |
+
wpnw_howitwork_page();
|
55 |
+
}
|
56 |
+
else if( isset($active_tab) && $active_tab == 'plugins-feed' ) {
|
57 |
+
echo wpnw_get_plugin_design( 'plugins-feed' );
|
58 |
+
} else {
|
59 |
+
echo wpnw_get_plugin_design( 'offers-feed' );
|
60 |
+
}
|
61 |
+
?>
|
62 |
+
</div><!-- end .wpnwm-tab-cnt-wrp -->
|
63 |
+
|
64 |
+
</div><!-- end .wpnwm-wrap -->
|
65 |
+
|
66 |
+
<?php
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Gets the plugin design part feed
|
71 |
+
*
|
72 |
+
* @package WP News and Scrolling Widgets
|
73 |
+
* @since 1.0.0
|
74 |
+
*/
|
75 |
+
function wpnw_get_plugin_design( $feed_type = '' ) {
|
76 |
+
|
77 |
+
$active_tab = isset($_GET['tab']) ? $_GET['tab'] : '';
|
78 |
+
|
79 |
+
// If tab is not set then return
|
80 |
+
if( empty($active_tab) ) {
|
81 |
+
return false;
|
82 |
+
}
|
83 |
+
|
84 |
+
// Taking some variables
|
85 |
+
$wpos_feed_tabs = wpnw_help_tabs();
|
86 |
+
$transient_key = isset($wpos_feed_tabs[$active_tab]['transient_key']) ? $wpos_feed_tabs[$active_tab]['transient_key'] : 'wpnwm_' . $active_tab;
|
87 |
+
$url = isset($wpos_feed_tabs[$active_tab]['url']) ? $wpos_feed_tabs[$active_tab]['url'] : '';
|
88 |
+
$transient_time = isset($wpos_feed_tabs[$active_tab]['transient_time']) ? $wpos_feed_tabs[$active_tab]['transient_time'] : 172800;
|
89 |
+
$cache = get_transient( $transient_key );
|
90 |
+
|
91 |
+
if ( false === $cache ) {
|
92 |
+
|
93 |
+
$feed = wp_remote_get( esc_url_raw( $url ), array( 'timeout' => 120, 'sslverify' => false ) );
|
94 |
+
$response_code = wp_remote_retrieve_response_code( $feed );
|
95 |
+
|
96 |
+
if ( ! is_wp_error( $feed ) && $response_code == 200 ) {
|
97 |
+
if ( isset( $feed['body'] ) && strlen( $feed['body'] ) > 0 ) {
|
98 |
+
$cache = wp_remote_retrieve_body( $feed );
|
99 |
+
set_transient( $transient_key, $cache, $transient_time );
|
100 |
+
}
|
101 |
+
} else {
|
102 |
+
$cache = '<div class="error"><p>' . __( 'There was an error retrieving the data from the server. Please try again later.', 'sp-news-and-widget' ) . '</div>';
|
103 |
+
}
|
104 |
+
}
|
105 |
+
return $cache;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Function to get plugin feed tabs
|
110 |
+
*
|
111 |
+
* @package WP News and Scrolling Widgets
|
112 |
+
* @since 1.0.0
|
113 |
+
*/
|
114 |
+
function wpnw_help_tabs() {
|
115 |
+
$wpos_feed_tabs = array(
|
116 |
+
'how-it-work' => array(
|
117 |
+
'name' => __('How It Works', 'sp-news-and-widget'),
|
118 |
+
),
|
119 |
+
'plugins-feed' => array(
|
120 |
+
'name' => __('Our Plugins', 'sp-news-and-widget'),
|
121 |
+
'url' => 'http://wponlinesupport.com/plugin-data-api/plugins-data.php',
|
122 |
+
'transient_key' => 'wpos_plugins_feed',
|
123 |
+
'transient_time' => 172800
|
124 |
+
)
|
125 |
+
);
|
126 |
+
return $wpos_feed_tabs;
|
127 |
+
}
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Function to get 'How It Works' HTML
|
131 |
+
*
|
132 |
+
* @package WP News and Scrolling Widgets
|
133 |
+
* @since 1.0.0
|
134 |
+
*/
|
135 |
+
function wpnw_howitwork_page() { ?>
|
136 |
+
|
137 |
+
<style type="text/css">
|
138 |
+
.wpos-pro-box .hndle{background-color:#0073AA; color:#fff;}
|
139 |
+
.wpos-pro-box.postbox{background:#dbf0fa none repeat scroll 0 0; border:1px solid #0073aa; color:#191e23;}
|
140 |
+
.postbox-container .wpos-list li:before{font-family: dashicons; content: "\f139"; font-size:20px; color: #0073aa; vertical-align: middle;}
|
141 |
+
.wpnwm-wrap .wpos-button-full{display:block; text-align:center; box-shadow:none; border-radius:0;}
|
142 |
+
.wpnwm-shortcode-preview{background-color: #e7e7e7; font-weight: bold; padding: 2px 5px; display: inline-block; margin:0 0 2px 0;}
|
143 |
+
.upgrade-to-pro{font-size:18px; text-align:center; margin-bottom:15px;}
|
144 |
+
.wpos-copy-clipboard{-webkit-touch-callout: all; -webkit-user-select: all; -khtml-user-select: all; -moz-user-select: all; -ms-user-select: all; user-select: all;}
|
145 |
+
</style>
|
146 |
+
|
147 |
+
<div id="poststuff">
|
148 |
+
<div id="post-body" class="metabox-holder columns-2">
|
149 |
+
|
150 |
+
<!--How it workd HTML -->
|
151 |
+
<div id="post-body-content">
|
152 |
+
<div class="meta-box-sortables">
|
153 |
+
<div class="postbox">
|
154 |
+
|
155 |
+
<h3 class="hndle">
|
156 |
+
<span><?php _e( 'How It Works - Display and Shortcode', 'sp-news-and-widget' ); ?></span>
|
157 |
+
</h3>
|
158 |
+
|
159 |
+
<div class="inside">
|
160 |
+
<table class="form-table">
|
161 |
+
<tbody>
|
162 |
+
<tr>
|
163 |
+
<th>
|
164 |
+
<label><?php _e('Geeting Started', 'sp-news-and-widget'); ?></label>
|
165 |
+
</th>
|
166 |
+
<td>
|
167 |
+
<ul>
|
168 |
+
<li><?php _e('Step-1: This plugin create a News menu tab in WordPress menu with custom post type.', 'sp-news-and-widget'); ?></li>
|
169 |
+
<li><?php _e('Step-2: Go to "News > Add news item tab".', 'sp-news-and-widget'); ?></li>
|
170 |
+
<li><?php _e('Step-3: Add news title, description, category, and image as featured image.', 'sp-news-and-widget'); ?></li>
|
171 |
+
<li><?php _e('Step-4: Repeat this process and add multiple news item.', 'sp-news-and-widget'); ?></li>
|
172 |
+
<li><?php _e('Step-4: To display news category wise you can use category shortcode under "News > News category"', 'sp-news-and-widget'); ?></li>
|
173 |
+
</ul>
|
174 |
+
</td>
|
175 |
+
</tr>
|
176 |
+
|
177 |
+
<tr>
|
178 |
+
<th>
|
179 |
+
<label><?php _e('How Shortcode Works', 'sp-news-and-widget'); ?></label>
|
180 |
+
</th>
|
181 |
+
<td>
|
182 |
+
<ul>
|
183 |
+
<li><?php _e('Step-1. Create a page like Our News OR Latest News.', 'sp-news-and-widget'); ?></li>
|
184 |
+
<li><?php _e('<b>Please make sure that Permalink link should not be "/news" Otherwise all your news will go to archive page. You can give it other name like "/ournews, /latestnews etc"</b>', 'sp-news-and-widget'); ?></li>
|
185 |
+
<li><?php _e('Step-2. Put below shortcode as per your need.', 'sp-news-and-widget'); ?></li>
|
186 |
+
</ul>
|
187 |
+
</td>
|
188 |
+
</tr>
|
189 |
+
|
190 |
+
<tr>
|
191 |
+
<th>
|
192 |
+
<label><?php _e('All Shortcodes', 'sp-news-and-widget'); ?></label>
|
193 |
+
</th>
|
194 |
+
<td>
|
195 |
+
<span class="wpos-copy-clipboard wpnwm-shortcode-preview">[sp_news grid="list"]</span> – <?php _e('News in List View', 'sp-news-and-widget'); ?> <br />
|
196 |
+
<span class="wpos-copy-clipboard wpnwm-shortcode-preview">[sp_news grid="1"]</span> – <?php _e('Display News in grid 1', 'sp-news-and-widget'); ?> <br />
|
197 |
+
<span class="wpos-copy-clipboard wpnwm-shortcode-preview">[sp_news grid="2"]</span> – <?php _e('Display News in grid 2', 'sp-news-and-widget'); ?> <br />
|
198 |
+
<span class="wpos-copy-clipboard wpnwm-shortcode-preview">[sp_news grid="3"]</span> – <?php _e('Display News in grid 3', 'sp-news-and-widget'); ?>
|
199 |
+
</td>
|
200 |
+
</tr>
|
201 |
+
|
202 |
+
<tr>
|
203 |
+
<th>
|
204 |
+
<label><?php _e('Need Support?', 'sp-news-and-widget'); ?></label>
|
205 |
+
</th>
|
206 |
+
<td>
|
207 |
+
<p><?php _e('Check plugin document for shortcode parameters and demo for designs.', 'sp-news-and-widget'); ?></p> <br/>
|
208 |
+
<a class="button button-primary" href="https://docs.wponlinesupport.com/wp-news-and-scrolling-widgets/" target="_blank"><?php _e('Documentation', 'sp-news-and-widget'); ?></a>
|
209 |
+
<a class="button button-primary" href="https://demo.wponlinesupport.com/sp-news/" target="_blank"><?php _e('Demo for Designs', 'sp-news-and-widget'); ?></a>
|
210 |
+
</td>
|
211 |
+
</tr>
|
212 |
+
</tbody>
|
213 |
+
</table>
|
214 |
+
</div><!-- .inside -->
|
215 |
+
</div><!-- #general -->
|
216 |
+
</div><!-- .meta-box-sortables -->
|
217 |
+
</div><!-- #post-body-content -->
|
218 |
+
|
219 |
+
<!--Upgrad to Pro HTML -->
|
220 |
+
<div id="postbox-container-1" class="postbox-container">
|
221 |
+
<div class="meta-box-sortables">
|
222 |
+
<div class="postbox wpos-pro-box">
|
223 |
+
|
224 |
+
<h3 class="hndle">
|
225 |
+
<span><?php _e( 'Upgrate to Pro', 'sp-news-and-widget' ); ?></span>
|
226 |
+
</h3>
|
227 |
+
<div class="inside">
|
228 |
+
<ul class="wpos-list">
|
229 |
+
<li>120+ stunning and cool designs</li>
|
230 |
+
<li>6 shortcodes</li>
|
231 |
+
<li>50 Designs for News Grid Layout.</li>
|
232 |
+
<li>45 Designs for News Slider/Carousel Layout.</li>
|
233 |
+
<li>8 Designs for News List View.</li>
|
234 |
+
<li>3 Designs News Grid Box.</li>
|
235 |
+
<li>8 Designs News Grid Box Slider.</li>
|
236 |
+
<li>Gutenberg Block Supports</li>
|
237 |
+
<li>WPBakery Page Builder Supports</li>
|
238 |
+
<li>WP Templating Features</li>
|
239 |
+
<li>News Ticker.</li>
|
240 |
+
<li>7 different types of Latest News widgets.</li>
|
241 |
+
<li>Recent News Slider</li>
|
242 |
+
<li>Recent News Carousel</li>
|
243 |
+
<li>Recent News in Grid view</li>
|
244 |
+
<li>Create a News Page OR News website</li>
|
245 |
+
<li>Custom Read More link for News Post</li>
|
246 |
+
<li>News display with categories</li>
|
247 |
+
<li>Drag & Drop feature to display News post in your desired order and other 6 types of order parameter</li>
|
248 |
+
<li>Publicize' support with Jetpack to publish your News post on your social network</li>
|
249 |
+
<li>Custom CSS</li>
|
250 |
+
<li>100% Multi language</li>
|
251 |
+
</ul>
|
252 |
+
<div class="upgrade-to-pro"><?php echo sprintf( __( 'Gain access to <strong>WP News and Scrolling Widgets</strong> included in <br /><strong>Essential Plugin Bundle', 'sp-news-and-widget' ) ); ?></div>
|
253 |
+
<a class="button button-primary wpos-button-full" href="https://www.wponlinesupport.com/wp-plugin/sp-news-and-scrolling-widgets/?ref=WposPratik&utm_source=WP&utm_medium=News&utm_campaign=Upgrade-PRO" target="_blank"><?php _e('Go Premium ', 'sp-news-and-widget'); ?></a>
|
254 |
+
<p><a class="button button-primary wpos-button-full" href="https://demo.wponlinesupport.com/prodemo/news-plugin-pro/" target="_blank"><?php _e('View PRO Demo ', 'sp-news-and-widget'); ?></a></p>
|
255 |
+
</div><!-- .inside -->
|
256 |
+
</div><!-- #general -->
|
257 |
+
|
258 |
+
<div class="postbox">
|
259 |
+
<h3 class="hndle">
|
260 |
+
<span><?php _e( 'Help to improve this plugin!', 'sp-news-and-widget' ); ?></span>
|
261 |
+
</h3>
|
262 |
+
<div class="inside">
|
263 |
+
<p><?php _e( 'Enjoyed this plugin? You can help by rate this plugin ', 'sp-news-and-widget' ); ?><a href="https://wordpress.org/support/plugin/sp-news-and-widget/reviews/#new-post" target="_blank"><?php _e( '5 stars!', 'sp-news-and-widget' ); ?></a></p>
|
264 |
+
</div><!-- .inside -->
|
265 |
+
</div><!-- #general -->
|
266 |
+
</div><!-- .meta-box-sortables -->
|
267 |
+
</div><!-- #post-container-1 -->
|
268 |
+
|
269 |
+
</div><!-- #post-body -->
|
270 |
+
</div><!-- #poststuff -->
|
271 |
+
<?php }
|
includes/class-wpnw-script.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Script Class
|
4 |
+
*
|
5 |
+
* Handles the script and style functionality of plugin
|
6 |
+
*
|
7 |
+
* @package WP News and Scrolling Widgets
|
8 |
+
* @since 1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
class Wpnw_Script {
|
16 |
+
|
17 |
+
function __construct() {
|
18 |
+
|
19 |
+
// Action to add style at front side
|
20 |
+
add_action( 'wp_enqueue_scripts', array($this, 'wpnw_news_plugin_style') );
|
21 |
+
|
22 |
+
// Action to add script at front side
|
23 |
+
add_action( 'wp_enqueue_scripts', array($this, 'wpnw_news_plugin_script') );
|
24 |
+
|
25 |
+
// Action to add admin script and style when edit with SiteOrigin at admin side
|
26 |
+
add_action('siteorigin_panel_enqueue_admin_scripts', array($this, 'wpnw_admin_builder_script_style'), 10, 2);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Function to register admin scripts and styles
|
31 |
+
*
|
32 |
+
* @package WP News and Scrolling Widgets
|
33 |
+
* @since 4.3
|
34 |
+
*/
|
35 |
+
function wpnw_register_admin_assets() {
|
36 |
+
|
37 |
+
global $wp_version;
|
38 |
+
|
39 |
+
// Check wordpress version for older scripts
|
40 |
+
$new_ui = $wp_version >= '3.5' ? '1' : '0';
|
41 |
+
|
42 |
+
/* Styles */
|
43 |
+
// Registring admin css
|
44 |
+
wp_register_style( 'sp-news-admin-css', WPNW_URL.'assets/css/sp-news-admin.css', array(), WPNW_VERSION );
|
45 |
+
|
46 |
+
/* Scripts */
|
47 |
+
// Registring admin script
|
48 |
+
wp_register_script( 'sp-news-admin-js', WPNW_URL.'assets/js/sp-news-admin.js', array('jquery'), WPNW_VERSION, true );
|
49 |
+
wp_localize_script( 'sp-news-admin-js', 'WpspwProAdmin', array(
|
50 |
+
'new_ui' => $new_ui,
|
51 |
+
));
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Function to add script at front side
|
56 |
+
*
|
57 |
+
* @package WP News and Scrolling Widgets
|
58 |
+
* @since 1.0.0
|
59 |
+
*/
|
60 |
+
function wpnw_news_plugin_style(){
|
61 |
+
|
62 |
+
// Registring and enqueing public css
|
63 |
+
wp_register_style( 'sp-news-public', WPNW_URL.'assets/css/sp-news-public.css', array(), WPNW_VERSION );
|
64 |
+
wp_enqueue_style( 'sp-news-public');
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Function to add script at front side
|
70 |
+
*
|
71 |
+
* @package WP News and Scrolling Widgets
|
72 |
+
* @since 1.0.0
|
73 |
+
*/
|
74 |
+
function wpnw_news_plugin_script() {
|
75 |
+
|
76 |
+
global $post;
|
77 |
+
|
78 |
+
if( ! wp_script_is( 'wpos-vticker-jquery', 'registered' ) ) {
|
79 |
+
wp_register_script( 'wpos-vticker-jquery', WPNW_URL . 'assets/js/jquery.newstape.js', array('jquery'), WPNW_VERSION, true );
|
80 |
+
}
|
81 |
+
|
82 |
+
// Register Elementor script
|
83 |
+
wp_register_script( 'wpnw-elementor-js', WPNW_URL.'assets/js/elementor/wpnw-elementor.js', array('jquery'), WPNW_VERSION, true );
|
84 |
+
|
85 |
+
// Register Public Script
|
86 |
+
wp_register_script( 'sp-news-public', WPNW_URL.'assets/js/sp-news-public.js', array('jquery'), WPNW_VERSION, true );
|
87 |
+
|
88 |
+
// Enqueue Script for Elementor Preview
|
89 |
+
if ( defined('ELEMENTOR_PLUGIN_BASE') && isset( $_GET['elementor-preview'] ) && $post->ID == (int) $_GET['elementor-preview'] ) {
|
90 |
+
|
91 |
+
wp_enqueue_script( 'wpos-vticker-jquery' );
|
92 |
+
wp_enqueue_script( 'sp-news-public' );
|
93 |
+
wp_enqueue_script( 'wpnw-elementor-js' );
|
94 |
+
}
|
95 |
+
|
96 |
+
// Enqueue Style & Script for Beaver Builder
|
97 |
+
if ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_active() ) {
|
98 |
+
|
99 |
+
$this->wpnw_register_admin_assets();
|
100 |
+
|
101 |
+
// Enqueue admin style
|
102 |
+
wp_enqueue_style( 'sp-news-admin-css' );
|
103 |
+
wp_enqueue_script( 'sp-news-admin-js' );
|
104 |
+
wp_enqueue_script( 'wpos-vticker-jquery' );
|
105 |
+
wp_enqueue_script( 'sp-news-public' );
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Function to add script at admin side
|
111 |
+
*
|
112 |
+
* @package WP News and Scrolling Widgets
|
113 |
+
* @since 4.3
|
114 |
+
*/
|
115 |
+
function wpnw_admin_builder_script_style() {
|
116 |
+
|
117 |
+
$this->wpnw_register_admin_assets();
|
118 |
+
|
119 |
+
wp_enqueue_style( 'sp-news-admin-css');
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
$Wpnw_script = new Wpnw_Script();
|
includes/functions.php
ADDED
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit; // Exit if accessed directly
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Function to unique number value
|
9 |
+
*
|
10 |
+
* @package WP News and Scrolling Widgets
|
11 |
+
* @since 1.0.0
|
12 |
+
*/
|
13 |
+
function wpnw_get_unique() {
|
14 |
+
static $unique = 0;
|
15 |
+
$unique++;
|
16 |
+
|
17 |
+
// For Elementor & Beaver Builder
|
18 |
+
if( ( defined('ELEMENTOR_PLUGIN_BASE') && isset( $_POST['action'] ) && $_POST['action'] == 'elementor_ajax' )
|
19 |
+
|| ( class_exists('FLBuilderModel') && ! empty( $_POST['fl_builder_data']['action'] ) ) ) {
|
20 |
+
$unique = current_time('timestamp') . '-' . rand();
|
21 |
+
}
|
22 |
+
|
23 |
+
return $unique;
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Function to content words limit
|
28 |
+
*
|
29 |
+
* @package WP News and Scrolling Widgets
|
30 |
+
* @since 1.0.0
|
31 |
+
*/
|
32 |
+
function wpnw_limit_words( $post_id = null, $content = '', $word_length = '55', $more = '...' ) {
|
33 |
+
|
34 |
+
$has_excerpt = false;
|
35 |
+
$word_length = !empty($word_length) ? $word_length : '55';
|
36 |
+
|
37 |
+
// If post id is passed
|
38 |
+
if( !empty($post_id) ) {
|
39 |
+
if (has_excerpt($post_id)) {
|
40 |
+
$has_excerpt = true;
|
41 |
+
$content = get_the_excerpt();
|
42 |
+
} else {
|
43 |
+
$content = !empty($content) ? $content : get_the_content();
|
44 |
+
}
|
45 |
+
}
|
46 |
+
|
47 |
+
if( !empty($content) && (!$has_excerpt) ) {
|
48 |
+
$content = strip_shortcodes( $content ); // Strip shortcodes
|
49 |
+
$content = wp_trim_words( $content, $word_length, $more );
|
50 |
+
}
|
51 |
+
|
52 |
+
return $content;
|
53 |
+
}
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Sanitize Multiple HTML class
|
57 |
+
*
|
58 |
+
* @package WP News and Widget - Masonry Layout
|
59 |
+
* @since 2.1.4
|
60 |
+
*/
|
61 |
+
function wpnw_sanitize_html_classes($classes, $sep = " ") {
|
62 |
+
$return = "";
|
63 |
+
|
64 |
+
if( $classes && !is_array($classes) ) {
|
65 |
+
$classes = explode($sep, $classes);
|
66 |
+
}
|
67 |
+
|
68 |
+
if( !empty($classes) ) {
|
69 |
+
foreach($classes as $class){
|
70 |
+
$return .= sanitize_html_class($class) . " ";
|
71 |
+
}
|
72 |
+
$return = trim( $return );
|
73 |
+
}
|
74 |
+
|
75 |
+
return $return;
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Function to news pagination
|
80 |
+
*
|
81 |
+
* @package WP News and Scrolling Widgets
|
82 |
+
* @since 1.0.0
|
83 |
+
*/
|
84 |
+
function wpnw_news_pagination($args = array()){
|
85 |
+
$big = 999999999; // need an unlikely integer
|
86 |
+
$paging = apply_filters('news_blog_paging_args', array(
|
87 |
+
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
|
88 |
+
'format' => '?paged=%#%',
|
89 |
+
'current' => max( 1, $args['paged'] ),
|
90 |
+
'total' => $args['total'],
|
91 |
+
'prev_next' => true,
|
92 |
+
'prev_text' => __('« Previous', 'sp-news-and-widget'),
|
93 |
+
'next_text' => __('Next »', 'sp-news-and-widget'),
|
94 |
+
));
|
95 |
+
|
96 |
+
echo paginate_links($paging);
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Sanitize number value and return fallback value if it is blank
|
101 |
+
*
|
102 |
+
* @package WP News and Scrolling Widgets
|
103 |
+
* @since 4.3
|
104 |
+
*/
|
105 |
+
function wpnw_clean_number( $var, $fallback = null, $type = 'int' ) {
|
106 |
+
|
107 |
+
if ( $type == 'number' ) {
|
108 |
+
$data = intval( $var );
|
109 |
+
} else {
|
110 |
+
$data = absint( $var );
|
111 |
+
}
|
112 |
+
|
113 |
+
return ( empty($data) && isset($fallback) ) ? $fallback : $data;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Clean variables using sanitize_text_field. Arrays are cleaned recursively.
|
118 |
+
* Non-scalar values are ignored.
|
119 |
+
*
|
120 |
+
* @package WP News and Scrolling Widgets
|
121 |
+
* @since 4.3
|
122 |
+
*/
|
123 |
+
function wpnw_clean( $var ) {
|
124 |
+
if ( is_array( $var ) ) {
|
125 |
+
return array_map( 'wpnw_clean', $var );
|
126 |
+
} else {
|
127 |
+
$data = is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
|
128 |
+
return wp_unslash($data);
|
129 |
+
}
|
130 |
+
}
|
includes/shortcode/sp-news-shortcode.php
ADDED
@@ -0,0 +1,205 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* `sp_news` Shortcode
|
4 |
+
*
|
5 |
+
* @package WP News and Scrolling Widgets
|
6 |
+
* @since 1.0.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
|
13 |
+
function wpnw_get_news_shortcode( $atts, $content = null ){
|
14 |
+
|
15 |
+
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
|
16 |
+
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
|
17 |
+
return "[sp_news]";
|
18 |
+
}
|
19 |
+
|
20 |
+
// setup the query
|
21 |
+
extract(shortcode_atts(array(
|
22 |
+
"limit" => 10,
|
23 |
+
"category" => '',
|
24 |
+
"grid" => 1,
|
25 |
+
"show_date" => 'true',
|
26 |
+
"show_category_name" => 'true',
|
27 |
+
"show_content" => 'true',
|
28 |
+
"show_full_content" => 'false',
|
29 |
+
"content_words_limit" => 20,
|
30 |
+
"order" => 'DESC',
|
31 |
+
"orderby" => 'date',
|
32 |
+
"pagination_type" => 'numeric',
|
33 |
+
'extra_class' => '',
|
34 |
+
'className' => '',
|
35 |
+
'align' => '',
|
36 |
+
), $atts, 'sp_news'));
|
37 |
+
|
38 |
+
// Define variables
|
39 |
+
$posts_per_page = ! empty( $limit ) ? $limit : 10;
|
40 |
+
$cat = ! empty( $category ) ? explode(',', $category) : '';
|
41 |
+
$gridcol = ! empty( $grid ) ? $grid : 1;
|
42 |
+
$show_date = ( $show_date == 'true' ) ? 1 : 0;
|
43 |
+
$show_category_name = ( $show_category_name == 'true' ) ? 1 : 0;
|
44 |
+
$show_content = ( $show_content == 'true' ) ? 1 : 0;
|
45 |
+
$show_full_content = ( $show_full_content == 'true' ) ? 1 : 0;
|
46 |
+
$words_limit = ! empty( $content_words_limit ) ? $content_words_limit : 20;
|
47 |
+
$pagination_type = ( $pagination_type == 'numeric' ) ? 'numeric' : 'next-prev';
|
48 |
+
$order = ( strtolower( $order ) == 'asc' ) ? 'ASC' : 'DESC';
|
49 |
+
$orderby = ! empty( $orderby ) ? $orderby : 'date';
|
50 |
+
$align = ! empty( $align ) ? 'align'.$align : '';
|
51 |
+
$extra_class = $extra_class .' '. $align .' '. $className;
|
52 |
+
$extra_class = wpnw_sanitize_html_classes( $extra_class );
|
53 |
+
|
54 |
+
ob_start();
|
55 |
+
|
56 |
+
global $paged, $post;
|
57 |
+
|
58 |
+
if( is_home() || is_front_page() ) {
|
59 |
+
$paged = get_query_var('page');
|
60 |
+
} else {
|
61 |
+
$paged = get_query_var('paged');
|
62 |
+
}
|
63 |
+
|
64 |
+
$post_type = WPNW_POST_TYPE;
|
65 |
+
|
66 |
+
$args = array (
|
67 |
+
'post_type' => $post_type,
|
68 |
+
'post_status' => array( 'publish' ),
|
69 |
+
'orderby' => $orderby,
|
70 |
+
'order' => $order,
|
71 |
+
'posts_per_page' => $posts_per_page,
|
72 |
+
'paged' => $paged,
|
73 |
+
);
|
74 |
+
|
75 |
+
if( $cat != "" ) {
|
76 |
+
$args['tax_query'] = array(
|
77 |
+
array(
|
78 |
+
'taxonomy' => WPNW_CAT,
|
79 |
+
'field' => 'term_id',
|
80 |
+
'terms' => $cat
|
81 |
+
));
|
82 |
+
}
|
83 |
+
|
84 |
+
$query = new WP_Query( $args );
|
85 |
+
$post_count = $query->post_count;
|
86 |
+
$count = 0;
|
87 |
+
?>
|
88 |
+
|
89 |
+
<div class="wpnawfree-plugin news-clearfix <?php echo $extra_class; ?>">
|
90 |
+
|
91 |
+
<?php if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
|
92 |
+
|
93 |
+
$count++;
|
94 |
+
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
95 |
+
$news_links = array();
|
96 |
+
|
97 |
+
if( $terms ) {
|
98 |
+
foreach ( $terms as $term ) {
|
99 |
+
$term_link = get_term_link( $term );
|
100 |
+
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
$cate_name = join( ", ", $news_links );
|
105 |
+
$css_class = "wpnaw-news-post";
|
106 |
+
|
107 |
+
if ( ( is_numeric( $grid ) && ( $grid > 0 ) && ( 0 == ($count - 1) % $grid ) ) || 1 == $count ) {
|
108 |
+
$css_class .= ' wpnaw-first';
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( ( is_numeric( $grid ) && ( $grid > 0 ) && ( 0 == $count % $grid ) ) || $post_count == $count ) {
|
112 |
+
$css_class .= ' wpnaw-last';
|
113 |
+
}
|
114 |
+
|
115 |
+
if( $show_date ) {
|
116 |
+
$date_class = "has-date";
|
117 |
+
} else {
|
118 |
+
$date_class = "has-no-date";
|
119 |
+
} ?>
|
120 |
+
|
121 |
+
<div id="post-<?php the_ID(); ?>" class="news type-news news-col-<?php echo $gridcol.' '.$css_class.' '.$date_class; ?>">
|
122 |
+
<div class="news-inner-wrap-view news-clearfix <?php if ( ! has_post_thumbnail() ) { echo 'wpnaw-news-no-image'; } ?>">
|
123 |
+
|
124 |
+
<?php if ( has_post_thumbnail()) { ?>
|
125 |
+
<div class="news-thumb">
|
126 |
+
<?php if( $gridcol == '1' ){ ?>
|
127 |
+
<div class="grid-news-thumb">
|
128 |
+
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('large'); ?></a>
|
129 |
+
</div>
|
130 |
+
<?php } else if( $gridcol > '2' ) { ?>
|
131 |
+
<div class="grid-news-thumb">
|
132 |
+
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
133 |
+
</div>
|
134 |
+
<?php } else { ?>
|
135 |
+
<div class="grid-news-thumb">
|
136 |
+
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
137 |
+
</div>
|
138 |
+
<?php } ?>
|
139 |
+
</div>
|
140 |
+
<?php } ?>
|
141 |
+
|
142 |
+
<div class="news-content">
|
143 |
+
<?php if( $gridcol == '1' ) {
|
144 |
+
|
145 |
+
if( $show_date ){ ?>
|
146 |
+
<div class="date-post">
|
147 |
+
<h2><span><?php echo get_the_date('j'); ?></span></h2>
|
148 |
+
<p><?php echo get_the_date('M y'); ?></p>
|
149 |
+
</div>
|
150 |
+
<?php } ?>
|
151 |
+
|
152 |
+
<?php } else { ?>
|
153 |
+
|
154 |
+
<div class="grid-date-post">
|
155 |
+
<?php echo ( $show_date ) ? get_the_date() : ""; ?>
|
156 |
+
<?php echo ( $show_date && $show_category_name && $cate_name != '') ? " / " : ""; ?>
|
157 |
+
<?php echo ( $show_category_name && $cate_name != '') ? $cate_name : ""; ?>
|
158 |
+
</div>
|
159 |
+
|
160 |
+
<?php } ?>
|
161 |
+
|
162 |
+
<div class="post-content-text">
|
163 |
+
<?php the_title( sprintf( '<h3 class="news-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); ?>
|
164 |
+
<?php if( $show_category_name && $gridcol == '1' ){ ?>
|
165 |
+
<div class="news-cat"><?php echo $cate_name; ?></div>
|
166 |
+
<?php } ?>
|
167 |
+
|
168 |
+
<?php if( $show_content ) { ?>
|
169 |
+
<div class="news-content-excerpt">
|
170 |
+
<?php if( empty( $show_full_content ) ) {
|
171 |
+
$excerpt = get_the_content(); ?>
|
172 |
+
<div class="news-short-content">
|
173 |
+
<?php echo wpnw_limit_words( $post->ID, $excerpt, $words_limit, '...'); ?>
|
174 |
+
</div>
|
175 |
+
<a href="<?php the_permalink(); ?>" class="news-more-link"><?php _e( 'Read More', 'sp-news-and-widget' ); ?></a>
|
176 |
+
<?php } else {
|
177 |
+
the_content();
|
178 |
+
} ?>
|
179 |
+
</div><!-- .entry-content -->
|
180 |
+
<?php } ?>
|
181 |
+
</div>
|
182 |
+
|
183 |
+
</div>
|
184 |
+
</div><!-- #post-## -->
|
185 |
+
</div><!-- #post-## -->
|
186 |
+
<?php endwhile; endif; ?>
|
187 |
+
|
188 |
+
<div class="news_pagination">
|
189 |
+
<?php if( $pagination_type == 'numeric' ){
|
190 |
+
echo wpnw_news_pagination( array( 'paged' => $paged , 'total' => $query->max_num_pages ) );
|
191 |
+
} else { ?>
|
192 |
+
<div class="button-news-p"><?php next_posts_link( __('Next', 'sp-news-and-widget').' »', $query->max_num_pages ); ?></div>
|
193 |
+
<div class="button-news-n"><?php previous_posts_link( '« '.__('Previous', 'sp-news-and-widget') ); ?></div>
|
194 |
+
<?php } ?>
|
195 |
+
</div>
|
196 |
+
|
197 |
+
</div>
|
198 |
+
|
199 |
+
<?php wp_reset_postdata();
|
200 |
+
|
201 |
+
return ob_get_clean();
|
202 |
+
}
|
203 |
+
|
204 |
+
// 'sp_news' shortcode
|
205 |
+
add_shortcode('sp_news','wpnw_get_news_shortcode');
|
includes/sp-news-post-type.php
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
exit; // Exit if accessed directly
|
5 |
}
|
6 |
|
7 |
// Initialization function
|
8 |
-
add_action('init', '
|
9 |
|
10 |
-
function
|
11 |
// Create new News custom post type
|
12 |
$news_labels = array(
|
13 |
-
'name'
|
14 |
-
'singular_name'
|
15 |
-
'add_new'
|
16 |
-
'add_new_item'
|
17 |
-
'edit_item'
|
18 |
-
'new_item'
|
19 |
-
'view_item'
|
20 |
-
'search_items'
|
21 |
-
'not_found'
|
22 |
-
'not_found_in_trash'
|
23 |
-
'parent_item_colon'
|
24 |
-
'menu_name'
|
25 |
);
|
26 |
$news_args = array(
|
27 |
'labels' => $news_labels,
|
@@ -32,7 +32,7 @@ function sp_cpt_news_init() {
|
|
32 |
'show_in_menu' => true,
|
33 |
'query_var' => true,
|
34 |
'rewrite' => array(
|
35 |
-
'slug' => 'news',
|
36 |
'with_front' => false
|
37 |
),
|
38 |
'capability_type' => 'post',
|
@@ -49,9 +49,9 @@ function sp_cpt_news_init() {
|
|
49 |
}
|
50 |
|
51 |
/* Register Taxonomy */
|
52 |
-
add_action( 'init', '
|
53 |
|
54 |
-
function
|
55 |
$labels = array(
|
56 |
'name' => _x( 'Category', 'sp-news-and-widget' ),
|
57 |
'singular_name' => _x( 'Category', 'sp-news-and-widget' ),
|
@@ -73,15 +73,7 @@ function news_taxonomies() {
|
|
73 |
'show_admin_column' => true,
|
74 |
'query_var' => true,
|
75 |
'show_in_rest' => true,
|
76 |
-
'rewrite' => array( 'slug' => WPNW_CAT
|
77 |
);
|
78 |
register_taxonomy( WPNW_CAT, array( WPNW_POST_TYPE ), $args );
|
79 |
-
}
|
80 |
-
|
81 |
-
function wpnaw_rewrite_flush() {
|
82 |
-
sp_cpt_news_init();
|
83 |
-
news_taxonomies();
|
84 |
-
|
85 |
-
flush_rewrite_rules();
|
86 |
-
}
|
87 |
-
register_activation_hook( __FILE__, 'wpnaw_rewrite_flush' );
|
1 |
<?php
|
2 |
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
exit; // Exit if accessed directly
|
5 |
}
|
6 |
|
7 |
// Initialization function
|
8 |
+
add_action('init', 'wpnw_news_post_type_init');
|
9 |
|
10 |
+
function wpnw_news_post_type_init() {
|
11 |
// Create new News custom post type
|
12 |
$news_labels = array(
|
13 |
+
'name' => _x('News', 'sp-news-and-widget'),
|
14 |
+
'singular_name' => _x('news', 'sp-news-and-widget'),
|
15 |
+
'add_new' => _x('Add News Item', 'sp-news-and-widget'),
|
16 |
+
'add_new_item' => __('Add New News Item', 'sp-news-and-widget'),
|
17 |
+
'edit_item' => __('Edit News Item', 'sp-news-and-widget'),
|
18 |
+
'new_item' => __('New News Item', 'sp-news-and-widget'),
|
19 |
+
'view_item' => __('View News Item', 'sp-news-and-widget'),
|
20 |
+
'search_items' => __('Search News Items','sp-news-and-widget'),
|
21 |
+
'not_found' => __('No News Items found', 'sp-news-and-widget'),
|
22 |
+
'not_found_in_trash' => __('No News Items found in Trash', 'sp-news-and-widget'),
|
23 |
+
'parent_item_colon' => '',
|
24 |
+
'menu_name' => _x( 'News', 'admin menu', 'sp-news-and-widget' )
|
25 |
);
|
26 |
$news_args = array(
|
27 |
'labels' => $news_labels,
|
32 |
'show_in_menu' => true,
|
33 |
'query_var' => true,
|
34 |
'rewrite' => array(
|
35 |
+
'slug' => apply_filters('wpnw_news_post_slug', 'news'),
|
36 |
'with_front' => false
|
37 |
),
|
38 |
'capability_type' => 'post',
|
49 |
}
|
50 |
|
51 |
/* Register Taxonomy */
|
52 |
+
add_action( 'init', 'wpnw_news_taxonomies');
|
53 |
|
54 |
+
function wpnw_news_taxonomies() {
|
55 |
$labels = array(
|
56 |
'name' => _x( 'Category', 'sp-news-and-widget' ),
|
57 |
'singular_name' => _x( 'Category', 'sp-news-and-widget' ),
|
73 |
'show_admin_column' => true,
|
74 |
'query_var' => true,
|
75 |
'show_in_rest' => true,
|
76 |
+
'rewrite' => array( 'slug' => apply_filters('wpnw_news_cat_slug', WPNW_CAT)),
|
77 |
);
|
78 |
register_taxonomy( WPNW_CAT, array( WPNW_POST_TYPE ), $args );
|
79 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/sp-news-shortcode.php
DELETED
@@ -1,214 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) {
|
4 |
-
exit; // Exit if accessed directly
|
5 |
-
}
|
6 |
-
|
7 |
-
function wpnaw_get_news( $atts, $content = null ){
|
8 |
-
// setup the query
|
9 |
-
extract(shortcode_atts(array(
|
10 |
-
"limit" => '',
|
11 |
-
"category" => '',
|
12 |
-
"grid" => '',
|
13 |
-
"show_date" => '',
|
14 |
-
"show_category_name" => '',
|
15 |
-
"show_content" => '',
|
16 |
-
"show_full_content" => '',
|
17 |
-
"content_words_limit" => '',
|
18 |
-
"pagination_type" => 'numeric',
|
19 |
-
), $atts, 'sp_news'));
|
20 |
-
|
21 |
-
// Define limit
|
22 |
-
|
23 |
-
if( $limit ) {
|
24 |
-
$posts_per_page = $limit;
|
25 |
-
} else {
|
26 |
-
$posts_per_page = -1;
|
27 |
-
}
|
28 |
-
|
29 |
-
if( $category ) {
|
30 |
-
$cat = $category;
|
31 |
-
} else {
|
32 |
-
$cat = '';
|
33 |
-
}
|
34 |
-
|
35 |
-
if( $grid ) {
|
36 |
-
$gridcol = $grid;
|
37 |
-
} else {
|
38 |
-
$gridcol = 1;
|
39 |
-
}
|
40 |
-
|
41 |
-
if( $show_date ) {
|
42 |
-
$showDate = $show_date;
|
43 |
-
} else {
|
44 |
-
$showDate = 'true';
|
45 |
-
}
|
46 |
-
|
47 |
-
if( $show_category_name ) {
|
48 |
-
$showCategory = $show_category_name;
|
49 |
-
} else {
|
50 |
-
$showCategory = 'true';
|
51 |
-
}
|
52 |
-
|
53 |
-
if( $show_content ) {
|
54 |
-
$showContent = $show_content;
|
55 |
-
} else {
|
56 |
-
$showContent = 'true';
|
57 |
-
}
|
58 |
-
|
59 |
-
if( $show_full_content ) {
|
60 |
-
$showFullContent = $show_full_content;
|
61 |
-
} else {
|
62 |
-
$showFullContent = 'false';
|
63 |
-
}
|
64 |
-
|
65 |
-
if( $content_words_limit ) {
|
66 |
-
$words_limit = $content_words_limit;
|
67 |
-
} else {
|
68 |
-
$words_limit = 20;
|
69 |
-
}
|
70 |
-
|
71 |
-
if($pagination_type == 'numeric'){
|
72 |
-
|
73 |
-
$pagination_type = 'numeric';
|
74 |
-
}else{
|
75 |
-
|
76 |
-
$pagination_type = 'next-prev';
|
77 |
-
}
|
78 |
-
|
79 |
-
ob_start();
|
80 |
-
|
81 |
-
global $paged;
|
82 |
-
|
83 |
-
if(is_home() || is_front_page()) {
|
84 |
-
$paged = get_query_var('page');
|
85 |
-
} else {
|
86 |
-
$paged = get_query_var('paged');
|
87 |
-
}
|
88 |
-
|
89 |
-
$post_type = WPNW_POST_TYPE;
|
90 |
-
$orderby = 'date';
|
91 |
-
$order = 'DESC';
|
92 |
-
|
93 |
-
$args = array (
|
94 |
-
'post_type' => $post_type,
|
95 |
-
'post_status' => array( 'publish' ),
|
96 |
-
'orderby' => $orderby,
|
97 |
-
'order' => $order,
|
98 |
-
'posts_per_page' => $posts_per_page,
|
99 |
-
'paged' => $paged,
|
100 |
-
);
|
101 |
-
|
102 |
-
if($cat != "") {
|
103 |
-
$args['tax_query'] = array(
|
104 |
-
array(
|
105 |
-
'taxonomy' => WPNW_CAT,
|
106 |
-
'field' => 'term_id',
|
107 |
-
'terms' => $cat
|
108 |
-
));
|
109 |
-
}
|
110 |
-
|
111 |
-
$query = new WP_Query($args);
|
112 |
-
|
113 |
-
global $post;
|
114 |
-
$post_count = $query->post_count;
|
115 |
-
$count = 0;
|
116 |
-
?>
|
117 |
-
<div class="wpnawfree-plugin news-clearfix">
|
118 |
-
<?php
|
119 |
-
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
|
120 |
-
|
121 |
-
$count++;
|
122 |
-
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
123 |
-
$news_links = array();
|
124 |
-
|
125 |
-
if($terms) {
|
126 |
-
foreach ( $terms as $term ) {
|
127 |
-
$term_link = get_term_link( $term );
|
128 |
-
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
129 |
-
}
|
130 |
-
}
|
131 |
-
|
132 |
-
$cate_name = join( ", ", $news_links );
|
133 |
-
$css_class="wpnaw-news-post";
|
134 |
-
|
135 |
-
if ( ( is_numeric( $grid ) && ( $grid > 0 ) && ( 0 == ($count - 1) % $grid ) ) || 1 == $count ) { $css_class .= ' wpnaw-first'; }
|
136 |
-
if ( ( is_numeric( $grid ) && ( $grid > 0 ) && ( 0 == $count % $grid ) ) || $post_count == $count ) { $css_class .= ' wpnaw-last'; }
|
137 |
-
if($showDate == 'true'){ $date_class = "has-date"; } else { $date_class = "has-no-date";} ?>
|
138 |
-
|
139 |
-
<div id="post-<?php the_ID(); ?>" class="news type-news news-col-<?php echo $gridcol.' '.$css_class.' '.$date_class; ?>">
|
140 |
-
<div class="news-inner-wrap-view news-clearfix <?php if ( !has_post_thumbnail()) { echo 'wpnaw-news-no-image'; } ?>">
|
141 |
-
<?php if ( has_post_thumbnail()) { ?>
|
142 |
-
<div class="news-thumb">
|
143 |
-
<?php if($gridcol == '1'){ ?>
|
144 |
-
<div class="grid-news-thumb">
|
145 |
-
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('large'); ?></a>
|
146 |
-
</div>
|
147 |
-
<?php } else if($gridcol > '2') { ?>
|
148 |
-
<div class="grid-news-thumb">
|
149 |
-
<a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('medium_large'); ?></a>
|
150 |
-
</div>
|
151 |
-
<?php } else { ?>
|
152 |
-
<div class="grid-news-thumb">
|
153 |
-
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium_large'); ?></a>
|
154 |
-
</div>
|
155 |
-
<?php } ?>
|
156 |
-
</div>
|
157 |
-
<?php } ?>
|
158 |
-
<div class="news-content">
|
159 |
-
<?php if($gridcol == '1') {
|
160 |
-
if($showDate == 'true'){ ?>
|
161 |
-
<div class="date-post">
|
162 |
-
<h2><span><?php echo get_the_date('j'); ?></span></h2>
|
163 |
-
<p><?php echo get_the_date('M y'); ?></p>
|
164 |
-
</div>
|
165 |
-
<?php }?>
|
166 |
-
<?php } else { ?>
|
167 |
-
<div class="grid-date-post">
|
168 |
-
<?php echo ($showDate == "true")? get_the_date() : "" ;?>
|
169 |
-
<?php echo ($showDate == "true" && $showCategory == "true" && $cate_name != '') ? " / " : "";?>
|
170 |
-
<?php echo ($showCategory == 'true' && $cate_name != '') ? $cate_name : ""?>
|
171 |
-
</div>
|
172 |
-
<?php } ?>
|
173 |
-
<div class="post-content-text">
|
174 |
-
<?php the_title( sprintf( '<h3 class="news-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); ?>
|
175 |
-
<?php if($showCategory == 'true' && $gridcol == '1'){ ?>
|
176 |
-
<div class="news-cat">
|
177 |
-
<?php echo $cate_name; ?>
|
178 |
-
</div>
|
179 |
-
<?php }?>
|
180 |
-
<?php if($showContent == 'true'){?>
|
181 |
-
<div class="news-content-excerpt">
|
182 |
-
<?php if($showFullContent == "false" ) {
|
183 |
-
$excerpt = get_the_content(); ?>
|
184 |
-
<div class="news-short-content">
|
185 |
-
<?php echo string_limit_newswords( $post->ID, $excerpt, $words_limit, '...'); ?>
|
186 |
-
</div>
|
187 |
-
<a href="<?php the_permalink(); ?>" class="news-more-link"><?php _e( 'Read More', 'sp-news-and-widget' ); ?></a>
|
188 |
-
<?php } else {
|
189 |
-
the_content();
|
190 |
-
} ?>
|
191 |
-
</div><!-- .entry-content -->
|
192 |
-
<?php }?>
|
193 |
-
</div>
|
194 |
-
</div>
|
195 |
-
</div><!-- #post-## -->
|
196 |
-
</div><!-- #post-## -->
|
197 |
-
<?php endwhile; endif; ?>
|
198 |
-
</div>
|
199 |
-
<div class="news_pagination">
|
200 |
-
<?php if($pagination_type == 'numeric'){
|
201 |
-
echo news_pagination( array( 'paged' => $paged , 'total' => $query->max_num_pages ) );
|
202 |
-
} else { ?>
|
203 |
-
<div class="button-news-p"><?php next_posts_link( __('Next', 'sp-news-and-widget').' »', $query->max_num_pages ); ?></div>
|
204 |
-
<div class="button-news-n"><?php previous_posts_link( '« '.__('Previous', 'sp-news-and-widget') ); ?></div>
|
205 |
-
<?php } ?>
|
206 |
-
</div><?php
|
207 |
-
|
208 |
-
wp_reset_postdata();
|
209 |
-
|
210 |
-
return ob_get_clean();
|
211 |
-
}
|
212 |
-
|
213 |
-
// 'sp_news' shortcode
|
214 |
-
add_shortcode('sp_news','wpnaw_get_news');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/widgets/class-wpnw-latest-news-widget.php
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Widget Class
|
4 |
+
*
|
5 |
+
* Handles latest News widget functionality of plugin
|
6 |
+
*
|
7 |
+
* @package WP News and Scrolling Widgets
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
class SP_News_Widget extends WP_Widget {
|
16 |
+
|
17 |
+
var $defaults;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Sets up a new widget instance.
|
21 |
+
*
|
22 |
+
* @package WP News and Scrolling Widgets
|
23 |
+
* @since 1.0
|
24 |
+
*/
|
25 |
+
function __construct() {
|
26 |
+
|
27 |
+
$widget_ops = array('classname' => 'SP_News_Widget', 'description' => esc_html__('Displayed Latest News Items from the News in a sidebar', 'sp-news-and-widget') );
|
28 |
+
$control_ops = array( 'width' => 350, 'height' => 450, 'id_base' => 'sp_news_widget' );
|
29 |
+
|
30 |
+
parent::__construct( 'sp_news_widget', esc_html__('Latest News Widget', 'sp-news-and-widget'), $widget_ops, $control_ops );
|
31 |
+
|
32 |
+
$this->defaults = array(
|
33 |
+
'limit' => 5,
|
34 |
+
'title' => __('Latest News', 'sp-news-and-widget'),
|
35 |
+
'date' => false,
|
36 |
+
'show_category' => false,
|
37 |
+
'category' => 0,
|
38 |
+
);
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Handles updating settings for the current widget instance.
|
43 |
+
*
|
44 |
+
* @package WP News and Scrolling Widgets
|
45 |
+
* @since 1.0
|
46 |
+
*/
|
47 |
+
function update( $new_instance, $old_instance ) {
|
48 |
+
|
49 |
+
$instance = $old_instance;
|
50 |
+
$instance['title'] = isset( $new_instance['title'] ) ? wpnw_clean( $new_instance['title'] ) : '';
|
51 |
+
$instance['num_items'] = isset( $new_instance['category'] ) ? wpnw_clean_number( $new_instance['num_items'], 5, 'number' ) : '';
|
52 |
+
$instance['category'] = isset( $new_instance['category'] ) ? wpnw_clean_number( $new_instance['category'] ) : '';
|
53 |
+
$instance['date'] = ! empty( $new_instance['date']) ? 1 : 0;
|
54 |
+
$instance['show_category'] = ! empty( $new_instance['show_category'] ) ? 1 : 0;
|
55 |
+
|
56 |
+
return $instance;
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Outputs the settings form for the widget.
|
61 |
+
*
|
62 |
+
* @package WP News and Scrolling Widgets
|
63 |
+
* @since 1.0
|
64 |
+
*/
|
65 |
+
function form( $instance ) {
|
66 |
+
|
67 |
+
$instance = wp_parse_args( (array)$instance, $this->defaults );
|
68 |
+
$num_items = isset( $instance['num_items'] ) ? absint( $instance['num_items'] ) : 5;
|
69 |
+
?>
|
70 |
+
|
71 |
+
<div class="wpnw-widget-wrap">
|
72 |
+
<p>
|
73 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title', 'sp-news-and-widget' ); ?>:<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" /></label>
|
74 |
+
</p>
|
75 |
+
|
76 |
+
<p>
|
77 |
+
<label for="<?php echo $this->get_field_id('num_items'); ?>"><?php _e( 'Number of Items', 'sp-news-and-widget' ); ?>:<input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo esc_attr($num_items); ?>" /></label>
|
78 |
+
</p>
|
79 |
+
|
80 |
+
<p>
|
81 |
+
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox"<?php checked( $instance['date'], 1 ); ?> />
|
82 |
+
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Display Date', 'sp-news-and-widget' ); ?></label>
|
83 |
+
</p>
|
84 |
+
|
85 |
+
<p>
|
86 |
+
<input id="<?php echo $this->get_field_id( 'show_category' ); ?>" name="<?php echo $this->get_field_name( 'show_category' ); ?>" type="checkbox"<?php checked( $instance['show_category'], 1 ); ?> />
|
87 |
+
<label for="<?php echo $this->get_field_id( 'show_category' ); ?>"><?php _e( 'Display Category', 'sp-news-and-widget' ); ?></label>
|
88 |
+
</p>
|
89 |
+
|
90 |
+
<p>
|
91 |
+
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category', 'sp-news-and-widget' ); ?>:</label>
|
92 |
+
<?php
|
93 |
+
$dropdown_args = array(
|
94 |
+
'taxonomy' => WPNW_CAT,
|
95 |
+
'show_option_none' => __('All Categories', 'sp-news-and-widget'),
|
96 |
+
'option_none_value' => '',
|
97 |
+
'class' => 'widefat',
|
98 |
+
'id' => $this->get_field_id( 'category' ),
|
99 |
+
'name' => $this->get_field_name( 'category' ),
|
100 |
+
'selected' => $instance['category'],
|
101 |
+
);
|
102 |
+
wp_dropdown_categories( $dropdown_args );
|
103 |
+
?>
|
104 |
+
</p>
|
105 |
+
</div>
|
106 |
+
<?php
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Outputs the content for the current widget instance.
|
111 |
+
*
|
112 |
+
* @package WP News and Scrolling Widgets
|
113 |
+
* @since 1.0
|
114 |
+
*/
|
115 |
+
function widget( $news_args, $instance ) {
|
116 |
+
|
117 |
+
$instance = wp_parse_args( (array)$instance, $this->defaults );
|
118 |
+
extract($news_args, EXTR_SKIP);
|
119 |
+
|
120 |
+
$current_post_name = get_query_var('name');
|
121 |
+
$title = empty( $instance['title'] ) ? '' : apply_filters('widget_title', $instance['title']);
|
122 |
+
$num_items = empty( $instance['num_items'] ) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
123 |
+
|
124 |
+
if ( isset( $instance['date'] ) && ( 1 == $instance['date'] ) ) {
|
125 |
+
$date = "true";
|
126 |
+
} else {
|
127 |
+
$date = "false";
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( isset( $instance['show_category'] ) && ( 1 == $instance['show_category'] ) ) {
|
131 |
+
$show_category = "true";
|
132 |
+
} else {
|
133 |
+
$show_category = "false";
|
134 |
+
}
|
135 |
+
|
136 |
+
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) {
|
137 |
+
$category = intval( $instance['category'] );
|
138 |
+
}
|
139 |
+
|
140 |
+
$postcount = 0;
|
141 |
+
|
142 |
+
echo $before_widget;
|
143 |
+
|
144 |
+
if ( $title ) {
|
145 |
+
echo $before_title . $title . $after_title;
|
146 |
+
}
|
147 |
+
|
148 |
+
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
|
149 |
+
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
|
150 |
+
echo "Latest News";
|
151 |
+
return;
|
152 |
+
}
|
153 |
+
|
154 |
+
// visual-columns
|
155 |
+
$no_p = '';
|
156 |
+
if($date == "false" && $show_category == "false"){
|
157 |
+
$no_p = "no_p";
|
158 |
+
} ?>
|
159 |
+
|
160 |
+
<div class="recent-news-items <?php echo $no_p; ?>">
|
161 |
+
<ul>
|
162 |
+
<?php // setup the query
|
163 |
+
$news_args = array(
|
164 |
+
'posts_per_page' => $num_items,
|
165 |
+
'post_type' => WPNW_POST_TYPE,
|
166 |
+
'post_status' => array( 'publish' ),
|
167 |
+
'order' => 'DESC'
|
168 |
+
);
|
169 |
+
|
170 |
+
if( ! empty( $category ) ) {
|
171 |
+
$news_args['tax_query'] = array(
|
172 |
+
array(
|
173 |
+
'taxonomy' => WPNW_CAT,
|
174 |
+
'field' => 'term_id',
|
175 |
+
'terms' => $category,
|
176 |
+
));
|
177 |
+
}
|
178 |
+
|
179 |
+
$cust_loop = new WP_Query( $news_args );
|
180 |
+
|
181 |
+
global $post;
|
182 |
+
|
183 |
+
$post_count = $cust_loop->post_count;
|
184 |
+
$count = 0;
|
185 |
+
|
186 |
+
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
187 |
+
|
188 |
+
$count++;
|
189 |
+
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
190 |
+
$news_links = array();
|
191 |
+
|
192 |
+
if( $terms ) {
|
193 |
+
foreach ( $terms as $term ) {
|
194 |
+
$term_link = get_term_link( $term );
|
195 |
+
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
196 |
+
}
|
197 |
+
}
|
198 |
+
$cate_name = join( ", ", $news_links ); ?>
|
199 |
+
|
200 |
+
<li class="news_li">
|
201 |
+
<a class="newspost-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
202 |
+
|
203 |
+
<?php if($date == "true" || $show_category == "true"){ ?>
|
204 |
+
<div class="widget-date-post">
|
205 |
+
<?php echo ( $date == "true" ) ? get_the_date() : ""; ?>
|
206 |
+
<?php echo ( $date == "true" && $show_category == "true" && $cate_name != '') ? " , " : ""; ?>
|
207 |
+
<?php echo ( $show_category == 'true' && $cate_name != '') ? $cate_name : ""; ?>
|
208 |
+
</div>
|
209 |
+
<?php } ?>
|
210 |
+
|
211 |
+
</li>
|
212 |
+
|
213 |
+
<?php endwhile;
|
214 |
+
endif;
|
215 |
+
wp_reset_postdata(); ?>
|
216 |
+
</ul>
|
217 |
+
</div>
|
218 |
+
<?php
|
219 |
+
echo $after_widget;
|
220 |
+
}
|
221 |
+
}
|
includes/widgets/class-wpnw-news-scrolling-widget.php
ADDED
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Widget Class
|
4 |
+
*
|
5 |
+
* Handles latest News scrolling widget functionality of plugin
|
6 |
+
*
|
7 |
+
* @package WP News and Scrolling Widgets
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
/* scrolling news */
|
16 |
+
class SP_News_scrolling_Widget extends WP_Widget {
|
17 |
+
|
18 |
+
var $defaults;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Sets up a new widget instance.
|
22 |
+
*
|
23 |
+
* @package WP News and Scrolling Widgets
|
24 |
+
* @since 1.0
|
25 |
+
*/
|
26 |
+
function __construct() {
|
27 |
+
|
28 |
+
$widget_ops = array('classname' => 'SP_News_scrolling_Widget', 'description' => __('Scroll Latest News Items from the News in a sidebar', 'sp-news-and-widget') );
|
29 |
+
$control_ops = array( 'width' => 350, 'height' => 450, 'id_base' => 'sp_news_s_widget' );
|
30 |
+
|
31 |
+
parent::__construct( 'sp_news_s_widget', __('Latest News Scrolling Widget', 'sp-news-and-widget'), $widget_ops, $control_ops );
|
32 |
+
|
33 |
+
$this->defaults = array(
|
34 |
+
'limit' => 5,
|
35 |
+
'title' => __('Latest News Scrolling Widget', 'sp-news-and-widget'),
|
36 |
+
'date' => false,
|
37 |
+
'show_category' => false,
|
38 |
+
'category' => 0,
|
39 |
+
'height' => 400,
|
40 |
+
'pause' => 2000,
|
41 |
+
'speed' => 500,
|
42 |
+
);
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Handles updating settings for the current widget instance.
|
47 |
+
*
|
48 |
+
* @package WP News and Scrolling Widgets
|
49 |
+
* @since 1.0
|
50 |
+
*/
|
51 |
+
function update( $new_instance, $old_instance ) {
|
52 |
+
|
53 |
+
$instance = $old_instance;
|
54 |
+
$instance['title'] = isset( $new_instance['title'] ) ? wpnw_clean( $new_instance['title'] ) : '';
|
55 |
+
$instance['num_items'] = isset( $new_instance['num_items'] ) ? wpnw_clean_number( $new_instance['num_items'], 5, 'number' ) : '';
|
56 |
+
$instance['height'] = isset( $new_instance['height'] ) ? wpnw_clean_number( $new_instance['height'], 400 ) : '';
|
57 |
+
$instance['pause'] = isset( $new_instance['pause'] ) ? wpnw_clean_number( $new_instance['pause'], 2000 ) : '';
|
58 |
+
$instance['speed'] = isset( $new_instance['speed'] ) ? wpnw_clean_number( $new_instance['speed'], 500 ) : '';
|
59 |
+
$instance['category'] = isset( $new_instance['category'] ) ? wpnw_clean_number( $new_instance['category'] ) : '';
|
60 |
+
$instance['date'] = ! empty( $new_instance['date']) ? 1 : 0;
|
61 |
+
$instance['show_category'] = ! empty( $new_instance['show_category'] ) ? 1 : 0;
|
62 |
+
|
63 |
+
return $instance;
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Outputs the settings form for the widget.
|
68 |
+
*
|
69 |
+
* @package WP News and Scrolling Widgets
|
70 |
+
* @since 1.0
|
71 |
+
*/
|
72 |
+
function form( $instance ) {
|
73 |
+
|
74 |
+
$instance = wp_parse_args( (array)$instance, $this->defaults );
|
75 |
+
$num_items = isset( $instance['num_items'] ) ? absint( $instance['num_items'] ) : 5;
|
76 |
+
?>
|
77 |
+
<div class="wpnw-widget-wrap">
|
78 |
+
<p>
|
79 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title', 'sp-news-and-widget' ); ?>:<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /></label>
|
80 |
+
</p>
|
81 |
+
|
82 |
+
<p>
|
83 |
+
<label for="<?php echo $this->get_field_id('num_items'); ?>"><?php _e( 'Number of Items', 'sp-news-and-widget' ); ?>:<input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo esc_attr($num_items); ?>" /></label>
|
84 |
+
</p>
|
85 |
+
|
86 |
+
<p>
|
87 |
+
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox"<?php checked( $instance['date'], 1 ); ?> />
|
88 |
+
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Display Date', 'sp-news-and-widget' ); ?></label>
|
89 |
+
</p>
|
90 |
+
|
91 |
+
<p>
|
92 |
+
<input id="<?php echo $this->get_field_id( 'show_category' ); ?>" name="<?php echo $this->get_field_name( 'show_category' ); ?>" type="checkbox"<?php checked( $instance['show_category'], 1 ); ?> />
|
93 |
+
<label for="<?php echo $this->get_field_id( 'show_category' ); ?>"><?php _e( 'Display Category', 'sp-news-and-widget' ); ?></label>
|
94 |
+
</p>
|
95 |
+
|
96 |
+
<p>
|
97 |
+
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category', 'sp-news-and-widget' ); ?>:</label>
|
98 |
+
<?php
|
99 |
+
$dropdown_args = array(
|
100 |
+
'taxonomy' => WPNW_CAT,
|
101 |
+
'show_option_none' => __('All Categories', 'sp-news-and-widget'),
|
102 |
+
'option_none_value' => '',
|
103 |
+
'class' => 'widefat',
|
104 |
+
'id' => $this->get_field_id( 'category' ),
|
105 |
+
'name' => $this->get_field_name( 'category' ),
|
106 |
+
'selected' => $instance['category'],
|
107 |
+
);
|
108 |
+
wp_dropdown_categories( $dropdown_args );
|
109 |
+
?>
|
110 |
+
</p>
|
111 |
+
|
112 |
+
<p>
|
113 |
+
<label for="<?php echo $this->get_field_id( 'height' ); ?>"><?php _e( 'Height', 'sp-news-and-widget' ); ?>:</label>
|
114 |
+
<input type="text" name="<?php echo $this->get_field_name( 'height' ); ?>" value="<?php echo $instance['height']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'height' ); ?>" min="1" />
|
115 |
+
</p>
|
116 |
+
|
117 |
+
<p>
|
118 |
+
<label for="<?php echo $this->get_field_id( 'pause' ); ?>"><?php _e( 'Pause', 'sp-news-and-widget' ); ?>:</label>
|
119 |
+
<input type="text" name="<?php echo $this->get_field_name( 'pause' ); ?>" value="<?php echo $instance['pause']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'pause' ); ?>" min="1" />
|
120 |
+
</p>
|
121 |
+
|
122 |
+
<p>
|
123 |
+
<label for="<?php echo $this->get_field_id( 'speed' ); ?>"><?php _e( 'Speed', 'sp-news-and-widget' ); ?>:</label>
|
124 |
+
<input type="text" name="<?php echo $this->get_field_name( 'speed' ); ?>" value="<?php echo $instance['speed']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'speed' ); ?>" min="0" />
|
125 |
+
</p>
|
126 |
+
</div>
|
127 |
+
<?php
|
128 |
+
}
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Outputs the content for the current widget instance.
|
132 |
+
*
|
133 |
+
* @package WP News and Scrolling Widgets
|
134 |
+
* @since 1.0
|
135 |
+
*/
|
136 |
+
function widget( $news_args, $instance ) {
|
137 |
+
|
138 |
+
$instance = wp_parse_args( (array)$instance, $this->defaults );
|
139 |
+
|
140 |
+
extract($news_args, EXTR_SKIP);
|
141 |
+
|
142 |
+
$current_post_name = get_query_var('name');
|
143 |
+
$title = empty( $instance['title'] ) ? '' : apply_filters('widget_title', $instance['title']);
|
144 |
+
$num_items = empty( $instance['num_items'] ) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
145 |
+
|
146 |
+
if ( isset( $instance['date'] ) && ( 1 == $instance['date'] ) ) {
|
147 |
+
$date = "true";
|
148 |
+
} else {
|
149 |
+
$date = "false";
|
150 |
+
}
|
151 |
+
|
152 |
+
if ( isset( $instance['show_category'] ) && ( 1 == $instance['show_category'] ) ) {
|
153 |
+
$show_category = "true";
|
154 |
+
} else {
|
155 |
+
$show_category = "false";
|
156 |
+
}
|
157 |
+
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) {
|
158 |
+
$category = intval( $instance['category'] );
|
159 |
+
}
|
160 |
+
|
161 |
+
$height = $instance['height'];
|
162 |
+
$pause = $instance['pause'];
|
163 |
+
$speed = $instance['speed'];
|
164 |
+
|
165 |
+
|
166 |
+
// Enqueue Script
|
167 |
+
wp_enqueue_script('wpos-vticker-jquery');
|
168 |
+
wp_enqueue_script('sp-news-public');
|
169 |
+
|
170 |
+
$slider_conf = compact('height', 'pause', 'speed');
|
171 |
+
$postcount = 0;
|
172 |
+
|
173 |
+
echo $before_widget;
|
174 |
+
|
175 |
+
if ( $title ) {
|
176 |
+
echo $before_title . $title . $after_title;
|
177 |
+
}
|
178 |
+
|
179 |
+
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
|
180 |
+
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
|
181 |
+
echo "Latest News Scrolling Widget";
|
182 |
+
return;
|
183 |
+
}
|
184 |
+
|
185 |
+
$unique_id = wpnw_get_unique();
|
186 |
+
|
187 |
+
// visual-columns
|
188 |
+
$no_p = '';
|
189 |
+
if( $date == "false" && $show_category == "false" ) { $no_p = "no_p"; } ?>
|
190 |
+
<div class="recent-news-items-scroll <?php echo $no_p;?>">
|
191 |
+
<div id="newsticker-jcarousellite-<?php echo $unique_id;?>" class="sp-news-scrolling-slider" data-conf="<?php echo htmlspecialchars(json_encode( $slider_conf )); ?>" >
|
192 |
+
<ul>
|
193 |
+
<?php // setup the query
|
194 |
+
$news_args = array(
|
195 |
+
'posts_per_page' => $num_items,
|
196 |
+
'post_type' => WPNW_POST_TYPE,
|
197 |
+
'post_status' => array( 'publish' ),
|
198 |
+
'order' => 'DESC'
|
199 |
+
);
|
200 |
+
|
201 |
+
if( ! empty( $category ) ) {
|
202 |
+
$news_args['tax_query'] = array(
|
203 |
+
array(
|
204 |
+
'taxonomy' => WPNW_CAT,
|
205 |
+
'field' => 'term_id',
|
206 |
+
'terms' => $category
|
207 |
+
));
|
208 |
+
}
|
209 |
+
$cust_loop = new WP_Query( $news_args );
|
210 |
+
|
211 |
+
global $post;
|
212 |
+
|
213 |
+
$post_count = $cust_loop->post_count;
|
214 |
+
$count = 0;
|
215 |
+
|
216 |
+
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
217 |
+
|
218 |
+
$count++;
|
219 |
+
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
220 |
+
$news_links = array();
|
221 |
+
|
222 |
+
if( $terms ) {
|
223 |
+
|
224 |
+
foreach ( $terms as $term ) {
|
225 |
+
$term_link = get_term_link( $term );
|
226 |
+
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
227 |
+
}
|
228 |
+
}
|
229 |
+
$cate_name = join( ", ", $news_links );
|
230 |
+
?>
|
231 |
+
<li class="news_li">
|
232 |
+
<a class="newspost-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
233 |
+
<?php if($date == "true" || $show_category == "true"){ ?>
|
234 |
+
<div class="widget-date-post">
|
235 |
+
<?php echo ( $date == "true" ) ? get_the_date() : ""; ?>
|
236 |
+
<?php echo ( $date == "true" && $show_category == "true" && $cate_name != '') ? " , " : ""; ?>
|
237 |
+
<?php echo ( $show_category == 'true' && $cate_name != '') ? $cate_name : ""; ?>
|
238 |
+
</div>
|
239 |
+
<?php } ?>
|
240 |
+
</li>
|
241 |
+
<?php endwhile;
|
242 |
+
endif;
|
243 |
+
wp_reset_postdata(); ?>
|
244 |
+
</ul>
|
245 |
+
</div>
|
246 |
+
</div>
|
247 |
+
<?php
|
248 |
+
echo $after_widget;
|
249 |
+
}
|
250 |
+
}
|
includes/widgets/class-wpnw-news-thumbnail-widget.php
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Widget Class
|
4 |
+
*
|
5 |
+
* Handles latest News thumbnail widget functionality of plugin
|
6 |
+
*
|
7 |
+
* @package WP News and Scrolling Widgets
|
8 |
+
* @since 1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
12 |
+
exit; // Exit if accessed directly
|
13 |
+
}
|
14 |
+
|
15 |
+
/* news with thumb */
|
16 |
+
class SP_News_Thumb_Widget extends WP_Widget {
|
17 |
+
|
18 |
+
var $defaults;
|
19 |
+
|
20 |
+
function __construct() {
|
21 |
+
|
22 |
+
$widget_ops = array('classname' => 'SP_News_Thumb_Widget', 'description' => __('Displayed Latest News Items in a sidebar with thumbnails', 'sp-news-and-widget') );
|
23 |
+
$control_ops = array( 'width' => 350, 'height' => 450, 'id_base' => 'sp_news_sthumb_widget' );
|
24 |
+
|
25 |
+
parent::__construct( 'sp_news_sthumb_widget', __('Latest News with Thumb', 'sp-news-and-widget'), $widget_ops, $control_ops );
|
26 |
+
|
27 |
+
$this->defaults = array(
|
28 |
+
'limit' => 5,
|
29 |
+
'title' => __('Latest News with Thumb', 'sp-news-and-widget'),
|
30 |
+
'date' => false,
|
31 |
+
'show_category' => false,
|
32 |
+
'category' => 0,
|
33 |
+
);
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Handles updating settings for the current widget instance.
|
38 |
+
*
|
39 |
+
* @package WP News and Scrolling Widgets
|
40 |
+
* @since 1.0
|
41 |
+
*/
|
42 |
+
function update( $new_instance, $old_instance ) {
|
43 |
+
|
44 |
+
$instance = $old_instance;
|
45 |
+
$instance['title'] = isset( $new_instance['title'] ) ? wpnw_clean( $new_instance['title'] ) : '';
|
46 |
+
$instance['num_items'] = isset( $new_instance['num_items'] ) ? wpnw_clean_number( $new_instance['num_items'], 5, 'number' ) : '';
|
47 |
+
$instance['category'] = isset( $new_instance['category'] ) ? wpnw_clean_number( $new_instance['category'] ) : '';
|
48 |
+
$instance['date'] = ! empty( $new_instance['date']) ? 1 : 0;
|
49 |
+
$instance['show_category'] = ! empty( $new_instance['show_category'] ) ? 1 : 0;
|
50 |
+
|
51 |
+
return $instance;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Outputs the settings form for the widget.
|
56 |
+
*
|
57 |
+
* @package WP News and Scrolling Widgets
|
58 |
+
* @since 1.0
|
59 |
+
*/
|
60 |
+
function form( $instance ) {
|
61 |
+
|
62 |
+
$instance = wp_parse_args( (array)$instance, $this->defaults );
|
63 |
+
$num_items = isset( $instance['num_items'] ) ? absint( $instance['num_items'] ) : 5;
|
64 |
+
?>
|
65 |
+
<div class="wpnw-widget-wrap">
|
66 |
+
<p>
|
67 |
+
<label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title', 'sp-news-and-widget' ); ?>:<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /></label>
|
68 |
+
</p>
|
69 |
+
|
70 |
+
<p>
|
71 |
+
<label for="<?php echo $this->get_field_id('num_items'); ?>"><?php _e( 'Number of Items', 'sp-news-and-widget' ); ?>:<input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo $num_items; ?>" /></label>
|
72 |
+
</p>
|
73 |
+
|
74 |
+
<p>
|
75 |
+
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox" <?php checked( $instance['date'], 1 ); ?> />
|
76 |
+
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Display Date', 'sp-news-and-widget' ); ?></label>
|
77 |
+
</p>
|
78 |
+
|
79 |
+
<p>
|
80 |
+
<input id="<?php echo $this->get_field_id( 'show_category' ); ?>" name="<?php echo $this->get_field_name( 'show_category' ); ?>" type="checkbox" <?php checked( $instance['show_category'], 1 ); ?> />
|
81 |
+
<label for="<?php echo $this->get_field_id( 'show_category' ); ?>"><?php _e( 'Display Category', 'sp-news-and-widget' ); ?></label>
|
82 |
+
</p>
|
83 |
+
|
84 |
+
<p>
|
85 |
+
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category', 'sp-news-and-widget' ); ?>:</label>
|
86 |
+
<?php
|
87 |
+
$dropdown_args = array(
|
88 |
+
'taxonomy' => WPNW_CAT,
|
89 |
+
'show_option_none' => __('All Categories', 'sp-news-and-widget'),
|
90 |
+
'option_none_value' => '',
|
91 |
+
'class' => 'widefat',
|
92 |
+
'id' => $this->get_field_id( 'category' ),
|
93 |
+
'name' => $this->get_field_name( 'category' ),
|
94 |
+
'selected' => $instance['category'],
|
95 |
+
);
|
96 |
+
wp_dropdown_categories( $dropdown_args );
|
97 |
+
?>
|
98 |
+
</p>
|
99 |
+
</div>
|
100 |
+
<?php }
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Outputs the content for the current widget instance.
|
104 |
+
*
|
105 |
+
* @package WP News and Scrolling Widgets
|
106 |
+
* @since 1.0
|
107 |
+
*/
|
108 |
+
function widget( $news_args, $instance ) {
|
109 |
+
|
110 |
+
$instance = wp_parse_args( (array)$instance, $this->defaults );
|
111 |
+
extract($news_args, EXTR_SKIP);
|
112 |
+
|
113 |
+
$current_post_name = get_query_var('name');
|
114 |
+
|
115 |
+
$title = empty( $instance['title'] ) ? '' : apply_filters('widget_title', $instance['title']);
|
116 |
+
$num_items = empty( $instance['num_items'] ) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
117 |
+
|
118 |
+
if ( isset( $instance['date'] ) && ( 1 == $instance['date'] ) ) {
|
119 |
+
$date = "true";
|
120 |
+
} else {
|
121 |
+
$date = "false";
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( isset( $instance['show_category'] ) && ( 1 == $instance['show_category'] ) ) {
|
125 |
+
$show_category = "true";
|
126 |
+
} else {
|
127 |
+
$show_category = "false";
|
128 |
+
}
|
129 |
+
|
130 |
+
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) {
|
131 |
+
$category = intval( $instance['category'] );
|
132 |
+
}
|
133 |
+
|
134 |
+
$postcount = 0;
|
135 |
+
|
136 |
+
echo $before_widget;
|
137 |
+
|
138 |
+
if ( $title ) {
|
139 |
+
echo $before_title . $title . $after_title;
|
140 |
+
}
|
141 |
+
|
142 |
+
// SiteOrigin Page Builder Gutenberg Block Tweak - Do not Display Preview
|
143 |
+
if( isset( $_POST['action'] ) && ( $_POST['action'] == 'so_panels_layout_block_preview' || $_POST['action'] == 'so_panels_builder_content_json' ) ) {
|
144 |
+
echo "Latest News with Thumb";
|
145 |
+
return;
|
146 |
+
}
|
147 |
+
|
148 |
+
$no_p = '';
|
149 |
+
if( $date == "false" && $show_category == "false" ) {
|
150 |
+
$no_p = "no_p";
|
151 |
+
} ?>
|
152 |
+
|
153 |
+
<div class="recent-news-items <?php echo $no_p;?>">
|
154 |
+
|
155 |
+
<ul>
|
156 |
+
<?php // setup the query
|
157 |
+
$news_args = array(
|
158 |
+
'posts_per_page' => $num_items,
|
159 |
+
'post_type' => WPNW_POST_TYPE,
|
160 |
+
'post_status' => array( 'publish' ),
|
161 |
+
'order' => 'DESC'
|
162 |
+
);
|
163 |
+
|
164 |
+
if( ! empty( $category ) ) {
|
165 |
+
$news_args['tax_query'] = array(
|
166 |
+
array(
|
167 |
+
'taxonomy' => WPNW_CAT,
|
168 |
+
'field' => 'term_id',
|
169 |
+
'terms' => $category
|
170 |
+
));
|
171 |
+
}
|
172 |
+
|
173 |
+
$cust_loop = new WP_Query( $news_args );
|
174 |
+
|
175 |
+
global $post;
|
176 |
+
$post_count = $cust_loop->post_count;
|
177 |
+
$count = 0;
|
178 |
+
|
179 |
+
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
180 |
+
|
181 |
+
$count++;
|
182 |
+
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
183 |
+
$news_links = array();
|
184 |
+
|
185 |
+
if( $terms ) {
|
186 |
+
foreach ( $terms as $term ) {
|
187 |
+
$term_link = get_term_link( $term );
|
188 |
+
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
189 |
+
}
|
190 |
+
}
|
191 |
+
|
192 |
+
$cate_name = join( ", ", $news_links ); ?>
|
193 |
+
|
194 |
+
<li class="news_li">
|
195 |
+
<div class="news_thumb_left">
|
196 |
+
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
197 |
+
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
|
198 |
+
the_post_thumbnail( array(80,80) );
|
199 |
+
} ?>
|
200 |
+
</a>
|
201 |
+
</div>
|
202 |
+
<div class="news_thumb_right">
|
203 |
+
<a class="newspost-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
204 |
+
<?php if($date == "true" || $show_category == "true"){ ?>
|
205 |
+
<div class="widget-date-post">
|
206 |
+
<?php echo ( $date == "true" ) ? get_the_date() : ""; ?>
|
207 |
+
<?php echo ( $date == "true" && $show_category == "true" && $cate_name != '') ? " , " : ""; ?>
|
208 |
+
<?php echo ( $show_category == 'true' && $cate_name != '') ? $cate_name : ""; ?>
|
209 |
+
</div>
|
210 |
+
<?php } ?>
|
211 |
+
</div>
|
212 |
+
</li>
|
213 |
+
<?php endwhile;
|
214 |
+
endif;
|
215 |
+
wp_reset_postdata(); ?>
|
216 |
+
</ul>
|
217 |
+
</div>
|
218 |
+
<?php
|
219 |
+
echo $after_widget;
|
220 |
+
}
|
221 |
+
}
|
includes/widgets/wpnw-widgets.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Widget Functionality
|
4 |
+
*
|
5 |
+
* @package WP News and Scrolling Widgets
|
6 |
+
* @since 1.0
|
7 |
+
*/
|
8 |
+
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit; // Exit if accessed directly
|
11 |
+
}
|
12 |
+
|
13 |
+
// Widget Class
|
14 |
+
require_once( WPNW_DIR . '/includes/widgets/class-wpnw-latest-news-widget.php' );
|
15 |
+
require_once( WPNW_DIR . '/includes/widgets/class-wpnw-news-scrolling-widget.php' );
|
16 |
+
require_once( WPNW_DIR . '/includes/widgets/class-wpnw-news-thumbnail-widget.php' );
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Register Plugin Widgets
|
20 |
+
*/
|
21 |
+
function wpnw_pro_register_widgets() {
|
22 |
+
register_widget( 'SP_News_Widget' );
|
23 |
+
register_widget( 'SP_News_scrolling_Widget' );
|
24 |
+
register_widget( 'SP_News_Thumb_Widget' );
|
25 |
+
}
|
26 |
+
add_action( 'widgets_init', 'wpnw_pro_register_widgets' );
|
languages/sp-news-and-widget-en_US-wpnw-block-js.json
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
{"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=2; plural=n != 1;","lang":"en_US"},"https://github.com/ahmadawais/create-guten-block/":[null,""],"https://www.wponlinesupport.com":[null,""],"WP News and Scrolling Widgets - Gutenberg":[null,""],"WP News and Scrolling Widgets Gutenberg.":[null,""],"WP OnlineSupport":[null,""],"WPOS Blocks":[null,""]}}}
|
languages/sp-news-and-widget.pot
ADDED
@@ -0,0 +1,376 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#, fuzzy
|
2 |
+
msgid ""
|
3 |
+
msgstr ""
|
4 |
+
"Project-Id-Version: WP News and Scrolling Widgets\n"
|
5 |
+
"Report-Msgid-Bugs-To: \n"
|
6 |
+
"POT-Creation-Date: 2020-08-28 09:58+0000\n"
|
7 |
+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
8 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
+
"Language-Team: \n"
|
10 |
+
"Language: \n"
|
11 |
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
12 |
+
"MIME-Version: 1.0\n"
|
13 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
+
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Loco https://localise.biz/\n"
|
16 |
+
"X-Loco-Version: 2.4.2; wp-5.5"
|
17 |
+
|
18 |
+
#: includes/admin/wpnw-how-it-work.php:262
|
19 |
+
msgid "5 stars!"
|
20 |
+
msgstr ""
|
21 |
+
|
22 |
+
#: includes/admin/wpnw-how-it-work.php:183
|
23 |
+
msgid ""
|
24 |
+
"<b>Please make sure that Permalink link should not be \"/news\" Otherwise "
|
25 |
+
"all your news will go to archive page. You can give it other name like "
|
26 |
+
"\"/ournews, /latestnews etc\"</b>"
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#. Description of the plugin
|
30 |
+
msgid ""
|
31 |
+
"A simple News and three widgets(static, scrolling and with thumbs) plugin. "
|
32 |
+
"Also work with Gutenberg shortcode block."
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: includes/sp-news-post-type.php:64
|
36 |
+
msgid "Add New Category"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: includes/sp-news-post-type.php:16
|
40 |
+
msgid "Add New News Item"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: includes/sp-news-post-type.php:24
|
44 |
+
msgctxt "admin menu"
|
45 |
+
msgid "News"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:98
|
49 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:101
|
50 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:108
|
51 |
+
msgid "All Categories"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: includes/sp-news-post-type.php:59
|
55 |
+
msgid "All Category"
|
56 |
+
msgstr ""
|
57 |
+
|
58 |
+
#: includes/admin/wpnw-how-it-work.php:191
|
59 |
+
msgid "All Shortcodes"
|
60 |
+
msgstr ""
|
61 |
+
|
62 |
+
#: includes/sp-news-post-type.php:66
|
63 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:94
|
64 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:97
|
65 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:104
|
66 |
+
msgid "Category"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: includes/admin/wpnw-how-it-work.php:206
|
70 |
+
msgid "Check plugin document for shortcode parameters and demo for designs."
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: includes/admin/wpnw-how-it-work.php:208
|
74 |
+
msgid "Demo for Designs"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:90
|
78 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:93
|
79 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:100
|
80 |
+
msgid "Display Category"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:85
|
84 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:88
|
85 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:95
|
86 |
+
msgid "Display Date"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: includes/admin/wpnw-how-it-work.php:195
|
90 |
+
msgid "Display News in grid 1"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: includes/admin/wpnw-how-it-work.php:196
|
94 |
+
msgid "Display News in grid 2"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: includes/admin/wpnw-how-it-work.php:197
|
98 |
+
msgid "Display News in grid 3"
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:34
|
102 |
+
msgid "Displayed Latest News Items from the News in a sidebar"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:30
|
106 |
+
msgid "Displayed Latest News Items in a sidebar with thumbnails"
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: includes/admin/wpnw-how-it-work.php:207
|
110 |
+
msgid "Documentation"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: includes/sp-news-post-type.php:62
|
114 |
+
msgid "Edit Category"
|
115 |
+
msgstr ""
|
116 |
+
|
117 |
+
#: includes/sp-news-post-type.php:17
|
118 |
+
msgid "Edit News Item"
|
119 |
+
msgstr ""
|
120 |
+
|
121 |
+
#: includes/admin/wpnw-how-it-work.php:262
|
122 |
+
msgid "Enjoyed this plugin? You can help by rate this plugin "
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: includes/admin/wpnw-how-it-work.php:251
|
126 |
+
msgid ""
|
127 |
+
"Gain access to <strong>WP News and Scrolling Widgets</strong> included in "
|
128 |
+
"<br /><strong>Essential Plugin Bundle"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: includes/admin/wpnw-how-it-work.php:163
|
132 |
+
msgid "Geeting Started"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: includes/admin/wpnw-how-it-work.php:252
|
136 |
+
msgid "Go Premium "
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:120
|
140 |
+
msgid "Height"
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: includes/admin/wpnw-how-it-work.php:259
|
144 |
+
msgid "Help to improve this plugin!"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: includes/admin/settings/hire-us.php:18
|
148 |
+
msgid "Highlight of Hiring:"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: includes/admin/class-wpnw-admin.php:44
|
152 |
+
msgid "Hire Us"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: includes/admin/settings/hire-us.php:15
|
156 |
+
msgid "Hire Us - Get unlimited expert WordPress Support and Development"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: includes/admin/wpnw-how-it-work.php:22
|
160 |
+
#: includes/admin/wpnw-how-it-work.php:117
|
161 |
+
msgid "How It Works"
|
162 |
+
msgstr ""
|
163 |
+
|
164 |
+
#: includes/admin/wpnw-how-it-work.php:155
|
165 |
+
msgid "How It Works - Display and Shortcode"
|
166 |
+
msgstr ""
|
167 |
+
|
168 |
+
#: includes/admin/wpnw-how-it-work.php:22
|
169 |
+
msgid "How it works - WP News and Scrolling Widgets"
|
170 |
+
msgstr ""
|
171 |
+
|
172 |
+
#: includes/admin/wpnw-how-it-work.php:178
|
173 |
+
msgid "How Shortcode Works"
|
174 |
+
msgstr ""
|
175 |
+
|
176 |
+
#. Author URI of the plugin
|
177 |
+
msgid "https://www.wponlinesupport.com"
|
178 |
+
msgstr ""
|
179 |
+
|
180 |
+
#: sp-news-and-widget.php:152
|
181 |
+
#, php-format
|
182 |
+
msgid ""
|
183 |
+
"It looks like you had PRO version %s of this plugin activated. To avoid "
|
184 |
+
"conflicts the extra version has been deactivated and we recommend you delete "
|
185 |
+
"it."
|
186 |
+
msgstr ""
|
187 |
+
|
188 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:42
|
189 |
+
msgid "Latest News"
|
190 |
+
msgstr ""
|
191 |
+
|
192 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:39
|
193 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:43
|
194 |
+
msgid "Latest News Scrolling Widget"
|
195 |
+
msgstr ""
|
196 |
+
|
197 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:38
|
198 |
+
msgid "Latest News Widget"
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:33
|
202 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:37
|
203 |
+
msgid "Latest News with thumb"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: includes/admin/wpnw-how-it-work.php:203
|
207 |
+
msgid "Need Support?"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: includes/sp-news-post-type.php:65
|
211 |
+
msgid "New Category Name"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: includes/sp-news-post-type.php:18
|
215 |
+
msgid "New News Item"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: includes/admin/wpnw-how-it-work.php:194
|
219 |
+
msgid "News in List View"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: includes/shortcode/sp-news-shortcode.php:179
|
223 |
+
msgid "Next"
|
224 |
+
msgstr ""
|
225 |
+
|
226 |
+
#: includes/functions.php:87
|
227 |
+
msgid "Next »"
|
228 |
+
msgstr ""
|
229 |
+
|
230 |
+
#: includes/sp-news-post-type.php:21
|
231 |
+
msgid "No News Items found"
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
#: includes/sp-news-post-type.php:22
|
235 |
+
msgid "No News Items found in Trash"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:80
|
239 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:83
|
240 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:90
|
241 |
+
msgid "Number of Items"
|
242 |
+
msgstr ""
|
243 |
+
|
244 |
+
#: includes/admin/wpnw-how-it-work.php:120
|
245 |
+
msgid "Our Plugins"
|
246 |
+
msgstr ""
|
247 |
+
|
248 |
+
#: includes/sp-news-post-type.php:60
|
249 |
+
msgid "Parent Category"
|
250 |
+
msgstr ""
|
251 |
+
|
252 |
+
#: includes/sp-news-post-type.php:61
|
253 |
+
msgid "Parent Category:"
|
254 |
+
msgstr ""
|
255 |
+
|
256 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:125
|
257 |
+
msgid "Pause"
|
258 |
+
msgstr ""
|
259 |
+
|
260 |
+
#: includes/shortcode/sp-news-shortcode.php:180
|
261 |
+
msgid "Previous"
|
262 |
+
msgstr ""
|
263 |
+
|
264 |
+
#: includes/shortcode/sp-news-shortcode.php:162
|
265 |
+
msgid "Read More"
|
266 |
+
msgstr ""
|
267 |
+
|
268 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:36
|
269 |
+
msgid "Scroll Latest News Items from the News in a sidebar"
|
270 |
+
msgstr ""
|
271 |
+
|
272 |
+
#: includes/sp-news-post-type.php:20
|
273 |
+
msgid "Search News Items"
|
274 |
+
msgstr ""
|
275 |
+
|
276 |
+
#: includes/sp-news-post-type.php:58
|
277 |
+
msgid "Search Category"
|
278 |
+
msgstr ""
|
279 |
+
|
280 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:130
|
281 |
+
msgid "Speed"
|
282 |
+
msgstr ""
|
283 |
+
|
284 |
+
#: includes/admin/wpnw-how-it-work.php:182
|
285 |
+
msgid "Step-1. Create a page like Our News OR Latest News."
|
286 |
+
msgstr ""
|
287 |
+
|
288 |
+
#: includes/admin/wpnw-how-it-work.php:167
|
289 |
+
msgid ""
|
290 |
+
"Step-1: This plugin create a News menu tab in WordPress menu with custom "
|
291 |
+
"post type."
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
#: includes/admin/wpnw-how-it-work.php:184
|
295 |
+
msgid "Step-2. Put below shortcode as per your need."
|
296 |
+
msgstr ""
|
297 |
+
|
298 |
+
#: includes/admin/wpnw-how-it-work.php:168
|
299 |
+
msgid "Step-2: Go to \"News > Add news item tab\"."
|
300 |
+
msgstr ""
|
301 |
+
|
302 |
+
#: includes/admin/wpnw-how-it-work.php:169
|
303 |
+
msgid ""
|
304 |
+
"Step-3: Add news title, description, category, and image as featured image."
|
305 |
+
msgstr ""
|
306 |
+
|
307 |
+
#: includes/admin/wpnw-how-it-work.php:170
|
308 |
+
msgid "Step-4: Repeat this process and add multiple news item."
|
309 |
+
msgstr ""
|
310 |
+
|
311 |
+
#: includes/admin/wpnw-how-it-work.php:171
|
312 |
+
msgid ""
|
313 |
+
"Step-4: To display news category wise you can use category shortcode under "
|
314 |
+
"\"News > News category\""
|
315 |
+
msgstr ""
|
316 |
+
|
317 |
+
#: sp-news-and-widget.php:151
|
318 |
+
#, php-format
|
319 |
+
msgid "Thank you for activating %s"
|
320 |
+
msgstr ""
|
321 |
+
|
322 |
+
#: includes/admin/wpnw-how-it-work.php:102
|
323 |
+
msgid ""
|
324 |
+
"There was an error retrieving the data from the server. Please try again "
|
325 |
+
"later."
|
326 |
+
msgstr ""
|
327 |
+
|
328 |
+
#: includes/widgets/class-wpnw-news-thumbnail-widget.php:76
|
329 |
+
#: includes/widgets/class-wpnw-latest-news-widget.php:79
|
330 |
+
#: includes/widgets/class-wpnw-news-scrolling-widget.php:86
|
331 |
+
msgid "Title"
|
332 |
+
msgstr ""
|
333 |
+
|
334 |
+
#: includes/sp-news-post-type.php:63
|
335 |
+
msgid "Update Category"
|
336 |
+
msgstr ""
|
337 |
+
|
338 |
+
#: includes/admin/class-wpnw-admin.php:41
|
339 |
+
msgid "Upgrade to PRO"
|
340 |
+
msgstr ""
|
341 |
+
|
342 |
+
#: includes/admin/class-wpnw-admin.php:41
|
343 |
+
msgid "Upgrade to PRO - WP News and Scrolling Widgets"
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: includes/admin/wpnw-how-it-work.php:224
|
347 |
+
msgid "Upgrate to Pro"
|
348 |
+
msgstr ""
|
349 |
+
|
350 |
+
#: includes/sp-news-post-type.php:19
|
351 |
+
msgid "View News Item"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
#: includes/admin/wpnw-how-it-work.php:253
|
355 |
+
msgid "View PRO Demo "
|
356 |
+
msgstr ""
|
357 |
+
|
358 |
+
#. Name of the plugin
|
359 |
+
msgid "WP News and Scrolling Widgets"
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: includes/admin/settings/premium.php:15
|
363 |
+
msgid "WP News and Scrolling Widgets - Features"
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#. Author of the plugin
|
367 |
+
msgid "WP OnlineSupport"
|
368 |
+
msgstr ""
|
369 |
+
|
370 |
+
#: includes/admin/supports/gutenberg-block.php:137
|
371 |
+
msgid "WPOS Blocks"
|
372 |
+
msgstr ""
|
373 |
+
|
374 |
+
#: includes/functions.php:86
|
375 |
+
msgid "« Previous"
|
376 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -1,35 +1,35 @@
|
|
1 |
=== WP News and Scrolling Widgets ===
|
2 |
Contributors: wponlinesupport, anoopranawat, pratik-jain
|
3 |
-
Tags:
|
4 |
Requires at least: 4.0
|
5 |
-
Tested up to: 5.
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
-
A quick, easy way to add
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
Dynamic & easy-to-use WP news and Scrolling Widget.
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
View [Masonry Add-on](https://www.wponlinesupport.com/wordpress-plugin-addon/masonry-addon-wp-news-widgets/) with 12 designs and 7 effects.
|
21 |
|
22 |
-
Also work with Gutenberg shortcode block
|
23 |
|
24 |
= Important Note For How to Install =
|
25 |
|
26 |
-
> Please make sure that Permalink link should not be "/news" Otherwise all your news will go to archive page. You can give it other
|
27 |
|
28 |
-
**As this
|
29 |
|
30 |
<code>apply_filters( 'sp_news_registered_post_type_args', $news_args ); </code>
|
31 |
|
32 |
-
**Now you can Display news post with the help of
|
33 |
|
34 |
<code> [sp_news] </code>
|
35 |
|
@@ -53,7 +53,7 @@ Arts news
|
|
53 |
|
54 |
**Added Widget Options like Show News date, Show News Categories, Select News Categories.**
|
55 |
|
56 |
-
**Template code
|
57 |
|
58 |
<code><?php echo do_shortcode('[sp_news]'); ?></code>
|
59 |
|
@@ -70,16 +70,18 @@ Arts news
|
|
70 |
* **show_full_content :** [sp_news show_full_content="true"] (Display Full news content on main page if you do not want word limit. By default value is "false")
|
71 |
* **show_category_name :** [sp_news show_category_name="true" ] (Display News category name OR not. By default value is "True". Options are "ture OR false").
|
72 |
* **content_words_limit :** [sp_news content_words_limit="30" ] (Control News short content Words limt. By default limit is 20 words).
|
|
|
|
|
73 |
|
74 |
The plugin adds a News tab to your admin menu, which allows you to enter news items just as you would regular posts.
|
75 |
|
76 |
-
If you are getting any kind of
|
77 |
-
first select "Default" and save then again select "Custom Structure " and save.
|
78 |
|
79 |
= The Plugin Features (latest added) : =
|
80 |
* Added List view <code>[sp_news grid="list"] </code>
|
81 |
* Added translation in German, French (France), Polish languages (Beta)
|
82 |
-
* Widget News Scrolling setting page removed and added setting in widget only.
|
83 |
* Added Widget Options like Show News date, Show News Categories, Select News Categories.
|
84 |
* Category wise News <code> Sports news [sp_news category="category_id"] </code>
|
85 |
* Display News with Grid <code>[sp_news grid="2"]</code> and List <code>[sp_news grid="list"]</code>
|
@@ -104,6 +106,7 @@ first select "Default" and save then again select "Custom Structure " and save.
|
|
104 |
> * 8 Designs for News List View.
|
105 |
> * 13 Designs News Grid Box.
|
106 |
> * 8 Designs News Grid Box Slider.
|
|
|
107 |
> * WPBakery Page Builder Support
|
108 |
> * News Ticker.
|
109 |
> * 7 different types of Latest News widgets.
|
@@ -127,23 +130,24 @@ first select "Default" and save then again select "Custom Structure " and save.
|
|
127 |
> View [Masonry Add-on](http://wponlinesupport.com/wordpress-plugin-addon/masonry-addon-wp-news-widgets/) with 12 designs and 7 effects.
|
128 |
>
|
129 |
|
130 |
-
=
|
131 |
-
[youtube https://www.youtube.com/watch?v=
|
|
|
|
|
|
|
132 |
|
133 |
= Privacy & Policy =
|
134 |
-
* We have also opt-in e-mail selection
|
135 |
|
136 |
== Installation ==
|
137 |
|
138 |
1. Upload the 'sp-news-and-widget' folder to the '/wp-content/plugins/' directory.
|
139 |
1. Activate the SP News plugin through the 'Plugins' menu in WordPress.
|
140 |
1. Add and manage news items on your site by clicking on the 'News' tab that appears in your admin menu.
|
141 |
-
1. Create a page with the any name and paste this
|
142 |
|
143 |
-
= How to install
|
144 |
-
[youtube https://www.youtube.com/watch?v=07IRBn1oXrU]
|
145 |
-
|
146 |
-
|
147 |
|
148 |
== Frequently Asked Questions ==
|
149 |
|
@@ -153,19 +157,19 @@ Just add this code in your theme function.php file to enable/disable Gutenberg e
|
|
153 |
|
154 |
<code>
|
155 |
function prefix_gutenberg_editor_support($news_args){
|
156 |
-
|
157 |
-
|
158 |
}
|
159 |
add_filter( 'sp_news_registered_post_type_args', 'prefix_gutenberg_editor_support' );
|
160 |
</code>
|
161 |
|
162 |
= Do I need to update my permalinks after I activate this plugin? =
|
163 |
|
164 |
-
No, not usually. But if you are
|
165 |
|
166 |
-
= I am getting 404 page
|
167 |
|
168 |
-
If you are getting this error, please go to Setting --> Permalinks and under Permalinks Setting select "Plain" radio button and save. Now again go to "Post name" radio button and save again. This will fix your issue.
|
169 |
|
170 |
= Are there shortcodes for news items? =
|
171 |
|
@@ -174,18 +178,33 @@ Yse <code> [sp_news] </code>
|
|
174 |
== Screenshots ==
|
175 |
|
176 |
1. Display News with grid view
|
177 |
-
2. A
|
178 |
-
3. Display News with List view
|
179 |
4. Add new news
|
180 |
5. Single News view
|
181 |
6. Widgets
|
182 |
7. Widgets Options
|
183 |
-
8. Also work with Gutenberg shortcode block.
|
184 |
|
185 |
== Changelog ==
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
= 4.2 (05, June 2019) =
|
188 |
-
* [*] Fixed some
|
189 |
* [*] Updated plugin document link.
|
190 |
* [*] Updated plugin demo link.
|
191 |
|
@@ -193,13 +212,13 @@ Yse <code> [sp_news] </code>
|
|
193 |
* [*] Minor change in Opt-in flow.
|
194 |
|
195 |
= 4.1.3 (20, Dec 2018) =
|
196 |
-
* [*] Fixed the issue where custom taxonomies
|
197 |
|
198 |
= 4.1.2 (18, Dec 2018) =
|
199 |
* [*] Update Opt-in flow.
|
200 |
|
201 |
-
= 4.1.1 (13
|
202 |
-
* [+] If you are using WordPress 5.0 OR WordPress 5.0 plus
|
203 |
|
204 |
= 4.1 (06-12-2018) =
|
205 |
* [*] Tested with WordPress 5.0 and Gutenberg.
|
@@ -210,29 +229,29 @@ Yse <code> [sp_news] </code>
|
|
210 |
* [*] Fix - Some warnings with widgets while using with WordPress customizer.
|
211 |
* [*] Tweak - Used 'wp_reset_postdata' instead of 'wp_reset_query'.
|
212 |
|
213 |
-
= 4.0.2 (04 June 2018) =
|
214 |
* [*] Follow some WordPress Detailed Plugin Guidelines.
|
215 |
|
216 |
-
= 4.0.1 (07 May 2018) =
|
217 |
* [*] Taken batter care in list design if featured image not added.
|
218 |
-
* [*] Fixed grid-1 issues, where grid was loading actual image path.
|
219 |
-
* [*] Fixed some design issues
|
220 |
|
221 |
-
= 4.0 (30 March 2018) =
|
222 |
-
* [*] Fixed some design issues
|
223 |
-
* [*] Modified plugin file structure
|
224 |
-
* [*] Tested with WordPress 4.9.4
|
225 |
|
226 |
-
= 3.3.4 (29 July 2017) =
|
227 |
-
* [+] Added prefix to some
|
228 |
|
229 |
-
= 3.3.2 (19 June 2017) =
|
230 |
-
* [*] Resolved displaying multiple scrolling widget
|
231 |
|
232 |
-
= 3.3.1 (19 May 2017) =
|
233 |
-
* [*] Resolved WPML language translate issue while news is being displayed with taxonomy.
|
234 |
* [*] Updated 'How it Work' page.
|
235 |
-
* [*] Resolved post status issue. Now only 'Published'
|
236 |
|
237 |
= 3.3 (15/02/2017) =
|
238 |
* [+] Added new shortcode parameter "pagination_type" (Select the pagination type for News ie "numeric" OR "next-prev" ).
|
@@ -243,42 +262,42 @@ Yse <code> [sp_news] </code>
|
|
243 |
= 3.2.10 (28/10/2016) =
|
244 |
* [+] Added "How it Work" tab.
|
245 |
* [-] Removed Pro design tab.
|
246 |
-
* Fixed some
|
247 |
|
248 |
= 3.2.9 (10/17/2016) =
|
249 |
-
* [+] Added design to
|
250 |
* [+] Added design for widgets section.
|
251 |
-
* Fixed some
|
252 |
|
253 |
= 3.2.8 =
|
254 |
* Fixed image display issue.
|
255 |
-
* Fixed some
|
256 |
-
*
|
257 |
|
258 |
= 3.2.7 =
|
259 |
-
* Added excerpt functionality in post description.
|
260 |
* Resolved display post content issue.
|
261 |
|
262 |
= 3.2.6 =
|
263 |
-
* Fixed some
|
264 |
* Updated PRO plugin design page.
|
265 |
|
266 |
= 3.2.5 =
|
267 |
-
* Fixed some
|
268 |
|
269 |
= 3.2.4 =
|
270 |
-
* Added translation in German, French (France), Polish languages (Beta)
|
271 |
-
* Fixed some bug
|
272 |
-
* Added 2 new design for pro version
|
273 |
|
274 |
= 3.2.3 =
|
275 |
-
* Added textdomain
|
276 |
-
* Widget scrolling setting page
|
277 |
-
* Fixed some bug
|
278 |
|
279 |
= 3.2.2 =
|
280 |
-
* Added Pro version
|
281 |
-
* Fixed some bugs
|
282 |
|
283 |
= 3.2.1 =
|
284 |
* Added new shortcode parameters show_date.
|
@@ -288,31 +307,31 @@ Yse <code> [sp_news] </code>
|
|
288 |
* Widget Options like Show News date, Show News Categories, Select News Categories.
|
289 |
|
290 |
= 3.1.1 =
|
291 |
-
* Solved categories bug
|
292 |
|
293 |
= 3.1 =
|
294 |
-
* Added new shortcode parameters ie show_content, show_category_name and content_words_limit
|
295 |
-
* Fixed some bug
|
296 |
|
297 |
= 3.0 =
|
298 |
-
* Display News with List view
|
299 |
-
* Display News with Grid [sp_news grid="2"]
|
300 |
-
* Added pagination [sp_news limit="10"]
|
301 |
|
302 |
= 2.2.1 =
|
303 |
-
*
|
304 |
|
305 |
= 2.2 =
|
306 |
-
* Call the news post with shortcode
|
307 |
-
* Call the news post with category wise
|
308 |
|
309 |
= 2.1 =
|
310 |
-
* Scroll main page news
|
311 |
-
* Setting page for
|
312 |
-
* Setting page for main news page vertical and horizontal news scrolling
|
313 |
|
314 |
= 2.0 =
|
315 |
-
* Added Vertical and horizontal news scrolling widget with setting page
|
316 |
* New UI designs
|
317 |
* Admin setting page
|
318 |
|
1 |
=== WP News and Scrolling Widgets ===
|
2 |
Contributors: wponlinesupport, anoopranawat, pratik-jain
|
3 |
+
Tags: WordPress news plugin, news website, main news page scrolling , wordpress vertical news plugin widget, WordPress horizontal news plugin widget, Free scrolling news WordPress plugin, Free scrolling news widget WordPress plugin, WordPress set post or page as news, WordPress dynamic news, news, latest news, custom post type, CPT, widget, vertical news scrolling widget, news widget, wponlinesupport
|
4 |
Requires at least: 4.0
|
5 |
+
Tested up to: 5.5.1
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
+
A quick, easy way to add a News custom post type, News widget, vertical scrolling news widget to WordPress. Also, work with the Gutenberg shortcode block.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
Dynamic & easy-to-use WP news and Scrolling Widget.
|
15 |
|
16 |
+
The website’s performance is the most significant thing for any online business owner. WP News and Scrolling Widget are one of the ways to effectively increase the dynamics of the online webspace with news archives, scrolling news widgets, and thumbnails. Add, manage, and remove the news section on your CMS website.
|
17 |
|
18 |
+
Check [Demo and Features](https://demo.wponlinesupport.com/sp-news/) for additional information.
|
19 |
|
20 |
View [Masonry Add-on](https://www.wponlinesupport.com/wordpress-plugin-addon/masonry-addon-wp-news-widgets/) with 12 designs and 7 effects.
|
21 |
|
22 |
+
**Also work with Gutenberg shortcode block**.
|
23 |
|
24 |
= Important Note For How to Install =
|
25 |
|
26 |
+
> Please make sure that the Permalink link should not be "/news" Otherwise all your news will go to the archive page. You can give it other names like "/ournews, /latestnews, etc"**
|
27 |
|
28 |
+
**As this plugin is created with custom post type, you can now add Gutenberg editor support for the plugin for writing the news post. For that, we have added apply_filters. For more details please check the plugin FAQ section.**
|
29 |
|
30 |
<code>apply_filters( 'sp_news_registered_post_type_args', $news_args ); </code>
|
31 |
|
32 |
+
**Now you can Display news post with the help of shortcode:**
|
33 |
|
34 |
<code> [sp_news] </code>
|
35 |
|
53 |
|
54 |
**Added Widget Options like Show News date, Show News Categories, Select News Categories.**
|
55 |
|
56 |
+
**Template code:**
|
57 |
|
58 |
<code><?php echo do_shortcode('[sp_news]'); ?></code>
|
59 |
|
70 |
* **show_full_content :** [sp_news show_full_content="true"] (Display Full news content on main page if you do not want word limit. By default value is "false")
|
71 |
* **show_category_name :** [sp_news show_category_name="true" ] (Display News category name OR not. By default value is "True". Options are "ture OR false").
|
72 |
* **content_words_limit :** [sp_news content_words_limit="30" ] (Control News short content Words limt. By default limit is 20 words).
|
73 |
+
* **Order:** [sp_news order="DESC"] (News order ie DESC or ASC).
|
74 |
+
* **Order by**: [sp_news orderby="date"] (Order by news ie date, ID, author, title, modified, rand and menu_order etc).
|
75 |
|
76 |
The plugin adds a News tab to your admin menu, which allows you to enter news items just as you would regular posts.
|
77 |
|
78 |
+
If you are getting any kind of problem with the news page means you are not able to see all news items then please remodify your permalinks Structure for example
|
79 |
+
first, select "Default" and save then again select "Custom Structure " and save.
|
80 |
|
81 |
= The Plugin Features (latest added) : =
|
82 |
* Added List view <code>[sp_news grid="list"] </code>
|
83 |
* Added translation in German, French (France), Polish languages (Beta)
|
84 |
+
* Widget News Scrolling setting page removed and added a setting in widget only.
|
85 |
* Added Widget Options like Show News date, Show News Categories, Select News Categories.
|
86 |
* Category wise News <code> Sports news [sp_news category="category_id"] </code>
|
87 |
* Display News with Grid <code>[sp_news grid="2"]</code> and List <code>[sp_news grid="list"]</code>
|
106 |
> * 8 Designs for News List View.
|
107 |
> * 13 Designs News Grid Box.
|
108 |
> * 8 Designs News Grid Box Slider.
|
109 |
+
> * Gutenberg Block Supports.
|
110 |
> * WPBakery Page Builder Support
|
111 |
> * News Ticker.
|
112 |
> * 7 different types of Latest News widgets.
|
130 |
> View [Masonry Add-on](http://wponlinesupport.com/wordpress-plugin-addon/masonry-addon-wp-news-widgets/) with 12 designs and 7 effects.
|
131 |
>
|
132 |
|
133 |
+
= Features : =
|
134 |
+
[youtube https://www.youtube.com/watch?v=C_PSgY6StpQ]
|
135 |
+
|
136 |
+
= How to install: =
|
137 |
+
[youtube https://www.youtube.com/watch?v=07IRBn1oXrU]
|
138 |
|
139 |
= Privacy & Policy =
|
140 |
+
* We have also an opt-in e-mail selection, once you download the plugin so that we can inform you and nurture you about products and its features.
|
141 |
|
142 |
== Installation ==
|
143 |
|
144 |
1. Upload the 'sp-news-and-widget' folder to the '/wp-content/plugins/' directory.
|
145 |
1. Activate the SP News plugin through the 'Plugins' menu in WordPress.
|
146 |
1. Add and manage news items on your site by clicking on the 'News' tab that appears in your admin menu.
|
147 |
+
1. Create a page with the any name and paste this shortcode <code> [sp_news] </code>.
|
148 |
|
149 |
+
= How to install: =
|
150 |
+
[youtube https://www.youtube.com/watch?v=07IRBn1oXrU]
|
|
|
|
|
151 |
|
152 |
== Frequently Asked Questions ==
|
153 |
|
157 |
|
158 |
<code>
|
159 |
function prefix_gutenberg_editor_support($news_args){
|
160 |
+
$news_args['show_in_rest'] = false;
|
161 |
+
return $news_args;
|
162 |
}
|
163 |
add_filter( 'sp_news_registered_post_type_args', 'prefix_gutenberg_editor_support' );
|
164 |
</code>
|
165 |
|
166 |
= Do I need to update my permalinks after I activate this plugin? =
|
167 |
|
168 |
+
No, not usually. But if you are getting a "/news" page OR 404 error on single news then please update your permalinks to Custom Structure.
|
169 |
|
170 |
+
= I am getting a 404 page on the news detail page? =
|
171 |
|
172 |
+
If you are getting this error, please go to Setting --> Permalinks and under Permalinks Setting select the "Plain" radio button and save. Now again go to the "Post name" radio button and save again. This will fix your issue.
|
173 |
|
174 |
= Are there shortcodes for news items? =
|
175 |
|
178 |
== Screenshots ==
|
179 |
|
180 |
1. Display News with grid view
|
181 |
+
2. A complete view with comments
|
182 |
+
3. Display News with a List view
|
183 |
4. Add new news
|
184 |
5. Single News view
|
185 |
6. Widgets
|
186 |
7. Widgets Options
|
187 |
+
8. Also, work with Gutenberg shortcode block.
|
188 |
|
189 |
== Changelog ==
|
190 |
|
191 |
+
= 4.3 (09, Sept 2020) =
|
192 |
+
* [+] New - Added Gutenberg block support. Now use plugin easily with Gutenberg!
|
193 |
+
* [+] New - Added 'align' and 'extra_class' parameter for all shortcode. Now shortcode is support twenty-nineteen and twenty-twenty theme Gutenberg block align and additional class feature.
|
194 |
+
* [+] New - Added shortcode & Widget support in Elementor, SiteOrigin, and Beaver Page builder.
|
195 |
+
* [*] Check compatibility to WordPress version 5.5.1.
|
196 |
+
* [*] Tweak - Code optimization and performance improvements.
|
197 |
+
* [+] Update - Major changes in CSS and JS.
|
198 |
+
|
199 |
+
= 4.2.2 (14, July 2020) =
|
200 |
+
* [*] Follow WordPress Detailed Plugin Guidelines for Offload Media and Analytics Code.
|
201 |
+
|
202 |
+
= 4.2.1 (26, Dec 2019) =
|
203 |
+
* [+] Added : Added 2 new parameter - order and orderby
|
204 |
+
* [*] Improve some code in the shortcode file.
|
205 |
+
|
206 |
= 4.2 (05, June 2019) =
|
207 |
+
* [*] Fixed some CSS related issues for pagination.
|
208 |
* [*] Updated plugin document link.
|
209 |
* [*] Updated plugin demo link.
|
210 |
|
212 |
* [*] Minor change in Opt-in flow.
|
213 |
|
214 |
= 4.1.3 (20, Dec 2018) =
|
215 |
+
* [*] Fixed the issue where custom taxonomies were not showing after giving Gutenberg support for a custom news post. Thanks, @sabkor for showing us this issue.
|
216 |
|
217 |
= 4.1.2 (18, Dec 2018) =
|
218 |
* [*] Update Opt-in flow.
|
219 |
|
220 |
+
= 4.1.1 (13, Dec 2018) =
|
221 |
+
* [+] If you are using WordPress 5.0 OR WordPress 5.0 plus classic editor plugin, we have added `show_in_rest=> true` to enable the Gutenberg Editor support for News Posts or Not. For more details please check the plugin FAQ section.
|
222 |
|
223 |
= 4.1 (06-12-2018) =
|
224 |
* [*] Tested with WordPress 5.0 and Gutenberg.
|
229 |
* [*] Fix - Some warnings with widgets while using with WordPress customizer.
|
230 |
* [*] Tweak - Used 'wp_reset_postdata' instead of 'wp_reset_query'.
|
231 |
|
232 |
+
= 4.0.2 (04, June 2018) =
|
233 |
* [*] Follow some WordPress Detailed Plugin Guidelines.
|
234 |
|
235 |
+
= 4.0.1 (07, May 2018) =
|
236 |
* [*] Taken batter care in list design if featured image not added.
|
237 |
+
* [*] Fixed grid-1 issues, where the grid was loading actual image path.
|
238 |
+
* [*] Fixed some design issues.
|
239 |
|
240 |
+
= 4.0 (30, March 2018) =
|
241 |
+
* [*] Fixed some design issues.
|
242 |
+
* [*] Modified plugin file structure.
|
243 |
+
* [*] Tested with WordPress 4.9.4.
|
244 |
|
245 |
+
= 3.3.4 (29, July 2017) =
|
246 |
+
* [+] Added prefix to some CSS generic name classes to avoid the conflict with theme CSS or third party plugin.
|
247 |
|
248 |
+
= 3.3.2 (19, June 2017) =
|
249 |
+
* [*] Resolved displaying multiple scrolling widget issues.
|
250 |
|
251 |
+
= 3.3.1 (19, May 2017) =
|
252 |
+
* [*] Resolved WPML language translate issue while the news is being displayed with taxonomy.
|
253 |
* [*] Updated 'How it Work' page.
|
254 |
+
* [*] Resolved post status issue. Now only 'Published' posts will be displayed.
|
255 |
|
256 |
= 3.3 (15/02/2017) =
|
257 |
* [+] Added new shortcode parameter "pagination_type" (Select the pagination type for News ie "numeric" OR "next-prev" ).
|
262 |
= 3.2.10 (28/10/2016) =
|
263 |
* [+] Added "How it Work" tab.
|
264 |
* [-] Removed Pro design tab.
|
265 |
+
* Fixed some CSS issues.
|
266 |
|
267 |
= 3.2.9 (10/17/2016) =
|
268 |
+
* [+] Added design to read more button and pagination.
|
269 |
* [+] Added design for widgets section.
|
270 |
+
* Fixed some CSS issues.
|
271 |
|
272 |
= 3.2.8 =
|
273 |
* Fixed image display issue.
|
274 |
+
* Fixed some CSS issues.
|
275 |
+
* Fixed widget with image issue.
|
276 |
|
277 |
= 3.2.7 =
|
278 |
+
* Added excerpt functionality in the post description.
|
279 |
* Resolved display post content issue.
|
280 |
|
281 |
= 3.2.6 =
|
282 |
+
* Fixed some CSS issues.
|
283 |
* Updated PRO plugin design page.
|
284 |
|
285 |
= 3.2.5 =
|
286 |
+
* Fixed some CSS issues.
|
287 |
|
288 |
= 3.2.4 =
|
289 |
+
* Added translation in German, French (France), Polish languages (Beta).
|
290 |
+
* Fixed some bug.
|
291 |
+
* Added 2 new design for a pro version.
|
292 |
|
293 |
= 3.2.3 =
|
294 |
+
* Added textdomain.
|
295 |
+
* Widget scrolling setting page removed and added a setting in widget only.
|
296 |
+
* Fixed some bug.
|
297 |
|
298 |
= 3.2.2 =
|
299 |
+
* Added Pro version.
|
300 |
+
* Fixed some bugs.
|
301 |
|
302 |
= 3.2.1 =
|
303 |
* Added new shortcode parameters show_date.
|
307 |
* Widget Options like Show News date, Show News Categories, Select News Categories.
|
308 |
|
309 |
= 3.1.1 =
|
310 |
+
* Solved categories bug.
|
311 |
|
312 |
= 3.1 =
|
313 |
+
* Added new shortcode parameters ie show_content, show_category_name and content_words_limit.
|
314 |
+
* Fixed some bug.
|
315 |
|
316 |
= 3.0 =
|
317 |
+
* Display News with List view.
|
318 |
+
* Display News with Grid [sp_news grid="2"].
|
319 |
+
* Added pagination [sp_news limit="10"].
|
320 |
|
321 |
= 2.2.1 =
|
322 |
+
* Fixed the bug: Shows news on top of static page.
|
323 |
|
324 |
= 2.2 =
|
325 |
+
* Call the news post with a shortcode.
|
326 |
+
* Call the news post with category wise.
|
327 |
|
328 |
= 2.1 =
|
329 |
+
* Scroll main page news.
|
330 |
+
* Setting page for enabling or disable main page news scrolling.
|
331 |
+
* Setting page for main news page vertical and horizontal news scrolling.
|
332 |
|
333 |
= 2.0 =
|
334 |
+
* Added Vertical and horizontal news scrolling widget with setting page.
|
335 |
* New UI designs
|
336 |
* Admin setting page
|
337 |
|
sp-news-and-widget.php
CHANGED
@@ -5,37 +5,139 @@ Plugin URL: https://www.wponlinesupport.com/plugins/
|
|
5 |
Text Domain: sp-news-and-widget
|
6 |
Domain Path: /languages/
|
7 |
Description: A simple News and three widgets(static, scrolling and with thumbs) plugin. Also work with Gutenberg shortcode block.
|
8 |
-
Version: 4.
|
9 |
Author: WP OnlineSupport
|
10 |
Author URI: https://www.wponlinesupport.com
|
11 |
Contributors: WP OnlineSupport
|
12 |
*/
|
13 |
|
14 |
-
if( !defined( 'WPNW_VERSION' ) ) {
|
15 |
-
define( 'WPNW_VERSION', '4.
|
16 |
}
|
17 |
-
if( !defined( 'WPNW_DIR' ) ) {
|
18 |
define( 'WPNW_DIR', dirname( __FILE__ ) ); // Plugin dir
|
19 |
}
|
20 |
-
if( !defined( '
|
|
|
|
|
|
|
21 |
define( 'WPNW_POST_TYPE', 'news' ); // Plugin post type
|
22 |
}
|
23 |
-
if( !defined( 'WPNW_CAT' ) ) {
|
24 |
define( 'WPNW_CAT', 'news-category' ); // Plugin Category
|
25 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
-
register_activation_hook( __FILE__, 'install_newsfree_version' );
|
28 |
-
function install_newsfree_version() {
|
29 |
if( is_plugin_active('wp-news-and-widget-pro/sp-news-and-widget.php') ){
|
30 |
-
add_action('update_option_active_plugins', '
|
31 |
}
|
32 |
}
|
33 |
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
deactivate_plugins('wp-news-and-widget-pro/sp-news-and-widget.php',true);
|
36 |
}
|
37 |
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
global $pagenow;
|
41 |
|
@@ -53,88 +155,34 @@ function freenews_admin_notice() {
|
|
53 |
</div>';
|
54 |
}
|
55 |
}
|
56 |
-
add_action( 'admin_notices', '
|
57 |
-
|
58 |
-
function sp_news_load_textdomain() {
|
59 |
-
load_plugin_textdomain( 'sp-news-and-widget', false, dirname( plugin_basename(__FILE__) ) . '/languages/' );
|
60 |
-
}
|
61 |
-
add_action('plugins_loaded', 'sp_news_load_textdomain');
|
62 |
-
|
63 |
-
function wpnawstyle_css_script() {
|
64 |
-
wp_enqueue_style( 'cssnews', plugin_dir_url( __FILE__ ). 'assets/css/stylenews.css', array(), WPNW_VERSION );
|
65 |
-
wp_enqueue_script( 'vnewsticker', plugin_dir_url( __FILE__ ) . 'assets/js/jquery.newstape.js', array( 'jquery' ), WPNW_VERSION);
|
66 |
-
wp_enqueue_script( 'sp-news-public', plugin_dir_url( __FILE__ ) . 'assets/js/sp-news-public.js', array( 'jquery' ), WPNW_VERSION);
|
67 |
-
}
|
68 |
-
add_action( 'wp_enqueue_scripts', 'wpnawstyle_css_script' );
|
69 |
-
|
70 |
-
function string_limit_newswords( $post_id = null, $content = '', $word_length = '55', $more = '...' ) {
|
71 |
|
72 |
-
|
73 |
-
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
if (has_excerpt($post_id)) {
|
78 |
-
$has_excerpt = true;
|
79 |
-
$content = get_the_excerpt();
|
80 |
-
} else {
|
81 |
-
$content = !empty($content) ? $content : get_the_content();
|
82 |
-
}
|
83 |
-
}
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
$content = wp_trim_words( $content, $word_length, $more );
|
88 |
-
}
|
89 |
-
|
90 |
-
return $content;
|
91 |
-
}
|
92 |
|
93 |
-
|
94 |
-
|
95 |
-
$post_types = array( 'post', WPNW_POST_TYPE );
|
96 |
-
$query->set( 'post_type', $post_types );
|
97 |
-
}
|
98 |
-
}
|
99 |
-
add_filter( 'pre_get_posts', 'spnews_display_tags' );
|
100 |
-
|
101 |
-
function news_pagination($args = array()){
|
102 |
-
$big = 999999999; // need an unlikely integer
|
103 |
-
$paging = apply_filters('news_blog_paging_args', array(
|
104 |
-
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
|
105 |
-
'format' => '?paged=%#%',
|
106 |
-
'current' => max( 1, $args['paged'] ),
|
107 |
-
'total' => $args['total'],
|
108 |
-
'prev_next' => true,
|
109 |
-
'prev_text' => __('« Previous', 'wp-blog-and-widgets'),
|
110 |
-
'next_text' => __('Next »', 'wp-blog-and-widgets'),
|
111 |
-
));
|
112 |
-
|
113 |
-
echo paginate_links($paging);
|
114 |
-
}
|
115 |
|
116 |
-
|
117 |
-
|
118 |
-
$unique++;
|
119 |
|
120 |
-
|
|
|
|
|
121 |
}
|
122 |
|
123 |
-
//
|
124 |
-
require_once( WPNW_DIR . '/includes/
|
125 |
-
|
126 |
-
// Shortcode
|
127 |
-
require_once( WPNW_DIR . '/includes/sp-news-shortcode.php' );
|
128 |
-
|
129 |
-
// Widget
|
130 |
-
require_once( WPNW_DIR . '/widget_function.php' );
|
131 |
-
|
132 |
-
// Shortcode
|
133 |
-
require_once( WPNW_DIR . '/admin/class-wpnw-admin.php' );
|
134 |
|
135 |
// How it work file, Load admin files
|
136 |
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
137 |
-
require_once( WPNW_DIR . '/admin/wpnw-how-it-work.php' );
|
138 |
}
|
139 |
|
140 |
/* Plugin Analytics Data */
|
@@ -150,20 +198,6 @@ function wpos_analytics_anl20_load() {
|
|
150 |
'type' => 'plugin',
|
151 |
'menu' => 'edit.php?post_type=news',
|
152 |
'text_domain' => 'sp-news-and-widget',
|
153 |
-
'promotion' => array(
|
154 |
-
'bundle' => array(
|
155 |
-
'name' => 'Download FREE 50+ Plugins, 10+ Themes and Dashboard Plugin',
|
156 |
-
'desc' => 'Download FREE 50+ Plugins, 10+ Themes and Dashboard Plugin',
|
157 |
-
'file' => 'https://www.wponlinesupport.com/latest/wpos-free-50-plugins-plus-12-themes.zip'
|
158 |
-
)
|
159 |
-
),
|
160 |
-
'offers' => array(
|
161 |
-
'trial_premium' => array(
|
162 |
-
'image' => 'http://analytics.wponlinesupport.com/?anylc_img=20',
|
163 |
-
'link' => 'http://analytics.wponlinesupport.com/?anylc_redirect=20',
|
164 |
-
'desc' => 'Or start using the plugin from admin menu',
|
165 |
-
)
|
166 |
-
),
|
167 |
));
|
168 |
|
169 |
return $wpos_analytics;
|
5 |
Text Domain: sp-news-and-widget
|
6 |
Domain Path: /languages/
|
7 |
Description: A simple News and three widgets(static, scrolling and with thumbs) plugin. Also work with Gutenberg shortcode block.
|
8 |
+
Version: 4.3
|
9 |
Author: WP OnlineSupport
|
10 |
Author URI: https://www.wponlinesupport.com
|
11 |
Contributors: WP OnlineSupport
|
12 |
*/
|
13 |
|
14 |
+
if( ! defined( 'WPNW_VERSION' ) ) {
|
15 |
+
define( 'WPNW_VERSION', '4.3' ); // Version of plugin
|
16 |
}
|
17 |
+
if( ! defined( 'WPNW_DIR' ) ) {
|
18 |
define( 'WPNW_DIR', dirname( __FILE__ ) ); // Plugin dir
|
19 |
}
|
20 |
+
if( ! defined( 'WPNW_URL' ) ) {
|
21 |
+
define( 'WPNW_URL', plugin_dir_url( __FILE__ ) ); // Plugin URL
|
22 |
+
}
|
23 |
+
if( ! defined( 'WPNW_POST_TYPE' ) ) {
|
24 |
define( 'WPNW_POST_TYPE', 'news' ); // Plugin post type
|
25 |
}
|
26 |
+
if( ! defined( 'WPNW_CAT' ) ) {
|
27 |
define( 'WPNW_CAT', 'news-category' ); // Plugin Category
|
28 |
}
|
29 |
+
if( ! defined( 'WPNW_PLUGIN_LINK' ) ) {
|
30 |
+
define( 'WPNW_PLUGIN_LINK', 'https://www.wponlinesupport.com/wp-plugin/sp-news-and-scrolling-widgets/?utm_source=WP&utm_medium=News&utm_campaign=Features-PRO#fndtn-lifetime' ); // Plugin Category
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Load Text Domain and do stuff once all plugin is loaded
|
35 |
+
* This gets the plugin ready for translation
|
36 |
+
*
|
37 |
+
* @package WP News and Scrolling Widgets
|
38 |
+
* @since 1.0.0
|
39 |
+
*/
|
40 |
+
function wpnw_news_load_textdomain() {
|
41 |
+
global $wp_version;
|
42 |
+
|
43 |
+
// Set filter for plugin's languages directory
|
44 |
+
$wpnw_pro_lang_dir = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
|
45 |
+
$wpnw_pro_lang_dir = apply_filters( 'wpnw_news_languages_directory', $wpnw_pro_lang_dir );
|
46 |
+
|
47 |
+
// Traditional WordPress plugin locale filter.
|
48 |
+
$get_locale = get_locale();
|
49 |
+
|
50 |
+
if ( $wp_version >= 4.7 ) {
|
51 |
+
$get_locale = get_user_locale();
|
52 |
+
}
|
53 |
+
|
54 |
+
// Traditional WordPress plugin locale filter
|
55 |
+
$locale = apply_filters( 'plugin_locale', $get_locale, 'sp-news-and-widget' );
|
56 |
+
$mofile = sprintf( '%1$s-%2$s.mo', 'sp-news-and-widget', $locale );
|
57 |
+
|
58 |
+
// Setup paths to current locale file
|
59 |
+
$mofile_global = WP_LANG_DIR . '/plugins/' . basename( WPNW_DIR ) . '/' . $mofile;
|
60 |
+
|
61 |
+
if ( file_exists( $mofile_global ) ) { // Look in global /wp-content/languages/plugin-name folder
|
62 |
+
load_textdomain( 'sp-news-and-widget', $mofile_global );
|
63 |
+
} else { // Load the default language files
|
64 |
+
load_plugin_textdomain( 'sp-news-and-widget', false, $wpnw_pro_lang_dir );
|
65 |
+
}
|
66 |
+
}
|
67 |
+
add_action('plugins_loaded', 'wpnw_news_load_textdomain');
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Activation Hook
|
71 |
+
*
|
72 |
+
* Register plugin activation hook.
|
73 |
+
*
|
74 |
+
* @package WP News and Scrolling Widgets
|
75 |
+
* @since 1.0.0
|
76 |
+
*/
|
77 |
+
register_activation_hook( __FILE__, 'wpnw_install_news_version' );
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Deactivation Hook
|
81 |
+
*
|
82 |
+
* Register plugin deactivation hook.
|
83 |
+
*
|
84 |
+
* @package WP News and Scrolling Widgets
|
85 |
+
* @since 1.0.0
|
86 |
+
*/
|
87 |
+
register_deactivation_hook( __FILE__, 'wpnw_uninstall_news_version');
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Plugin Activation Function
|
91 |
+
* Does the initial setup, sets the default values for the plugin options
|
92 |
+
*
|
93 |
+
* @package WP News and Scrolling Widgets
|
94 |
+
* @since 1.0.0
|
95 |
+
*/
|
96 |
+
function wpnw_install_news_version() {
|
97 |
+
|
98 |
+
//post type and taxonomies function
|
99 |
+
wpnw_news_post_type_init();
|
100 |
+
wpnw_news_taxonomies();
|
101 |
+
|
102 |
+
// IMP to call to generate new rules
|
103 |
+
flush_rewrite_rules();
|
104 |
|
|
|
|
|
105 |
if( is_plugin_active('wp-news-and-widget-pro/sp-news-and-widget.php') ){
|
106 |
+
add_action('update_option_active_plugins', 'wpnw_deactivate_news_version');
|
107 |
}
|
108 |
}
|
109 |
|
110 |
+
/**
|
111 |
+
* Plugin Functinality (On Deactivation)
|
112 |
+
*
|
113 |
+
* Delete plugin options.
|
114 |
+
*
|
115 |
+
* @package WP News and Scrolling Widgets
|
116 |
+
* @since 1.0.0
|
117 |
+
*/
|
118 |
+
function wpnw_uninstall_news_version() {
|
119 |
+
|
120 |
+
// IMP to call to generate new rules
|
121 |
+
flush_rewrite_rules();
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* Deactivate free plugin
|
126 |
+
*
|
127 |
+
* @package WP News and Scrolling Widgets
|
128 |
+
* @since 1.0.0
|
129 |
+
*/
|
130 |
+
function wpnw_deactivate_news_version() {
|
131 |
deactivate_plugins('wp-news-and-widget-pro/sp-news-and-widget.php',true);
|
132 |
}
|
133 |
|
134 |
+
/**
|
135 |
+
* Function to display admin notice of activated plugin.
|
136 |
+
*
|
137 |
+
* @package WP News and Five Widgets Pro
|
138 |
+
* @since 1.0.0
|
139 |
+
*/
|
140 |
+
function wpnw_news_admin_notice() {
|
141 |
|
142 |
global $pagenow;
|
143 |
|
155 |
</div>';
|
156 |
}
|
157 |
}
|
158 |
+
add_action( 'admin_notices', 'wpnw_news_admin_notice');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
+
// functions file
|
161 |
+
require_once( WPNW_DIR . '/includes/functions.php' );
|
162 |
|
163 |
+
// admin action file
|
164 |
+
require_once( WPNW_DIR . '/includes/admin/class-wpnw-admin.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
|
166 |
+
// Regrister Postype File
|
167 |
+
require_once( WPNW_DIR . '/includes/sp-news-post-type.php' );
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
+
// Script File
|
170 |
+
require_once( WPNW_DIR . '/includes/class-wpnw-script.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
171 |
|
172 |
+
// Shortcode file
|
173 |
+
require_once( WPNW_DIR . '/includes/shortcode/sp-news-shortcode.php' );
|
|
|
174 |
|
175 |
+
// Gutenberg Block Initializer
|
176 |
+
if ( function_exists( 'register_block_type' ) ) {
|
177 |
+
require_once( WPNW_DIR . '/includes/admin/supports/gutenberg-block.php' );
|
178 |
}
|
179 |
|
180 |
+
// Widget file
|
181 |
+
require_once( WPNW_DIR . '/includes/widgets/wpnw-widgets.php' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
183 |
// How it work file, Load admin files
|
184 |
if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) {
|
185 |
+
require_once( WPNW_DIR . '/includes/admin/wpnw-how-it-work.php' );
|
186 |
}
|
187 |
|
188 |
/* Plugin Analytics Data */
|
198 |
'type' => 'plugin',
|
199 |
'menu' => 'edit.php?post_type=news',
|
200 |
'text_domain' => 'sp-news-and-widget',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
));
|
202 |
|
203 |
return $wpos_analytics;
|
widget_function.php
DELETED
@@ -1,543 +0,0 @@
|
|
1 |
-
<?php class SP_News_Widget extends WP_Widget {
|
2 |
-
|
3 |
-
var $defaults;
|
4 |
-
|
5 |
-
function __construct() {
|
6 |
-
|
7 |
-
$widget_ops = array('classname' => 'SP_News_Widget', 'description' => __('Displayed Latest News Items from the News in a sidebar', 'sp-news-and-widget') );
|
8 |
-
|
9 |
-
$control_ops = array( 'width' => 350, 'height' => 450, 'id_base' => 'sp_news_widget' );
|
10 |
-
|
11 |
-
parent::__construct( 'sp_news_widget', __('Latest News Widget', 'sp-news-and-widget'), $widget_ops, $control_ops );
|
12 |
-
|
13 |
-
$this->defaults = array(
|
14 |
-
'limit' => 5,
|
15 |
-
'title' => __('Latest News', 'sp-news-and-widget'),
|
16 |
-
"date" => false,
|
17 |
-
'show_category' => false,
|
18 |
-
'category' => 0,
|
19 |
-
);
|
20 |
-
}
|
21 |
-
|
22 |
-
function form($instance) {
|
23 |
-
|
24 |
-
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
25 |
-
$num_items = isset($instance['num_items']) ? absint($instance['num_items']) : 5;
|
26 |
-
?>
|
27 |
-
|
28 |
-
<p>
|
29 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title:', 'sp-news-and-widget' ); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($instance['title']); ?>" /></label>
|
30 |
-
</p>
|
31 |
-
|
32 |
-
<p>
|
33 |
-
<label for="<?php echo $this->get_field_id('num_items'); ?>"><?php _e( 'Number of Items: ', 'sp-news-and-widget' ); ?> <input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo esc_attr($num_items); ?>" /></label>
|
34 |
-
</p>
|
35 |
-
|
36 |
-
<p>
|
37 |
-
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox"<?php checked( $instance['date'], 1 ); ?> />
|
38 |
-
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Display Date', 'sp-news-and-widget' ); ?></label>
|
39 |
-
</p>
|
40 |
-
|
41 |
-
<p>
|
42 |
-
<input id="<?php echo $this->get_field_id( 'show_category' ); ?>" name="<?php echo $this->get_field_name( 'show_category' ); ?>" type="checkbox"<?php checked( $instance['show_category'], 1 ); ?> />
|
43 |
-
<label for="<?php echo $this->get_field_id( 'show_category' ); ?>"><?php _e( 'Display Category', 'sp-news-and-widget' ); ?></label>
|
44 |
-
</p>
|
45 |
-
|
46 |
-
<p>
|
47 |
-
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category:', 'sp-news-and-widget' ); ?></label>
|
48 |
-
<?php
|
49 |
-
$dropdown_args = array(
|
50 |
-
'taxonomy' => WPNW_CAT,
|
51 |
-
'show_option_none' => __('All Categories', 'sp-news-and-widget'),
|
52 |
-
'option_none_value' => '',
|
53 |
-
'class' => 'widefat',
|
54 |
-
'id' => $this->get_field_id( 'category' ),
|
55 |
-
'name' => $this->get_field_name( 'category' ),
|
56 |
-
'selected' => $instance['category'],
|
57 |
-
);
|
58 |
-
wp_dropdown_categories( $dropdown_args );
|
59 |
-
?>
|
60 |
-
</p>
|
61 |
-
|
62 |
-
<?php
|
63 |
-
}
|
64 |
-
|
65 |
-
function update($new_instance, $old_instance) {
|
66 |
-
|
67 |
-
$instance = $old_instance;
|
68 |
-
$instance['title'] = $new_instance['title'];
|
69 |
-
$instance['num_items'] = $new_instance['num_items'];
|
70 |
-
$instance['date'] = (bool) esc_attr( $new_instance['date'] );
|
71 |
-
$instance['show_category'] = (bool) esc_attr( $new_instance['show_category'] );
|
72 |
-
$instance['category'] = $new_instance['category'];
|
73 |
-
return $instance;
|
74 |
-
}
|
75 |
-
|
76 |
-
function widget($news_args, $instance) {
|
77 |
-
|
78 |
-
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
79 |
-
extract($news_args, EXTR_SKIP);
|
80 |
-
|
81 |
-
$current_post_name = get_query_var('name');
|
82 |
-
|
83 |
-
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
84 |
-
$num_items = empty($instance['num_items']) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
85 |
-
if ( isset( $instance['date'] ) && ( 1 == $instance['date'] ) ) { $date = "true"; } else { $date = "false"; }
|
86 |
-
if ( isset( $instance['show_category'] ) && ( 1 == $instance['show_category'] ) ) { $show_category = "true"; } else { $show_category = "false"; }
|
87 |
-
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) $category = intval( $instance['category'] );
|
88 |
-
|
89 |
-
$postcount = 0;
|
90 |
-
|
91 |
-
echo $before_widget;
|
92 |
-
|
93 |
-
if ( $title ) {
|
94 |
-
echo $before_title . $title . $after_title;
|
95 |
-
}
|
96 |
-
|
97 |
-
// visual-columns
|
98 |
-
$no_p = '';
|
99 |
-
if($date == "false" && $show_category == "false"){
|
100 |
-
$no_p = "no_p";
|
101 |
-
} ?>
|
102 |
-
|
103 |
-
<div class="recent-news-items <?php echo $no_p?>">
|
104 |
-
<ul>
|
105 |
-
<?php // setup the query
|
106 |
-
$news_args = array(
|
107 |
-
'posts_per_page' => $num_items,
|
108 |
-
'post_type' => WPNW_POST_TYPE,
|
109 |
-
'post_status' => array( 'publish' ),
|
110 |
-
'order' => 'DESC'
|
111 |
-
);
|
112 |
-
|
113 |
-
if( !empty($category) ) {
|
114 |
-
$news_args['tax_query'] = array(
|
115 |
-
array(
|
116 |
-
'taxonomy' => WPNW_CAT,
|
117 |
-
'field' => 'term_id',
|
118 |
-
'terms' => $category
|
119 |
-
));
|
120 |
-
}
|
121 |
-
|
122 |
-
$cust_loop = new WP_Query($news_args);
|
123 |
-
|
124 |
-
global $post;
|
125 |
-
|
126 |
-
$post_count = $cust_loop->post_count;
|
127 |
-
$count = 0;
|
128 |
-
|
129 |
-
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
130 |
-
|
131 |
-
$count++;
|
132 |
-
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
133 |
-
$news_links = array();
|
134 |
-
|
135 |
-
if($terms){
|
136 |
-
foreach ( $terms as $term ) {
|
137 |
-
$term_link = get_term_link( $term );
|
138 |
-
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
139 |
-
}
|
140 |
-
}
|
141 |
-
$cate_name = join( ", ", $news_links ); ?>
|
142 |
-
|
143 |
-
<li class="news_li">
|
144 |
-
<a class="newspost-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
145 |
-
|
146 |
-
<?php if($date == "true" || $show_category == "true"){ ?>
|
147 |
-
<div class="widget-date-post">
|
148 |
-
<?php echo ($date == "true")? get_the_date() : "" ;?>
|
149 |
-
<?php echo ($date == "true" && $show_category == "true" && $cate_name != '') ? " , " : "";?>
|
150 |
-
<?php echo ($show_category == 'true' && $cate_name != '') ? $cate_name : "" ?>
|
151 |
-
</div>
|
152 |
-
<?php } ?>
|
153 |
-
|
154 |
-
</li>
|
155 |
-
|
156 |
-
<?php endwhile;
|
157 |
-
endif;
|
158 |
-
wp_reset_postdata(); ?>
|
159 |
-
</ul>
|
160 |
-
</div>
|
161 |
-
<?php
|
162 |
-
echo $after_widget;
|
163 |
-
}
|
164 |
-
}
|
165 |
-
|
166 |
-
/* Register the widget */
|
167 |
-
function sp_news_widget_load_widgets() {
|
168 |
-
register_widget( 'SP_News_Widget' );
|
169 |
-
}
|
170 |
-
|
171 |
-
/* Load the widget */
|
172 |
-
add_action( 'widgets_init', 'sp_news_widget_load_widgets' );
|
173 |
-
|
174 |
-
/* scrolling news */
|
175 |
-
class SP_News_scrolling_Widget extends WP_Widget {
|
176 |
-
|
177 |
-
var $defaults;
|
178 |
-
|
179 |
-
function __construct() {
|
180 |
-
|
181 |
-
$widget_ops = array('classname' => 'SP_News_scrolling_Widget', 'description' => __('Scroll Latest News Items from the News in a sidebar', 'sp-news-and-widget') );
|
182 |
-
$control_ops = array( 'width' => 350, 'height' => 450, 'id_base' => 'sp_news_s_widget' );
|
183 |
-
|
184 |
-
parent::__construct( 'sp_news_s_widget', __('Latest News Scrolling Widget', 'sp-news-and-widget'), $widget_ops, $control_ops );
|
185 |
-
|
186 |
-
$this->defaults = array(
|
187 |
-
'limit' => 5,
|
188 |
-
'title' => __('Latest News Scrolling Widget', 'sp-news-and-widget'),
|
189 |
-
'date' => false,
|
190 |
-
'show_category' => false,
|
191 |
-
'category' => 0,
|
192 |
-
'height' => 400,
|
193 |
-
'pause' => 2000,
|
194 |
-
'speed' => 500,
|
195 |
-
);
|
196 |
-
}
|
197 |
-
|
198 |
-
function form($instance) {
|
199 |
-
|
200 |
-
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
201 |
-
$num_items = isset($instance['num_items']) ? absint($instance['num_items']) : 5;
|
202 |
-
?>
|
203 |
-
|
204 |
-
<p>
|
205 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title:', 'sp-news-and-widget' ); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /></label>
|
206 |
-
</p>
|
207 |
-
|
208 |
-
<p>
|
209 |
-
<label for="<?php echo $this->get_field_id('num_items'); ?>"><?php _e( 'Number of Items: ', 'sp-news-and-widget' ); ?> <input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo esc_attr($num_items); ?>" /></label>
|
210 |
-
</p>
|
211 |
-
|
212 |
-
<p>
|
213 |
-
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox"<?php checked( $instance['date'], 1 ); ?> />
|
214 |
-
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Display Date', 'sp-news-and-widget' ); ?></label>
|
215 |
-
</p>
|
216 |
-
|
217 |
-
<p>
|
218 |
-
<input id="<?php echo $this->get_field_id( 'show_category' ); ?>" name="<?php echo $this->get_field_name( 'show_category' ); ?>" type="checkbox"<?php checked( $instance['show_category'], 1 ); ?> />
|
219 |
-
<label for="<?php echo $this->get_field_id( 'show_category' ); ?>"><?php _e( 'Display Category', 'sp-news-and-widget' ); ?></label>
|
220 |
-
</p>
|
221 |
-
|
222 |
-
<p>
|
223 |
-
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category:', 'sp-news-and-widget' ); ?></label>
|
224 |
-
<?php
|
225 |
-
$dropdown_args = array(
|
226 |
-
'taxonomy' => WPNW_CAT,
|
227 |
-
'show_option_none' => __('All Categories', 'sp-news-and-widget'),
|
228 |
-
'option_none_value' => '',
|
229 |
-
'class' => 'widefat',
|
230 |
-
'id' => $this->get_field_id( 'category' ),
|
231 |
-
'name' => $this->get_field_name( 'category' ),
|
232 |
-
'selected' => $instance['category'],
|
233 |
-
);
|
234 |
-
wp_dropdown_categories( $dropdown_args );
|
235 |
-
?>
|
236 |
-
</p>
|
237 |
-
|
238 |
-
<p>
|
239 |
-
<label for="<?php echo $this->get_field_id( 'height' ); ?>"><?php _e( 'Height:', 'sp-news-and-widget' ); ?></label>
|
240 |
-
<input type="text" name="<?php echo $this->get_field_name( 'height' ); ?>" value="<?php echo $instance['height']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'height' ); ?>" min="1" />
|
241 |
-
</p>
|
242 |
-
|
243 |
-
<p>
|
244 |
-
<label for="<?php echo $this->get_field_id( 'pause' ); ?>"><?php _e( 'Pause:', 'sp-news-and-widget' ); ?></label>
|
245 |
-
<input type="text" name="<?php echo $this->get_field_name( 'pause' ); ?>" value="<?php echo $instance['pause']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'pause' ); ?>" min="1" />
|
246 |
-
</p>
|
247 |
-
|
248 |
-
<p>
|
249 |
-
<label for="<?php echo $this->get_field_id( 'speed' ); ?>"><?php _e( 'Speed:', 'sp-news-and-widget' ); ?></label>
|
250 |
-
<input type="text" name="<?php echo $this->get_field_name( 'speed' ); ?>" value="<?php echo $instance['speed']; ?>" class="widefat" id="<?php echo $this->get_field_id( 'speed' ); ?>" min="0" />
|
251 |
-
</p>
|
252 |
-
|
253 |
-
<?php
|
254 |
-
}
|
255 |
-
|
256 |
-
function update($new_instance, $old_instance) {
|
257 |
-
|
258 |
-
$instance = $old_instance;
|
259 |
-
$instance['title'] = $new_instance['title'];
|
260 |
-
$instance['num_items'] = $new_instance['num_items'];
|
261 |
-
$instance['date'] = (bool) esc_attr( $new_instance['date'] );
|
262 |
-
$instance['show_category'] = (bool) esc_attr( $new_instance['show_category'] );
|
263 |
-
$instance['category'] = intval( $new_instance['category'] );
|
264 |
-
$instance['height'] = intval( $new_instance['height'] );
|
265 |
-
$instance['pause'] = intval( $new_instance['pause'] );
|
266 |
-
$instance['speed'] = intval( $new_instance['speed'] );
|
267 |
-
return $instance;
|
268 |
-
}
|
269 |
-
function widget($news_args, $instance) {
|
270 |
-
|
271 |
-
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
272 |
-
|
273 |
-
extract($news_args, EXTR_SKIP);
|
274 |
-
|
275 |
-
$current_post_name = get_query_var('name');
|
276 |
-
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
277 |
-
$num_items = empty($instance['num_items']) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
278 |
-
if ( isset( $instance['date'] ) && ( 1 == $instance['date'] ) ) { $date = "true"; } else { $date = "false"; }
|
279 |
-
if ( isset( $instance['show_category'] ) && ( 1 == $instance['show_category'] ) ) { $show_category = "true"; } else { $show_category = "false"; }
|
280 |
-
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) $category = intval( $instance['category'] );
|
281 |
-
$height = $instance['height'];
|
282 |
-
$pause = $instance['pause'];
|
283 |
-
$speed = $instance['speed'];
|
284 |
-
|
285 |
-
$slider_conf = compact('height', 'pause', 'speed');
|
286 |
-
|
287 |
-
$postcount = 0;
|
288 |
-
|
289 |
-
echo $before_widget;
|
290 |
-
|
291 |
-
if ( $title ) {
|
292 |
-
echo $before_title . $title . $after_title;
|
293 |
-
}
|
294 |
-
|
295 |
-
$unique_id = news_get_unique();
|
296 |
-
|
297 |
-
// visual-columns
|
298 |
-
$no_p = '';
|
299 |
-
if($date == "false" && $show_category == "false"){ $no_p = "no_p"; } ?>
|
300 |
-
<div class="recent-news-items-scroll <?php echo $no_p;?>">
|
301 |
-
<div id="newsticker-jcarousellite-<?php echo $unique_id;?>" class="sp-news-scrolling-slider" data-conf="<?php echo htmlspecialchars(json_encode( $slider_conf )); ?>" >
|
302 |
-
<ul>
|
303 |
-
<?php // setup the query
|
304 |
-
$news_args = array(
|
305 |
-
'posts_per_page' => $num_items,
|
306 |
-
'post_type' => WPNW_POST_TYPE,
|
307 |
-
'post_status' => array( 'publish' ),
|
308 |
-
'order' => 'DESC'
|
309 |
-
);
|
310 |
-
|
311 |
-
if( !empty($category) ) {
|
312 |
-
$news_args['tax_query'] = array(
|
313 |
-
array(
|
314 |
-
'taxonomy' => WPNW_CAT,
|
315 |
-
'field' => 'term_id',
|
316 |
-
'terms' => $category
|
317 |
-
));
|
318 |
-
}
|
319 |
-
$cust_loop = new WP_Query($news_args);
|
320 |
-
|
321 |
-
global $post;
|
322 |
-
$post_count = $cust_loop->post_count;
|
323 |
-
$count = 0;
|
324 |
-
|
325 |
-
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
326 |
-
$count++;
|
327 |
-
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
328 |
-
$news_links = array();
|
329 |
-
if($terms){
|
330 |
-
|
331 |
-
foreach ( $terms as $term ) {
|
332 |
-
$term_link = get_term_link( $term );
|
333 |
-
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
334 |
-
}
|
335 |
-
}
|
336 |
-
$cate_name = join( ", ", $news_links );
|
337 |
-
?>
|
338 |
-
<li class="news_li">
|
339 |
-
<a class="newspost-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
340 |
-
<?php if($date == "true" || $show_category == "true"){ ?>
|
341 |
-
<div class="widget-date-post">
|
342 |
-
<?php echo ($date == "true")? get_the_date() : "" ;?>
|
343 |
-
<?php echo ($date == "true" && $show_category == "true" && $cate_name != '') ? " , " : "";?>
|
344 |
-
<?php echo ($show_category == 'true' && $cate_name != '') ? $cate_name : "" ?>
|
345 |
-
</div>
|
346 |
-
<?php } ?>
|
347 |
-
</li>
|
348 |
-
<?php endwhile;
|
349 |
-
endif;
|
350 |
-
wp_reset_postdata(); ?>
|
351 |
-
</ul>
|
352 |
-
</div>
|
353 |
-
</div>
|
354 |
-
<?php
|
355 |
-
echo $after_widget;
|
356 |
-
}
|
357 |
-
}
|
358 |
-
|
359 |
-
/* Register the widget */
|
360 |
-
function sp_news_scroll_widget_load_widgets() {
|
361 |
-
register_widget( 'SP_News_scrolling_Widget' );
|
362 |
-
}
|
363 |
-
|
364 |
-
/* Load the widget */
|
365 |
-
add_action( 'widgets_init', 'sp_news_scroll_widget_load_widgets' );
|
366 |
-
|
367 |
-
/* news with thumb */
|
368 |
-
class SP_News_thmb_Widget extends WP_Widget {
|
369 |
-
|
370 |
-
var $defaults;
|
371 |
-
|
372 |
-
function __construct() {
|
373 |
-
|
374 |
-
$widget_ops = array('classname' => 'SP_News_thmb_Widget', 'description' => __('Displayed Latest News Items in a sidebar with thumbnails', 'sp-news-and-widget') );
|
375 |
-
$control_ops = array( 'width' => 350, 'height' => 450, 'id_base' => 'sp_news_sthumb_widget' );
|
376 |
-
|
377 |
-
parent::__construct( 'sp_news_sthumb_widget', __('Latest News with thumb', 'sp-news-and-widget'), $widget_ops, $control_ops );
|
378 |
-
|
379 |
-
$this->defaults = array(
|
380 |
-
'limit' => 5,
|
381 |
-
'title' => __('Latest News with thumb', 'sp-news-and-widget'),
|
382 |
-
"date" => false,
|
383 |
-
'show_category' => false,
|
384 |
-
'category' => 0,
|
385 |
-
);
|
386 |
-
}
|
387 |
-
|
388 |
-
function form($instance) {
|
389 |
-
|
390 |
-
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
391 |
-
$num_items = isset($instance['num_items']) ? absint($instance['num_items']) : 5;
|
392 |
-
?>
|
393 |
-
|
394 |
-
<p>
|
395 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"> <?php _e( 'Title:', 'sp-news-and-widget' ); ?> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /></label>
|
396 |
-
</p>
|
397 |
-
|
398 |
-
<p>
|
399 |
-
<label for="<?php echo $this->get_field_id('num_items'); ?>"><?php _e( 'Number of Items: ', 'sp-news-and-widget' ); ?> <input class="widefat" id="<?php echo $this->get_field_id('num_items'); ?>" name="<?php echo $this->get_field_name('num_items'); ?>" type="text" value="<?php echo $num_items; ?>" /></label>
|
400 |
-
</p>
|
401 |
-
|
402 |
-
<p>
|
403 |
-
<input id="<?php echo $this->get_field_id( 'date' ); ?>" name="<?php echo $this->get_field_name( 'date' ); ?>" type="checkbox"<?php checked( $instance['date'], 1 ); ?> />
|
404 |
-
<label for="<?php echo $this->get_field_id( 'date' ); ?>"><?php _e( 'Display Date', 'sp-news-and-widget' ); ?></label>
|
405 |
-
</p>
|
406 |
-
|
407 |
-
<p>
|
408 |
-
<input id="<?php echo $this->get_field_id( 'show_category' ); ?>" name="<?php echo $this->get_field_name( 'show_category' ); ?>" type="checkbox"<?php checked( $instance['show_category'], 1 ); ?> />
|
409 |
-
<label for="<?php echo $this->get_field_id( 'show_category' ); ?>"><?php _e( 'Display Category', 'sp-news-and-widget' ); ?></label>
|
410 |
-
</p>
|
411 |
-
|
412 |
-
<p>
|
413 |
-
<label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Category:', 'sp-news-and-widget' ); ?></label>
|
414 |
-
<?php
|
415 |
-
$dropdown_args = array(
|
416 |
-
'taxonomy' => WPNW_CAT,
|
417 |
-
'show_option_none' => __('All Categories', 'sp-news-and-widget'),
|
418 |
-
'option_none_value' => '',
|
419 |
-
'class' => 'widefat',
|
420 |
-
'id' => $this->get_field_id( 'category' ),
|
421 |
-
'name' => $this->get_field_name( 'category' ),
|
422 |
-
'selected' => $instance['category'],
|
423 |
-
);
|
424 |
-
wp_dropdown_categories( $dropdown_args );
|
425 |
-
?>
|
426 |
-
</p>
|
427 |
-
|
428 |
-
<?php }
|
429 |
-
|
430 |
-
function update($new_instance, $old_instance) {
|
431 |
-
|
432 |
-
$instance = $old_instance;
|
433 |
-
$instance['title'] = $new_instance['title'];
|
434 |
-
$instance['num_items'] = $new_instance['num_items'];
|
435 |
-
$instance['date'] = (bool) esc_attr( $new_instance['date'] );
|
436 |
-
$instance['show_category'] = (bool) esc_attr( $new_instance['show_category'] );
|
437 |
-
$instance['category'] = intval( $new_instance['category'] );
|
438 |
-
|
439 |
-
return $instance;
|
440 |
-
|
441 |
-
}
|
442 |
-
|
443 |
-
function widget($news_args, $instance) {
|
444 |
-
$instance = wp_parse_args( (array) $instance, $this->defaults );
|
445 |
-
extract($news_args, EXTR_SKIP);
|
446 |
-
|
447 |
-
$current_post_name = get_query_var('name');
|
448 |
-
|
449 |
-
$title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']);
|
450 |
-
$num_items = empty($instance['num_items']) ? '5' : apply_filters('widget_title', $instance['num_items']);
|
451 |
-
if ( isset( $instance['date'] ) && ( 1 == $instance['date'] ) ) { $date = "true"; } else { $date = "false"; }
|
452 |
-
if ( isset( $instance['show_category'] ) && ( 1 == $instance['show_category'] ) ) { $show_category = "true"; } else { $show_category = "false"; }
|
453 |
-
if ( isset( $instance['category'] ) && is_numeric( $instance['category'] ) ) $category = intval( $instance['category'] );
|
454 |
-
|
455 |
-
$postcount = 0;
|
456 |
-
|
457 |
-
echo $before_widget;
|
458 |
-
|
459 |
-
if ( $title ) {
|
460 |
-
echo $before_title . $title . $after_title;
|
461 |
-
}
|
462 |
-
|
463 |
-
$no_p = '';
|
464 |
-
if($date == "false" && $show_category == "false"){
|
465 |
-
$no_p = "no_p";
|
466 |
-
} ?>
|
467 |
-
|
468 |
-
<div class="recent-news-items <?php echo $no_p;?>">
|
469 |
-
|
470 |
-
<ul>
|
471 |
-
<?php // setup the query
|
472 |
-
$news_args = array(
|
473 |
-
'posts_per_page' => $num_items,
|
474 |
-
'post_type' => WPNW_POST_TYPE,
|
475 |
-
'post_status' => array( 'publish' ),
|
476 |
-
'order' => 'DESC'
|
477 |
-
);
|
478 |
-
|
479 |
-
if( !empty($category) ) {
|
480 |
-
$news_args['tax_query'] = array(
|
481 |
-
array(
|
482 |
-
'taxonomy' => WPNW_CAT,
|
483 |
-
'field' => 'term_id',
|
484 |
-
'terms' => $category
|
485 |
-
));
|
486 |
-
}
|
487 |
-
|
488 |
-
$cust_loop = new WP_Query($news_args);
|
489 |
-
|
490 |
-
global $post;
|
491 |
-
$post_count = $cust_loop->post_count;
|
492 |
-
$count = 0;
|
493 |
-
|
494 |
-
if ($cust_loop->have_posts()) : while ($cust_loop->have_posts()) : $cust_loop->the_post(); $postcount++;
|
495 |
-
|
496 |
-
$count++;
|
497 |
-
$terms = get_the_terms( $post->ID, WPNW_CAT );
|
498 |
-
$news_links = array();
|
499 |
-
|
500 |
-
if($terms){
|
501 |
-
foreach ( $terms as $term ) {
|
502 |
-
$term_link = get_term_link( $term );
|
503 |
-
$news_links[] = '<a href="' . esc_url( $term_link ) . '">'.$term->name.'</a>';
|
504 |
-
}
|
505 |
-
}
|
506 |
-
|
507 |
-
$cate_name = join( ", ", $news_links ); ?>
|
508 |
-
|
509 |
-
<li class="news_li">
|
510 |
-
<div class="news_thumb_left">
|
511 |
-
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
|
512 |
-
<?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail() ) {
|
513 |
-
the_post_thumbnail( array(80,80) );
|
514 |
-
} ?>
|
515 |
-
</a>
|
516 |
-
</div>
|
517 |
-
<div class="news_thumb_right">
|
518 |
-
<a class="newspost-title" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
|
519 |
-
<?php if($date == "true" || $show_category == "true"){ ?>
|
520 |
-
<div class="widget-date-post">
|
521 |
-
<?php echo ($date == "true")? get_the_date() : "" ;?>
|
522 |
-
<?php echo ($date == "true" && $show_category == "true" && $cate_name != '') ? " , " : "";?>
|
523 |
-
<?php echo ($show_category == 'true' && $cate_name != '') ? $cate_name : "" ?>
|
524 |
-
</div>
|
525 |
-
<?php } ?>
|
526 |
-
</div>
|
527 |
-
</li>
|
528 |
-
<?php endwhile;
|
529 |
-
endif;
|
530 |
-
wp_reset_postdata(); ?>
|
531 |
-
</ul>
|
532 |
-
</div>
|
533 |
-
<?php
|
534 |
-
echo $after_widget;
|
535 |
-
}
|
536 |
-
}
|
537 |
-
/* Register the widget */
|
538 |
-
function sp_news_thumb_widget_load_widgets() {
|
539 |
-
register_widget( 'SP_News_thmb_Widget' );
|
540 |
-
}
|
541 |
-
|
542 |
-
/* Load the widget */
|
543 |
-
add_action( 'widgets_init', 'sp_news_thumb_widget_load_widgets' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wpos-analytics/includes/class-anylc-admin.php
CHANGED
@@ -81,7 +81,7 @@ class Wpos_Anylc_Admin {
|
|
81 |
|
82 |
// WP Menu data
|
83 |
$wpos_menu_data = wp_list_pluck( $menu, 2 );
|
84 |
-
$anylc_page = isset( $_GET['page'] ) ? $_GET['page'] : null;
|
85 |
|
86 |
foreach ($wpos_analytics_module as $module_key => $module) {
|
87 |
|
@@ -150,7 +150,7 @@ class Wpos_Anylc_Admin {
|
|
150 |
|
151 |
global $current_user, $wpos_analytics_product;
|
152 |
|
153 |
-
$anylc_product_name = !empty( $_GET['page'] ) ? $_GET['page'] : '';
|
154 |
|
155 |
// if no data is set then return
|
156 |
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
|
@@ -183,7 +183,8 @@ class Wpos_Anylc_Admin {
|
|
183 |
|
184 |
global $wpos_analytics_product;
|
185 |
|
186 |
-
$anylc_product_name = isset( $_GET['page'] ) ?
|
|
|
187 |
|
188 |
// if no data is set then return
|
189 |
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
|
@@ -244,7 +245,8 @@ class Wpos_Anylc_Admin {
|
|
244 |
|
245 |
// If license notice is dismissed
|
246 |
if( isset($_GET['message']) && $_GET['message'] == 'wpos-anylc-dismiss-notice' && !empty( $_GET['anylc_id'] ) ) {
|
247 |
-
|
|
|
248 |
}
|
249 |
|
250 |
$redirect = get_option('wpos_anylc_redirect');
|
@@ -312,10 +314,11 @@ class Wpos_Anylc_Admin {
|
|
312 |
// Process Promotion Data
|
313 |
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
|
314 |
|
315 |
-
$promotion
|
316 |
-
$
|
|
|
317 |
|
318 |
-
$anylc_pdt = $_GET['wpos_anylc_pdt'];
|
319 |
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
320 |
|
321 |
if( !empty($promotion_pdt) ) {
|
@@ -353,7 +356,16 @@ class Wpos_Anylc_Admin {
|
|
353 |
// If user has opt in
|
354 |
if( $opt_in == 1 ) {
|
355 |
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
357 |
|
358 |
include( WPOS_ANYLC_DIR .'/templates/optout-popup.php' );
|
359 |
}
|
@@ -378,9 +390,9 @@ class Wpos_Anylc_Admin {
|
|
378 |
|
379 |
global $wpos_analytics_product;
|
380 |
|
381 |
-
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? $_GET['wpos_anylc_pdt']
|
382 |
-
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? $_GET['page']
|
383 |
-
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ]
|
384 |
|
385 |
// If valid product data found
|
386 |
if( $anylc_pdt_data ) {
|
@@ -412,21 +424,7 @@ class Wpos_Anylc_Admin {
|
|
412 |
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
413 |
}
|
414 |
|
415 |
-
$
|
416 |
-
$optin_form_data['wpos_anylc_action'] = 'skip';
|
417 |
-
|
418 |
-
$anylc_args = array(
|
419 |
-
'timeout' => 60,
|
420 |
-
'sslverify' => false,
|
421 |
-
'body' => $optin_form_data,
|
422 |
-
);
|
423 |
-
|
424 |
-
// Post back to get a response.
|
425 |
-
$response = wp_safe_remote_post( 'http://analytics.wponlinesupport.com', $anylc_args );
|
426 |
-
|
427 |
-
if( wp_remote_retrieve_response_code( $response ) == 200 ) {
|
428 |
-
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 2) );
|
429 |
-
}
|
430 |
|
431 |
// Redirect to original menu
|
432 |
$redirect_url = wpos_anylc_pdt_url( $anylc_pdt_data, 'offer' );
|
@@ -445,25 +443,10 @@ class Wpos_Anylc_Admin {
|
|
445 |
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
446 |
}
|
447 |
|
448 |
-
$
|
449 |
-
$optin_form_data['wpos_anylc_action'] = 'optout';
|
450 |
|
451 |
-
|
452 |
-
|
453 |
-
'sslverify' => false,
|
454 |
-
'body' => $optin_form_data,
|
455 |
-
);
|
456 |
-
|
457 |
-
// Post back to get a response.
|
458 |
-
$response = wp_safe_remote_post( 'http://analytics.wponlinesupport.com', $anylc_args );
|
459 |
-
|
460 |
-
if( wp_remote_retrieve_response_code( $response ) == 200 ) {
|
461 |
-
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 0) );
|
462 |
-
}
|
463 |
-
|
464 |
-
// Redirect to original menu
|
465 |
-
$redirect_url = isset( $_GET['redirect'] ) ? $_GET['redirect'] : wpos_anylc_pdt_url( $anylc_pdt_data );
|
466 |
-
$redirect_url = add_query_arg( array( 'message' => 'optout_success' ), $redirect_url );
|
467 |
if( $redirect_url ) {
|
468 |
wp_redirect( $redirect_url );
|
469 |
exit;
|
81 |
|
82 |
// WP Menu data
|
83 |
$wpos_menu_data = wp_list_pluck( $menu, 2 );
|
84 |
+
$anylc_page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : null;
|
85 |
|
86 |
foreach ($wpos_analytics_module as $module_key => $module) {
|
87 |
|
150 |
|
151 |
global $current_user, $wpos_analytics_product;
|
152 |
|
153 |
+
$anylc_product_name = !empty( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
|
154 |
|
155 |
// if no data is set then return
|
156 |
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
|
183 |
|
184 |
global $wpos_analytics_product;
|
185 |
|
186 |
+
$anylc_product_name = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
|
187 |
+
$anylc_product_name = str_replace( '-offers', '', $anylc_product_name );
|
188 |
|
189 |
// if no data is set then return
|
190 |
if( ! isset( $wpos_analytics_product[ $anylc_product_name ] ) ) {
|
245 |
|
246 |
// If license notice is dismissed
|
247 |
if( isset($_GET['message']) && $_GET['message'] == 'wpos-anylc-dismiss-notice' && !empty( $_GET['anylc_id'] ) ) {
|
248 |
+
$anylc_id = sanitize_text_field( $_GET['anylc_id'] );
|
249 |
+
set_transient( 'wpos_anylc_optin_notice_'.$anylc_id, true, 172800 );
|
250 |
}
|
251 |
|
252 |
$redirect = get_option('wpos_anylc_redirect');
|
314 |
// Process Promotion Data
|
315 |
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
|
316 |
|
317 |
+
$promotion = 1;
|
318 |
+
$wpos_anylc_promo_pdt = sanitize_text_field( $_GET['wpos_anylc_promo_pdt'] );
|
319 |
+
$promotion_pdt = explode( ',', $wpos_anylc_promo_pdt );
|
320 |
|
321 |
+
$anylc_pdt = sanitize_text_field( $_GET['wpos_anylc_pdt'] );
|
322 |
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
323 |
|
324 |
if( !empty($promotion_pdt) ) {
|
356 |
// If user has opt in
|
357 |
if( $opt_in == 1 ) {
|
358 |
|
359 |
+
// Creating redirect URL
|
360 |
+
$plugin_status = isset( $_GET['plugin_status'] ) ? sanitize_text_field( $_GET['plugin_status'] ) : false;
|
361 |
+
$paged = isset( $_GET['paged'] ) ? sanitize_text_field( $_GET['paged'] ) : false;
|
362 |
+
$s = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : false;
|
363 |
+
|
364 |
+
$redirect_url = add_query_arg( array( 'plugin_status' => $plugin_status, 'paged' => $paged, 's' => $s, 'wpos_anylc_pdt' => $module['slug'] ), admin_url( 'plugins.php' ) );
|
365 |
+
$redirect_url = wp_nonce_url( $redirect_url, 'wpos_anylc_act'.'|'.$module['slug'] );
|
366 |
+
|
367 |
+
// Form Data
|
368 |
+
$optin_form_data = wpos_anylc_optin_data( $module['slug'], $redirect_url );
|
369 |
|
370 |
include( WPOS_ANYLC_DIR .'/templates/optout-popup.php' );
|
371 |
}
|
390 |
|
391 |
global $wpos_analytics_product;
|
392 |
|
393 |
+
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? sanitize_text_field( $_GET['wpos_anylc_pdt'] ) : '';
|
394 |
+
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? sanitize_text_field( $_GET['page'] ) : $anylc_pdt;
|
395 |
+
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
396 |
|
397 |
// If valid product data found
|
398 |
if( $anylc_pdt_data ) {
|
424 |
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
425 |
}
|
426 |
|
427 |
+
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 2) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
|
429 |
// Redirect to original menu
|
430 |
$redirect_url = wpos_anylc_pdt_url( $anylc_pdt_data, 'offer' );
|
443 |
wp_die( __('Sorry, Something happened wrong.', 'wpos_analytic'), 'wpos_anylc_err', array('back_link' => true) );
|
444 |
}
|
445 |
|
446 |
+
$opt_in_data = wpos_anylc_update_option( $anylc_pdt_data['anylc_optin'], array('status' => 0) );
|
|
|
447 |
|
448 |
+
// Redirect with success message
|
449 |
+
$redirect_url = add_query_arg( array( 'message' => 'optout_success', 'wpos_anylc_action' => false, 'wpos_anylc_pdt' => false, '_wpnonce' => false ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
450 |
if( $redirect_url ) {
|
451 |
wp_redirect( $redirect_url );
|
452 |
exit;
|
wpos-analytics/includes/class-anylc-script.php
CHANGED
@@ -32,10 +32,11 @@ class Wpos_Anylc_Script {
|
|
32 |
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
|
33 |
global $wpos_analytics_product;
|
34 |
|
35 |
-
$promotion
|
36 |
-
$
|
|
|
37 |
|
38 |
-
$anylc_pdt = $_GET['wpos_anylc_pdt'];
|
39 |
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
40 |
|
41 |
if( !empty($promotion_pdt) ) {
|
32 |
if( !empty($_GET['message']) && $_GET['message'] == 'wpos_anylc_promotion' && !empty($_GET['wpos_anylc_pdt']) && !empty($_GET['wpos_anylc_promo_pdt']) ) {
|
33 |
global $wpos_analytics_product;
|
34 |
|
35 |
+
$promotion = 1;
|
36 |
+
$wpos_anylc_promo_pdt = sanitize_text_field( $_GET['wpos_anylc_promo_pdt'] );
|
37 |
+
$promotion_pdt = explode( ',', $wpos_anylc_promo_pdt );
|
38 |
|
39 |
+
$anylc_pdt = sanitize_text_field( $_GET['wpos_anylc_pdt'] );
|
40 |
$anylc_pdt_data = isset( $wpos_analytics_product[ $anylc_pdt ] ) ? $wpos_analytics_product[ $anylc_pdt ] : false;
|
41 |
|
42 |
if( !empty($promotion_pdt) ) {
|
wpos-analytics/includes/wpos-anylc-function.php
CHANGED
@@ -25,6 +25,21 @@ function wpos_anylc_text( $text, $echo = false ) {
|
|
25 |
}
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
/**
|
29 |
* Check Multidimention Array
|
30 |
*
|
@@ -63,7 +78,7 @@ function wpos_anylc_site_uid() {
|
|
63 |
* @package Wpos Analytic
|
64 |
* @since 1.0.0
|
65 |
*/
|
66 |
-
function wpos_anylc_optin_data( $anylc_pdt = false ) {
|
67 |
|
68 |
// Skip if not admin area
|
69 |
if ( !is_admin() ) {
|
@@ -74,20 +89,23 @@ function wpos_anylc_optin_data( $anylc_pdt = false ) {
|
|
74 |
|
75 |
// Takind some data
|
76 |
$theme_data = wp_get_theme();
|
77 |
-
$page = isset( $_GET['page'] ) ? $_GET['page'] : false;
|
78 |
|
79 |
// If product is not passed
|
80 |
if( ! $anylc_pdt ) {
|
81 |
-
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? $_GET['wpos_anylc_pdt'] : '';
|
82 |
-
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? $_GET['page']
|
83 |
}
|
84 |
|
85 |
// If a valid product is there
|
86 |
if( $anylc_pdt && !empty( $wpos_analytics_product[ $anylc_pdt ] ) ) {
|
87 |
|
88 |
$analy_product = $wpos_analytics_product[ $anylc_pdt ];
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
91 |
|
92 |
// Getting data according to type
|
93 |
if( $analy_product['type'] == 'theme' ) {
|
@@ -130,7 +148,7 @@ function wpos_anylc_optin_data( $anylc_pdt = false ) {
|
|
130 |
'user_email' => get_bloginfo( 'admin_email' ),
|
131 |
'ip_address' => wpos_anylc_get_ip_address(),
|
132 |
'site_uid' => wpos_anylc_site_uid(),
|
133 |
-
'return_url' =>
|
134 |
);
|
135 |
return $optin_data;
|
136 |
}
|
@@ -247,9 +265,9 @@ function wpos_anylc_optout_url( $module_data = '', $optin_status = null, $redire
|
|
247 |
if( $optin_status == 1 ) {
|
248 |
|
249 |
if( ! $redirect_url ) {
|
250 |
-
$plugin_status = isset( $_GET['plugin_status'] ) ? $_GET['plugin_status'] : false;
|
251 |
-
$paged = isset( $_GET['paged'] ) ? $_GET['paged'] : false;
|
252 |
-
$s = isset( $_GET['s'] ) ? $_GET['s'] : false;
|
253 |
|
254 |
$redirect_url = add_query_arg( array( 'plugin_status' => $plugin_status, 'paged' => $paged, 's' => $s ), admin_url( 'plugins.php' ) );
|
255 |
}
|
@@ -278,7 +296,7 @@ function wpos_anylc_pdt_url( $module_data = '', $type = false ) {
|
|
278 |
switch ( $type ) {
|
279 |
case 'promotion':
|
280 |
|
281 |
-
$promotion = !empty( $_GET['promotion'] ) ? $_GET['promotion'] : '';
|
282 |
|
283 |
if( !empty( $promotion ) ) {
|
284 |
$promotion = is_array( $promotion ) ? implode( ',', $promotion ) : $promotion;
|
@@ -295,7 +313,7 @@ function wpos_anylc_pdt_url( $module_data = '', $type = false ) {
|
|
295 |
|
296 |
case 'offer-promotion':
|
297 |
|
298 |
-
$promotion = !empty( $_GET['promotion'] ) ? $_GET['promotion'] : '';
|
299 |
|
300 |
if( !empty( $module_data['offers'] ) ) {
|
301 |
$redirect_url = add_query_arg( array( 'page' => $module_data['slug'].'-offers' ), $redirect_url );
|
25 |
}
|
26 |
}
|
27 |
|
28 |
+
/**
|
29 |
+
* Clean variables using sanitize_text_field. Arrays are cleaned recursively.
|
30 |
+
* Non-scalar values are ignored.
|
31 |
+
*
|
32 |
+
* @since 1.0
|
33 |
+
*/
|
34 |
+
function wpos_anylc_clean( $var ) {
|
35 |
+
if ( is_array( $var ) ) {
|
36 |
+
return array_map( 'wpos_anylc_clean', $var );
|
37 |
+
} else {
|
38 |
+
$data = is_scalar( $var ) ? sanitize_text_field( $var ) : $var;
|
39 |
+
return wp_unslash($data);
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
/**
|
44 |
* Check Multidimention Array
|
45 |
*
|
78 |
* @package Wpos Analytic
|
79 |
* @since 1.0.0
|
80 |
*/
|
81 |
+
function wpos_anylc_optin_data( $anylc_pdt = false, $return_url = '' ) {
|
82 |
|
83 |
// Skip if not admin area
|
84 |
if ( !is_admin() ) {
|
89 |
|
90 |
// Takind some data
|
91 |
$theme_data = wp_get_theme();
|
92 |
+
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : false;
|
93 |
|
94 |
// If product is not passed
|
95 |
if( ! $anylc_pdt ) {
|
96 |
+
$anylc_pdt = !empty( $_GET['wpos_anylc_pdt'] ) ? sanitize_text_field( $_GET['wpos_anylc_pdt'] ) : '';
|
97 |
+
$anylc_pdt = ( ! $anylc_pdt && !empty( $_GET['page'] ) ) ? sanitize_text_field( $_GET['page'] ) : $anylc_pdt;
|
98 |
}
|
99 |
|
100 |
// If a valid product is there
|
101 |
if( $anylc_pdt && !empty( $wpos_analytics_product[ $anylc_pdt ] ) ) {
|
102 |
|
103 |
$analy_product = $wpos_analytics_product[ $anylc_pdt ];
|
104 |
+
|
105 |
+
if( empty( $return_url ) ) {
|
106 |
+
$return_url = add_query_arg( array( 'page' => $page ), admin_url('admin.php') );
|
107 |
+
$return_url = wp_nonce_url( $return_url, 'wpos_anylc_act' );
|
108 |
+
}
|
109 |
|
110 |
// Getting data according to type
|
111 |
if( $analy_product['type'] == 'theme' ) {
|
148 |
'user_email' => get_bloginfo( 'admin_email' ),
|
149 |
'ip_address' => wpos_anylc_get_ip_address(),
|
150 |
'site_uid' => wpos_anylc_site_uid(),
|
151 |
+
'return_url' => $return_url,
|
152 |
);
|
153 |
return $optin_data;
|
154 |
}
|
265 |
if( $optin_status == 1 ) {
|
266 |
|
267 |
if( ! $redirect_url ) {
|
268 |
+
$plugin_status = isset( $_GET['plugin_status'] ) ? sanitize_text_field( $_GET['plugin_status'] ) : false;
|
269 |
+
$paged = isset( $_GET['paged'] ) ? sanitize_text_field( $_GET['paged'] ) : false;
|
270 |
+
$s = isset( $_GET['s'] ) ? sanitize_text_field( $_GET['s'] ) : false;
|
271 |
|
272 |
$redirect_url = add_query_arg( array( 'plugin_status' => $plugin_status, 'paged' => $paged, 's' => $s ), admin_url( 'plugins.php' ) );
|
273 |
}
|
296 |
switch ( $type ) {
|
297 |
case 'promotion':
|
298 |
|
299 |
+
$promotion = !empty( $_GET['promotion'] ) ? wpos_anylc_clean( $_GET['promotion'] ) : '';
|
300 |
|
301 |
if( !empty( $promotion ) ) {
|
302 |
$promotion = is_array( $promotion ) ? implode( ',', $promotion ) : $promotion;
|
313 |
|
314 |
case 'offer-promotion':
|
315 |
|
316 |
+
$promotion = !empty( $_GET['promotion'] ) ? wpos_anylc_clean( $_GET['promotion'] ) : '';
|
317 |
|
318 |
if( !empty( $module_data['offers'] ) ) {
|
319 |
$redirect_url = add_query_arg( array( 'page' => $module_data['slug'].'-offers' ), $redirect_url );
|
wpos-analytics/templates/analytic.php
CHANGED
@@ -37,11 +37,6 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
37 |
<p>Contribute in helping us making <b><?php echo $product_name; ?></b> compatible with most themes and plugins by allowing to share non-sensitive data to <a target="_blank" href="https://www.wponlinesupport.com">wponlinesupport.com</a> about your website.</p>
|
38 |
<p>If you skip this, that's okay! <b><?php echo $product_name; ?></b> will still work just fine.</p>
|
39 |
|
40 |
-
<div class="wpos-anylc-subs-wrap">
|
41 |
-
<input type="hidden" name="subscribe" value="" />
|
42 |
-
<label><input type="checkbox" value="1" name="subscribe" checked="checked" /> Subscribe for Updates and Promotions</label>
|
43 |
-
</div>
|
44 |
-
|
45 |
<?php if( !empty( $analy_product['promotion'] ) ) { ?>
|
46 |
<div class="wpos-anylc-promotion-wrap">
|
47 |
<?php foreach( $analy_product['promotion'] as $promotion_key => $promotion_data ) { ?>
|
@@ -54,10 +49,10 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
54 |
<button type="submit" name="wpos_anylc_optin" class="button button-primary button-large right wpos-anylc-allow-btn" value="wpos_anylc_optin">Allow and Continue</button>
|
55 |
|
56 |
<?php if( is_null( $opt_in ) ) { ?>
|
57 |
-
<
|
58 |
<?php }
|
59 |
|
60 |
-
if( !empty( $optin_form_data ) ) {
|
61 |
foreach ($optin_form_data as $data_key => $data_value) {
|
62 |
echo '<input type="hidden" name="'.esc_attr( $data_key ).'" value="'.esc_attr( $data_value ).'" />';
|
63 |
}
|
@@ -92,7 +87,7 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
92 |
</div>
|
93 |
</div>
|
94 |
<div class="wpos-anylc-terms">
|
95 |
-
<a href="https://www.wponlinesupport.com/privacy-policy
|
96 |
</div>
|
97 |
</div>
|
98 |
</form>
|
37 |
<p>Contribute in helping us making <b><?php echo $product_name; ?></b> compatible with most themes and plugins by allowing to share non-sensitive data to <a target="_blank" href="https://www.wponlinesupport.com">wponlinesupport.com</a> about your website.</p>
|
38 |
<p>If you skip this, that's okay! <b><?php echo $product_name; ?></b> will still work just fine.</p>
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php if( !empty( $analy_product['promotion'] ) ) { ?>
|
41 |
<div class="wpos-anylc-promotion-wrap">
|
42 |
<?php foreach( $analy_product['promotion'] as $promotion_key => $promotion_data ) { ?>
|
49 |
<button type="submit" name="wpos_anylc_optin" class="button button-primary button-large right wpos-anylc-allow-btn" value="wpos_anylc_optin">Allow and Continue</button>
|
50 |
|
51 |
<?php if( is_null( $opt_in ) ) { ?>
|
52 |
+
<button type="submit" name="wpos_anylc_action" class="button button-secondary button-large wpos-anylc-skip-btn" value="skip">Skip</button>
|
53 |
<?php }
|
54 |
|
55 |
+
if( ! empty( $optin_form_data ) ) {
|
56 |
foreach ($optin_form_data as $data_key => $data_value) {
|
57 |
echo '<input type="hidden" name="'.esc_attr( $data_key ).'" value="'.esc_attr( $data_value ).'" />';
|
58 |
}
|
87 |
</div>
|
88 |
</div>
|
89 |
<div class="wpos-anylc-terms">
|
90 |
+
<a href="https://www.wponlinesupport.com/privacy-policy/#free-pluign-info" target="_blank">Privacy Policy</a> - <a href="https://www.wponlinesupport.com/term-and-condition/" target="_blank">Terms of Service</a>
|
91 |
</div>
|
92 |
</div>
|
93 |
</form>
|
wpos-analytics/templates/optout-popup.php
CHANGED
@@ -21,8 +21,17 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
21 |
<p>By clicking "Opt Out", we will no longer be sending any data from <b><?php echo $module['name']; ?></b> to <a href="https://www.wponlinesupport.com/" target="_blank">wponlinesupport.com</a>.</p>
|
22 |
</div>
|
23 |
<div class="wpos-anylc-popup-footer">
|
24 |
-
<
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
</div>
|
27 |
|
28 |
</div><!-- end .wpos-anylc-popup-block -->
|
21 |
<p>By clicking "Opt Out", we will no longer be sending any data from <b><?php echo $module['name']; ?></b> to <a href="https://www.wponlinesupport.com/" target="_blank">wponlinesupport.com</a>.</p>
|
22 |
</div>
|
23 |
<div class="wpos-anylc-popup-footer">
|
24 |
+
<form method="POST" action="http://analytics.wponlinesupport.com">
|
25 |
+
<?php
|
26 |
+
if( ! empty( $optin_form_data ) ) {
|
27 |
+
foreach ($optin_form_data as $data_key => $data_value) {
|
28 |
+
echo '<input type="hidden" name="'.esc_attr( $data_key ).'" value="'.esc_attr( $data_value ).'" />';
|
29 |
+
}
|
30 |
+
}
|
31 |
+
?>
|
32 |
+
<button type="submit" name="wpos_anylc_action" class="button button-secondary" value="optout">Opt Out</button>
|
33 |
+
<button type="button" class="button button-primary wpos-anylc-popup-close">Sure, Let Me Continue Helping</button>
|
34 |
+
</form>
|
35 |
</div>
|
36 |
|
37 |
</div><!-- end .wpos-anylc-popup-block -->
|
wpos-analytics/wpos-analytics.php
CHANGED
@@ -102,7 +102,7 @@ final class WPOS_Analytics {
|
|
102 |
*/
|
103 |
private function setup_constants() {
|
104 |
|
105 |
-
$this->define( 'WPOS_ANYLC_VERSION', '1.
|
106 |
$this->define( 'WPOS_ANYLC_DIR', plugin_dir_path( __FILE__ ) );
|
107 |
$this->define( 'WPOS_ANYLC_URL', plugin_dir_url( __FILE__ ) );
|
108 |
}
|
102 |
*/
|
103 |
private function setup_constants() {
|
104 |
|
105 |
+
$this->define( 'WPOS_ANYLC_VERSION', '1.1' );
|
106 |
$this->define( 'WPOS_ANYLC_DIR', plugin_dir_path( __FILE__ ) );
|
107 |
$this->define( 'WPOS_ANYLC_URL', plugin_dir_url( __FILE__ ) );
|
108 |
}
|