AI
1 year ago
admin-pages
1 year ago
api
1 year ago
blog
1 year ago
customizer
1 year ago
filters
1 year ago
full-site-editing
1 year ago
importer
1 year ago
integrations
1 year ago
menu
1 year ago
polyfills
1 year ago
preview
1 year ago
shapes
2 years ago
shortcodes
1 year ago
src
1 year ago
add-edit-in-kubio.php
1 year ago
editor-assets.php
1 year ago
filters.php
1 year ago
frontend.php
1 year ago
global-data.php
1 year ago
init.php
1 year ago
kubio-block-library.php
1 year ago
kubio-editor.php
1 year ago
load.php
1 year ago
init.php
48 lines
| 1 | <?php |
| 2 | |
| 3 | function kubio_plugin_activated() { |
| 4 | $experimental_options = get_option( 'gutenberg-experiments', array() ); |
| 5 | if ( ! is_array( $experimental_options ) ) { |
| 6 | $experimental_options = array( $experimental_options ); |
| 7 | } |
| 8 | $experimental_options['gutenberg-navigation'] = 1; |
| 9 | $experimental_options['gutenberg-widget-experiments'] = 1; |
| 10 | |
| 11 | update_option( 'gutenberg-experiments', $experimental_options ); |
| 12 | do_action( 'kubio/plugin_activated' ); |
| 13 | } |
| 14 | |
| 15 | function kubio_plugin_deactivated() { |
| 16 | |
| 17 | $run_deactivation = apply_filters( 'kubio/run_deactivation_hooks', false ); |
| 18 | |
| 19 | if ( ! $run_deactivation ) { |
| 20 | return; |
| 21 | } |
| 22 | |
| 23 | do_action( 'kubio/plugin_deactivated' ); |
| 24 | } |
| 25 | |
| 26 | function kubio_enable_block_support() { |
| 27 | add_theme_support( 'block-templates' ); |
| 28 | |
| 29 | if ( ! current_theme_supports( 'align-wide' ) ) { |
| 30 | add_theme_support( 'align-wide' ); |
| 31 | } |
| 32 | |
| 33 | if ( ! current_theme_supports( 'align-full' ) ) { |
| 34 | add_theme_support( 'align-full' ); |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | function kubio_plugin_init() { |
| 39 | require_once plugin_dir_path( __FILE__ ) . '/load.php'; |
| 40 | add_filter( 'kubio_is_enabled', '__return_true' ); |
| 41 | |
| 42 | register_activation_hook( KUBIO_ENTRY_FILE, 'kubio_plugin_activated' ); |
| 43 | register_deactivation_hook( KUBIO_ENTRY_FILE, 'kubio_plugin_deactivated' ); |
| 44 | add_action( 'after_setup_theme', 'kubio_enable_block_support', 500 ); |
| 45 | } |
| 46 | |
| 47 | kubio_plugin_init(); |
| 48 |