PluginProbe
Translation with DeepL API / trunk
Translation with DeepL API vtrunk
trunk 0.1.20180323 1.0 1.2.5.1 1.5.2.5 1.7.5 2.4.3.12 2.4.3.9 2.4.5
wpdeepl / includes / deepl-plugin-install.php

deepl-plugin-install.php in Translation with DeepL API trunk, at includes/deepl-plugin-install.php

29 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
3
4 function deepl_install_plugin() {
5 if ( !get_option( 'deepl_plugin_installed') ) {
6 update_option( 'deepl_plugin_installed', 0 );
7 }
8 if ( !get_option( 'wpdeepl_metabox_post_types') ) {
9 update_option( 'wpdeepl_metabox_post_types', array( 'post', 'page' ));
10 }
11
12 if ( !get_option( 'wpdeepl_metabox_context') ) {
13 update_option('wpdeepl_metabox_context','side');
14 }
15 if ( !get_option( 'wpdeepl_metabox_priority' ) ) {
16 update_option('wpdeepl_metabox_priority','high');
17 }
18 foreach( array( 'wpdeepl_tpost_title', 'wpdeepl_tpost_content', 'wpdeepl_tpost_excerpt' ) as $key ) {
19 if( !get_option( $key ) ) {
20 update_option( $key, 1 );
21 }
22 }
23
24 global $wp_filesystem; if ( empty( $wp_filesystem ) ) { require_once( ABSPATH . 'wp-admin/includes/file.php' ); WP_Filesystem(); }
25 $wpdeepl_dir_path = wp_normalize_path( WPDEEPL_FILES );
26 if ( ! $wp_filesystem->is_dir( $wpdeepl_dir_path ) ) { $wp_filesystem->mkdir( $wpdeepl_dir_path, 0755 ); }
27
28 update_option('wpdeepl_plugin_installed', 1 );
29 }