PluginProbe ʕ •ᴥ•ʔ
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets / 3.7.6
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets v3.7.6
4.2.5 4.2.4 trunk 3.7.10 3.7.11 3.7.12 3.7.13 3.7.14 3.7.2 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8 3.8.1 3.8.10 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 3.8.9 3.8.9.1 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.5.1 4.0.6 4.0.6.1 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.2.0 4.2.1 4.2.2 4.2.3
widget-options / includes / install.php
widget-options / includes Last commit date
admin 5 years ago pagebuilders 4 years ago widgets 5 years ago ajax-functions.php 5 years ago extras.php 5 years ago install.php 5 years ago scripts.php 5 years ago transient.php 5 years ago
install.php
97 lines
1 <?php
2 /**
3 * Install Function
4 *
5 * @copyright Copyright (c) 2016, Jeffrey Carandang
6 * @since 3.0
7 */
8 // Exit if accessed directly
9 if ( ! defined( 'ABSPATH' ) ) exit;
10
11 //check if free version is activated
12 if( !function_exists( 'widgetopts_upgraded' ) ){
13 add_action( 'admin_notices', 'widgetopts_upgraded' );
14 function widgetopts_upgraded(){
15 if( is_plugin_active( 'widget-options/plugin.php' ) && is_plugin_active( 'extended-widget-options/plugin.php' ) ){ ?>
16 <div class="widgetopts_activated_notice notice-error notice" style="box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);">
17 <p>
18 <?php _e( 'Please deactivate <strong>Widget Options</strong> Plugin, it may cause issue with the extended plugin version. Thanks!', 'widget-options' );?>
19 </p>
20 </div>
21 <?php }
22 }
23 }
24
25 //add settings link on plugin page
26 if( !function_exists( 'widgetopts_filter_plugin_actions' ) ){
27 add_action( 'plugin_action_links_' . plugin_basename( WIDGETOPTS_PLUGIN_FILE ) , 'widgetopts_filter_plugin_actions' );
28 function widgetopts_filter_plugin_actions($links){
29
30 if( !is_array( $links ) ){
31 $links = array();
32 }
33
34 $links[] = '<a href="'. esc_url( admin_url( 'options-general.php?page=widgetopts_plugin_settings' ) ) .'">' . __( 'Settings', 'widget-options' ) . '</a>';
35 $links[] = '<a href="'. esc_url( 'https://widget-options.com/pricing/?utm_source=upgradebtn&utm_medium=plugins&utm_campaign=widgetoptspluginlink' ) .'" target="_blank" style="color: #3db634">' . __( 'Upgrade', 'widget-options' ) . '</a>';
36 return $links;
37 }
38 }
39
40 //register default values
41 if( !function_exists( 'widgetopts_register_defaults' ) ){
42 register_activation_hook( WIDGETOPTS_PLUGIN_FILE, 'widgetopts_register_defaults' );
43 add_action( 'plugins_loaded', 'widgetopts_register_defaults' );
44 function widgetopts_register_defaults(){
45 if( is_admin() ){
46
47 if( !get_option( 'widgetopts_installDate' ) ){
48 add_option( 'widgetopts_installDate', date( 'Y-m-d h:i:s' ) );
49 }
50
51 if( !get_option( '_widgetopts_default_registered_' ) ){
52 //activate free version modules
53 add_option( 'widgetopts_tabmodule-visibility', 'activate' );
54 add_option( 'widgetopts_tabmodule-devices', 'activate' );
55 add_option( 'widgetopts_tabmodule-alignment', 'activate' );
56 add_option( 'widgetopts_tabmodule-hide_title', 'activate' );
57 add_option( 'widgetopts_tabmodule-classes', 'activate' );
58 add_option( 'widgetopts_tabmodule-logic', 'activate' );
59 add_option( 'widgetopts_tabmodule-state', 'activate' );
60 //add free version settings
61 $defaults = array(
62 'visibility' => array(
63 'post_type' => '1',
64 'taxonomies' => '1',
65 'misc' => '1'
66 ),
67 'classes' => array(
68 'id' => '1',
69 'type' => 'both'
70 ),
71 );
72 //upgraded settings from previous version
73 $options = get_option('extwopts_class_settings');
74 if( isset( $options['class_field'] ) ){
75 $defaults['classes']['type'] = $options['class_field'];
76 }
77 if( isset( $options['classlists'] ) ){
78 $defaults['classes']['classlists'] = $options['classlists'];
79 }
80 add_option( 'widgetopts_tabmodule-settings', serialize( $defaults ) );
81 add_option( '_widgetopts_default_registered_', '1' );
82 delete_transient( 'widgetopts_tabs_transient' ); //remove transient for settings
83 delete_option( 'widgetopts_settings' );
84 }
85
86 //make sure to delete previous pages cache
87 if( !get_option( 'widgetopts_removed_global_pages' ) ){
88 delete_option( 'widgetopts_global_pages' );
89 add_option( 'widgetopts_removed_global_pages', 1 );
90 }
91
92 }
93 }
94 }
95
96 ?>
97