Version Description
Release Date - 31 July 2017 * Fix an issue for wordpress install which are running < PHP5.5.5
Download this release
Release Info
Developer | rmahfoud |
Plugin | WP Hide Post |
Version | 2.0.5 |
Comparing to | |
See all releases |
Code changes from version 2.0.6 to 2.0.5
- admin/class-wp-hide-post-admin.php +8 -9
- admin/conditions.php +2 -1
- admin/license/LicenseItem.php +0 -1
- admin/plugin/EDD_SL_Plugin_Updater.php +3 -6
- admin/plugin/SCB_Item_Helper.php +0 -1
- admin/settings/class_settings.php +1 -2
- includes/class-wp-hide-post.php +17 -20
- includes/helpers.php +9 -22
- public/class-wp-hide-post-public.php +1 -1
- readme.txt +5 -12
- wp-hide-post.php +2 -2
admin/class-wp-hide-post-admin.php
CHANGED
@@ -69,7 +69,7 @@ class wp_hide_post_Admin
|
|
69 |
$this->wp_hide_post = $wp_hide_post;
|
70 |
$this->version = $version;
|
71 |
$this->license = $license;
|
72 |
-
$this->post_types =
|
73 |
if (!is_array($this->post_types))
|
74 |
{
|
75 |
$this->post_types = array('post', 'page');
|
@@ -644,8 +644,7 @@ HTML;
|
|
644 |
}
|
645 |
public function register_setting_page()
|
646 |
{
|
647 |
-
|
648 |
-
$valid = is_object($this->license) && $this->license->is_valid();
|
649 |
wp_hide_post()->settingManager()->register_tab(array('id' => 'wphp_gen', 'title' => 'General'));
|
650 |
$options = array();
|
651 |
foreach ((array) scb_custom_post_types() as $type => $detail)
|
@@ -658,7 +657,7 @@ HTML;
|
|
658 |
$options[$type]['text'] .= " -- For WP hide post Pro users only";
|
659 |
}
|
660 |
}
|
661 |
-
$pro = '<div><a target="_blank" style="color:red" href="
|
662 |
wp_hide_post()->settingManager()->register_setting_field('wphp_gen', array(
|
663 |
array('name' => 'wphp_post_types',
|
664 |
'label' => wphp_('Allowed custom post types'),
|
@@ -691,9 +690,9 @@ HTML;
|
|
691 |
}
|
692 |
public function register_plugin($licenses)
|
693 |
{
|
694 |
-
$licenses[] = array('id' => '
|
695 |
'type' => 'plugin',
|
696 |
-
'name' => '
|
697 |
'label' => 'WP hide Post Plugin',
|
698 |
'options' => array(
|
699 |
'license_text' => array('invalid' => 'Get your WP Hide Post Pro license from here <a href="http://scriptburn.com/wphp" target="_blank">here</a>'),
|
@@ -805,7 +804,7 @@ HTML;
|
|
805 |
//render our quick edit and bulk edit box
|
806 |
public function display_custom_quickedit($column_name, $post_type)
|
807 |
{
|
808 |
-
$valid =
|
809 |
|
810 |
if (!wphp_get_setting('wphp_gen', 'show_in_quickedit'))
|
811 |
{
|
@@ -864,7 +863,7 @@ HTML;
|
|
864 |
$allChecked = $detail['value'];
|
865 |
$index++;
|
866 |
}
|
867 |
-
$pro = '<div style="padding:10px;padding-bottom:0px"><a target="_blank" style="color:red" href="
|
868 |
if ($post_type !== 'page')
|
869 |
{
|
870 |
$pre[] = '<script>(function($)
|
@@ -981,7 +980,7 @@ $current_v = isset($_GET['wphp_hidden_on']) ? $_GET['wphp_hidden_on'] : array();
|
|
981 |
}
|
982 |
|
983 |
// Filter the posts acording to selected filter in post list select box
|
984 |
-
public function query_posts_join_custom_filter($join,
|
985 |
{
|
986 |
|
987 |
global $wpdb, $pagenow;
|
69 |
$this->wp_hide_post = $wp_hide_post;
|
70 |
$this->version = $version;
|
71 |
$this->license = $license;
|
72 |
+
$this->post_types = $this->license->is_valid() ? wphp_get_setting('wphp_gen', 'wphp_post_types') : false;
|
73 |
if (!is_array($this->post_types))
|
74 |
{
|
75 |
$this->post_types = array('post', 'page');
|
644 |
}
|
645 |
public function register_setting_page()
|
646 |
{
|
647 |
+
$valid = $this->license->is_valid();
|
|
|
648 |
wp_hide_post()->settingManager()->register_tab(array('id' => 'wphp_gen', 'title' => 'General'));
|
649 |
$options = array();
|
650 |
foreach ((array) scb_custom_post_types() as $type => $detail)
|
657 |
$options[$type]['text'] .= " -- For WP hide post Pro users only";
|
658 |
}
|
659 |
}
|
660 |
+
$pro = '<div><a target="_blank" style="color:red" href="' . $this->item_url . '">For WP hide post Pro Users only</a></div>';
|
661 |
wp_hide_post()->settingManager()->register_setting_field('wphp_gen', array(
|
662 |
array('name' => 'wphp_post_types',
|
663 |
'label' => wphp_('Allowed custom post types'),
|
690 |
}
|
691 |
public function register_plugin($licenses)
|
692 |
{
|
693 |
+
$licenses[] = array('id' => wp_hide_post()->info('id'),
|
694 |
'type' => 'plugin',
|
695 |
+
'name' => wp_hide_post()->info('name'),
|
696 |
'label' => 'WP hide Post Plugin',
|
697 |
'options' => array(
|
698 |
'license_text' => array('invalid' => 'Get your WP Hide Post Pro license from here <a href="http://scriptburn.com/wphp" target="_blank">here</a>'),
|
804 |
//render our quick edit and bulk edit box
|
805 |
public function display_custom_quickedit($column_name, $post_type)
|
806 |
{
|
807 |
+
$valid = $this->license->is_valid();
|
808 |
|
809 |
if (!wphp_get_setting('wphp_gen', 'show_in_quickedit'))
|
810 |
{
|
863 |
$allChecked = $detail['value'];
|
864 |
$index++;
|
865 |
}
|
866 |
+
$pro = '<div style="padding:10px;padding-bottom:0px"><a target="_blank" style="color:red" href="' . $this->item_url . '">For WP hide post Pro Users only</a></div>';
|
867 |
if ($post_type !== 'page')
|
868 |
{
|
869 |
$pre[] = '<script>(function($)
|
980 |
}
|
981 |
|
982 |
// Filter the posts acording to selected filter in post list select box
|
983 |
+
public function query_posts_join_custom_filter($join, &$wp_query)
|
984 |
{
|
985 |
|
986 |
global $wpdb, $pagenow;
|
admin/conditions.php
CHANGED
@@ -39,7 +39,8 @@ if (!function_exists('wphp_is_post_front_post'))
|
|
39 |
{
|
40 |
function wphp_is_post_front_post()
|
41 |
{
|
42 |
-
|
|
|
43 |
}
|
44 |
}
|
45 |
/**
|
39 |
{
|
40 |
function wphp_is_post_front_post()
|
41 |
{
|
42 |
+
|
43 |
+
return is_front_page() || is_home();
|
44 |
}
|
45 |
}
|
46 |
/**
|
admin/license/LicenseItem.php
CHANGED
@@ -359,7 +359,6 @@ class SCB_LicenseItem
|
|
359 |
// p_d( $url );
|
360 |
//$this->debug('license', __FUNCTION__ . "-" . __LINE__, $url);
|
361 |
$response = scb_license_manager()->sendGetRequest($url . http_build_query($api_params));
|
362 |
-
|
363 |
}
|
364 |
else
|
365 |
{
|
359 |
// p_d( $url );
|
360 |
//$this->debug('license', __FUNCTION__ . "-" . __LINE__, $url);
|
361 |
$response = scb_license_manager()->sendGetRequest($url . http_build_query($api_params));
|
|
|
362 |
}
|
363 |
else
|
364 |
{
|
admin/plugin/EDD_SL_Plugin_Updater.php
CHANGED
@@ -37,11 +37,8 @@ class EDD_SL_Plugin_Updater
|
|
37 |
$this->version = $_api_data['version'];
|
38 |
|
39 |
// Set up hooks.
|
40 |
-
|
41 |
-
|
42 |
-
$this->init();
|
43 |
-
add_action('admin_init', array($this, 'show_changelog'));
|
44 |
-
}
|
45 |
}
|
46 |
|
47 |
/**
|
@@ -107,7 +104,7 @@ class EDD_SL_Plugin_Updater
|
|
107 |
|
108 |
$_transient_data->response[$this->name] = $version_info;
|
109 |
$_transient_data->response[$this->name]->plugin = $this->name;
|
110 |
-
|
111 |
|
112 |
$_transient_data->last_checked = time();
|
113 |
//$_transient_data->last_updated=date( ( 'M j, Y @ H:i' )
|
37 |
$this->version = $_api_data['version'];
|
38 |
|
39 |
// Set up hooks.
|
40 |
+
$this->init();
|
41 |
+
add_action('admin_init', array($this, 'show_changelog'));
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
/**
|
104 |
|
105 |
$_transient_data->response[$this->name] = $version_info;
|
106 |
$_transient_data->response[$this->name]->plugin = $this->name;
|
107 |
+
}
|
108 |
|
109 |
$_transient_data->last_checked = time();
|
110 |
//$_transient_data->last_updated=date( ( 'M j, Y @ H:i' )
|
admin/plugin/SCB_Item_Helper.php
CHANGED
@@ -156,7 +156,6 @@ if (!class_exists('SCB_Item_Helper'))
|
|
156 |
|
157 |
public function plugin_updater()
|
158 |
{
|
159 |
-
|
160 |
$plugin_data = $this->plugin_data("", true);
|
161 |
$plugin_conf = array(
|
162 |
'version' => $plugin_data['Version'], // current version number
|
156 |
|
157 |
public function plugin_updater()
|
158 |
{
|
|
|
159 |
$plugin_data = $this->plugin_data("", true);
|
160 |
$plugin_conf = array(
|
161 |
'version' => $plugin_data['Version'], // current version number
|
admin/settings/class_settings.php
CHANGED
@@ -154,7 +154,6 @@ if (!class_exists('wphp_settings'))
|
|
154 |
$this->license_fields = array();
|
155 |
|
156 |
$licenses = apply_filters('scb_license_items', $licenses);
|
157 |
-
|
158 |
foreach ($licenses as $license)
|
159 |
{
|
160 |
|
@@ -330,7 +329,7 @@ if (!class_exists('wphp_settings'))
|
|
330 |
//p_d($this->all_tabs);
|
331 |
if (isset($_POST['option_page']) && isset($this->all_tabs[$_POST['option_page']]) && is_callable($this->all_tabs[$_POST['option_page']]['options']['form']['post_handler']))
|
332 |
{
|
333 |
-
$ret = call_user_func_array($this->all_tabs[$_POST['option_page']]['options']['form']['post_handler'],
|
334 |
}
|
335 |
echo '<div class="wrap">';
|
336 |
$this->settings_api->show_navigation();
|
154 |
$this->license_fields = array();
|
155 |
|
156 |
$licenses = apply_filters('scb_license_items', $licenses);
|
|
|
157 |
foreach ($licenses as $license)
|
158 |
{
|
159 |
|
329 |
//p_d($this->all_tabs);
|
330 |
if (isset($_POST['option_page']) && isset($this->all_tabs[$_POST['option_page']]) && is_callable($this->all_tabs[$_POST['option_page']]['options']['form']['post_handler']))
|
331 |
{
|
332 |
+
$ret = call_user_func_array($this->all_tabs[$_POST['option_page']]['options']['form']['post_handler'], [$_POST]);
|
333 |
}
|
334 |
echo '<div class="wrap">';
|
335 |
$this->settings_api->show_navigation();
|
includes/class-wp-hide-post.php
CHANGED
@@ -76,8 +76,8 @@ class wp_hide_post
|
|
76 |
private static $instance;
|
77 |
private $plugin_admin;
|
78 |
|
79 |
-
const id = 'wp-hide-post';
|
80 |
-
const name = 'WP Hide Post';
|
81 |
|
82 |
private $info;
|
83 |
|
@@ -95,7 +95,7 @@ class wp_hide_post
|
|
95 |
{
|
96 |
if (is_null(self::$instance))
|
97 |
{
|
98 |
-
self::$instance = new
|
99 |
}
|
100 |
|
101 |
return self::$instance;
|
@@ -407,7 +407,7 @@ class wp_hide_post
|
|
407 |
}
|
408 |
public function license()
|
409 |
{
|
410 |
-
return SCB_LicenseManager::getInstance()->item('
|
411 |
}
|
412 |
public function init()
|
413 |
{
|
@@ -453,23 +453,20 @@ class wp_hide_post
|
|
453 |
echo (implode("\n", $output));
|
454 |
},
|
455 |
));
|
456 |
-
if (wphp_ispro())
|
457 |
-
{
|
458 |
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
}
|
473 |
}
|
474 |
public function define_globals()
|
475 |
{
|
76 |
private static $instance;
|
77 |
private $plugin_admin;
|
78 |
|
79 |
+
const id = 'wp-hide-post-pro';
|
80 |
+
const name = 'WP Hide Post Pro';
|
81 |
|
82 |
private $info;
|
83 |
|
95 |
{
|
96 |
if (is_null(self::$instance))
|
97 |
{
|
98 |
+
self::$instance = new static();
|
99 |
}
|
100 |
|
101 |
return self::$instance;
|
407 |
}
|
408 |
public function license()
|
409 |
{
|
410 |
+
return SCB_LicenseManager::getInstance()->item($this->info('id'));
|
411 |
}
|
412 |
public function init()
|
413 |
{
|
453 |
echo (implode("\n", $output));
|
454 |
},
|
455 |
));
|
|
|
|
|
456 |
|
457 |
+
scb_license_manager()->add(
|
458 |
+
$this->info('id'),
|
459 |
+
null,
|
460 |
+
'plugin',
|
461 |
+
$this->info('name'),
|
462 |
+
null,
|
463 |
+
array(
|
464 |
+
'license_text' => array('invalid' => 'Get your WP Hide Post Pro license from here <a href="http://scriptburn.com/wphp" target="_blank">here</a>'),
|
465 |
+
'store_url' => "http://scriptburn.com",
|
466 |
+
'file' => $this->info('file'),
|
467 |
+
|
468 |
+
)
|
469 |
+
);
|
|
|
470 |
}
|
471 |
public function define_globals()
|
472 |
{
|
includes/helpers.php
CHANGED
@@ -142,38 +142,29 @@ if (!function_exists('wphp_is_applicable'))
|
|
142 |
|
143 |
$types = array_flip(wphp_allowed_post_types());
|
144 |
unset($types['page']);
|
145 |
-
|
146 |
$types = array_flip($types);
|
147 |
|
148 |
if (wphp_is_post_sidebar($wp_query))
|
149 |
{
|
150 |
//p_n(__LINE__);
|
151 |
-
|
152 |
}
|
153 |
elseif (is_admin() || is_singular())
|
154 |
{
|
155 |
-
|
156 |
-
|
157 |
-
{
|
158 |
-
$ret = 4;
|
159 |
-
}
|
160 |
-
else
|
161 |
-
{
|
162 |
-
$ret = 0;
|
163 |
-
}
|
164 |
}
|
165 |
elseif (in_array($item_type, $types) || $item_type == 'page')
|
166 |
{
|
167 |
// p_n(__LINE__);
|
168 |
-
|
169 |
}
|
170 |
else
|
171 |
{
|
172 |
-
|
173 |
-
|
174 |
}
|
175 |
-
p_l($ret);
|
176 |
-
return $ret;
|
177 |
|
178 |
}
|
179 |
}
|
@@ -442,13 +433,9 @@ function scb_custom_post_types($output = 'objects')
|
|
442 |
$types = (array) get_post_types($args, $output, $operator);
|
443 |
unset($types['revision']);
|
444 |
unset($types['nav_menu_item']);
|
445 |
-
|
446 |
|
447 |
-
return empty($types) || !is_array($types) ? array() : $types;
|
448 |
|
449 |
-
|
450 |
|
451 |
-
function wphp_ispro()
|
452 |
-
{
|
453 |
-
return (defined('WPHP_PRO') && WPHP_PRO) || wp_hide_post()->info('id') == 'wp-hide-post-pro';
|
454 |
}
|
142 |
|
143 |
$types = array_flip(wphp_allowed_post_types());
|
144 |
unset($types['page']);
|
145 |
+
|
146 |
$types = array_flip($types);
|
147 |
|
148 |
if (wphp_is_post_sidebar($wp_query))
|
149 |
{
|
150 |
//p_n(__LINE__);
|
151 |
+
return true;
|
152 |
}
|
153 |
elseif (is_admin() || is_singular())
|
154 |
{
|
155 |
+
//p_n(__LINE__);
|
156 |
+
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
158 |
elseif (in_array($item_type, $types) || $item_type == 'page')
|
159 |
{
|
160 |
// p_n(__LINE__);
|
161 |
+
return true;
|
162 |
}
|
163 |
else
|
164 |
{
|
165 |
+
// p_n(__LINE__);
|
166 |
+
return false;
|
167 |
}
|
|
|
|
|
168 |
|
169 |
}
|
170 |
}
|
433 |
$types = (array) get_post_types($args, $output, $operator);
|
434 |
unset($types['revision']);
|
435 |
unset($types['nav_menu_item']);
|
436 |
+
unset($types['attachment']);
|
437 |
|
|
|
438 |
|
439 |
+
return empty($types) || !is_array($types) ? array() : $types;
|
440 |
|
|
|
|
|
|
|
441 |
}
|
public/class-wp-hide-post-public.php
CHANGED
@@ -177,7 +177,7 @@ class wp_hide_post_Public
|
|
177 |
* @param $where
|
178 |
* @return unknown_type
|
179 |
*/
|
180 |
-
public function query_posts_where($where,
|
181 |
{
|
182 |
|
183 |
p_l("called: wphp_query_posts_where");
|
177 |
* @param $where
|
178 |
* @return unknown_type
|
179 |
*/
|
180 |
+
public function query_posts_where($where, &$wp_query = null)
|
181 |
{
|
182 |
|
183 |
p_l("called: wphp_query_posts_where");
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://scriptburn.com/wp-hide-post/
|
|
4 |
Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2
|
9 |
|
10 |
Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
|
@@ -111,17 +111,9 @@ Ditto. It will be deleted. If you had any existing data (if you had it active be
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
-
= 2.0.6 =
|
115 |
-
*Release Date - 31 July 2017*
|
116 |
-
|
117 |
-
Fix: post was not hiding if the static page was selected as homepage
|
118 |
-
Fix: Compatibility with old version of PHP
|
119 |
-
|
120 |
-
|
121 |
= 2.0.5 =
|
122 |
-
*Release Date -
|
123 |
-
|
124 |
-
Fix: Compatibility with old version of PHP
|
125 |
|
126 |
= 2.0.4 =
|
127 |
*Release Date - 30 July 2017*
|
@@ -197,4 +189,5 @@ Fix: Compatibility with old version of PHP
|
|
197 |
Please visit the plugin page at [ScriptBurn.com](http://scriptburn.com/wp-hide-post/), and feel free to leave feedback, bug reports and comments.
|
198 |
|
199 |
== Upgrade Notice ==
|
200 |
-
n/a
|
|
4 |
Tags: SEO,hide,show,visbility,privacy,customization,sitemap,filter
|
5 |
Requires at least: 2.6
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 2.0.5
|
8 |
License: GPLv2
|
9 |
|
10 |
Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
= 2.0.5 =
|
115 |
+
*Release Date - 31 July 2017*
|
116 |
+
* Fix an issue for wordpress install which are running < PHP5.5.5
|
|
|
117 |
|
118 |
= 2.0.4 =
|
119 |
*Release Date - 30 July 2017*
|
189 |
Please visit the plugin page at [ScriptBurn.com](http://scriptburn.com/wp-hide-post/), and feel free to leave feedback, bug reports and comments.
|
190 |
|
191 |
== Upgrade Notice ==
|
192 |
+
n/a
|
193 |
+
1
|
wp-hide-post.php
CHANGED
@@ -16,7 +16,7 @@
|
|
16 |
* Plugin Name: WP Hide Post
|
17 |
* Plugin URI: http://scriptburn.com/wp-hide-post
|
18 |
* Description: Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
|
19 |
-
* Version: 2.0.
|
20 |
* Author: scriptburn.com
|
21 |
* Author URI: http://www.scriptburn.com
|
22 |
* License: GPL-2.0+
|
@@ -31,7 +31,7 @@ if (!defined('WPINC'))
|
|
31 |
die;
|
32 |
}
|
33 |
global $table_prefix;
|
34 |
-
define('WPHP_VER', "2.0.
|
35 |
define('WPHP_DB_VER', "2");
|
36 |
|
37 |
define('WPHP_PLUGIN_DIR', __DIR__ . "/");
|
16 |
* Plugin Name: WP Hide Post
|
17 |
* Plugin URI: http://scriptburn.com/wp-hide-post
|
18 |
* Description: Control the visibility of items on your blog by making posts/pages hidden on some parts , while still visible in other parts and search engines.
|
19 |
+
* Version: 2.0.5
|
20 |
* Author: scriptburn.com
|
21 |
* Author URI: http://www.scriptburn.com
|
22 |
* License: GPL-2.0+
|
31 |
die;
|
32 |
}
|
33 |
global $table_prefix;
|
34 |
+
define('WPHP_VER', "2.0.3");
|
35 |
define('WPHP_DB_VER', "2");
|
36 |
|
37 |
define('WPHP_PLUGIN_DIR', __DIR__ . "/");
|