PluginProbe
WP Hide Post — Hide Posts, Pages, Custom Post Types, and Control Products Visibility for WooCommerce / 2.0.4
WP Hide Post — Hide Posts, Pages, Custom Post Types, and Control Products Visibility for WooCommerce v2.0.4
trunk 1.0.0 1.0.1 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4
wp-post-hide / wp-post-hide.php

wp-post-hide.php in WP Hide Post — Hide Posts, Pages, Custom Post Types, and Control Products Visibility for WooCommerce 2.0.4, at wp-post-hide.php

77 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * This is main plugin file.
4 *
5 * @link http://xfinitysoft.com/
6 * @since 0.0.1
7 * @package WP Post Hide
8 * Plugin Name: WP Hide Post — Hide Posts, Pages, Custom Post Types, and Control Products Visibility for WooCommerce
9 * Description: Control the visibility of post type items like pages, posts, and custom post types. Hidden in specific parts but other parts still visible.
10 * Plugin URI:http://www.xfinitysoft.com/wp-post-hide/
11 * Version: 2.0.4
12 * Author:Xfinity Soft
13 * Author URI:http://www.xfinitysoft.com/
14 * Text Domain:wp-post-hide
15 * Domain Path: /languages
16 * Requires PHP: 7.4
17 * Requires at least: 5.0
18 * Tested up to: 7.0
19 * License: GPLv2 or later
20 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
21 */
22
23 // Exit if directly access.
24 if ( ! defined( 'ABSPATH' ) ) {
25 exit;
26 }
27
28 // Check if pro version is active and deactivate free version if it is.
29 add_action(
30 'admin_init',
31 function () {
32 if ( is_plugin_active( 'xs-wordpress-hide-post/xs-wordpress-hide-post.php' ) ) {
33 deactivate_plugins( plugin_basename( __FILE__ ) );
34 add_action(
35 'admin_notices',
36 function () {
37 ?>
38 <div class="notice notice-warning is-dismissible">
39 <p><?php esc_html_e( 'WP Post Hide (Free) has been deactivated because WP Post Hide Pro is already active.', 'wp-post-hide' ); ?></p>
40 </div>
41 <?php
42 }
43 );
44 return;
45 }
46 }
47 );
48
49 // Define XSWPPH_PLUGIN_FILE.
50 if ( ! defined( 'XSWPHP_PLUGIN_FILE' ) ) {
51 define( 'XSWPHP_PLUGIN_FILE', __FILE__ );
52 }
53 // Define XSWPPH_PLUGIN_FILE.
54 if ( ! defined( 'XSWPHP_VERSION' ) ) {
55 define( 'XSWPHP_VERSION', '2.0.4' );
56 }
57 if ( ! defined( 'XSWPHP_ROOT_URL' ) ) {
58 define( 'XSWPHP_ROOT_URL', plugins_url( '', __FILE__ ) );
59 }
60 // Includes main class of wphp.
61 if ( ! class_exists( 'XSWPHP_Main' ) ) {
62 include_once __DIR__ . '/includes/classes/class-xswphp-main.php';
63 }
64
65 /**
66 * Main instance of XSWPPH_Main.
67 *
68 * Returns the main instance of XSWPPH_Main to prevent the need to use globals.
69 *
70 * @return XSWPHP_Main
71 */
72 function xswphp_main() {
73 return new XSWPHP_Main();
74 }
75
76 // Global for backwards compatibility (prefixed key for coding standards).
77 $GLOBALS['xswphp_wp_post_hide'] = xswphp_main();