| 1 |
<?php |
| 2 |
/* |
| 3 |
* Plugin Name: Document Embedder |
| 4 |
* Plugin URI: http://documentembedder.com/ |
| 5 |
* Description: Embed Any document easily in wordpress such as word, excel, powerpoint, pdf and more |
| 6 |
* Version: 1.8.6 |
| 7 |
* Author: bPlugins |
| 8 |
* Author URI: http://bplugins.com |
| 9 |
* License: GPLv3 |
| 10 |
* Text Domain: ppv |
| 11 |
* Domain Path: /i18n |
| 12 |
*/ |
| 13 |
|
| 14 |
function ppv_load_textdomain() { |
| 15 |
load_plugin_textdomain( 'ppv', false, dirname( plugin_basename( __FILE__ ) ) . "/i18n" ); |
| 16 |
} |
| 17 |
add_action( "init", 'ppv_load_textdomain', 20 ); |
| 18 |
|
| 19 |
/*Some Set-up*/ |
| 20 |
define('PPV_VER', '1.8.6'); |
| 21 |
define('PPV_PLUGIN_DIR', plugin_dir_url(__FILE__) ); |
| 22 |
define('PPV__FILE__', __FILE__ ); |
| 23 |
define('PPV_IMPORT', '1.0.0'); |
| 24 |
|
| 25 |
|
| 26 |
require_once(__DIR__.'/upgrade.php'); |
| 27 |
|
| 28 |
use PPV\Services\Import; |
| 29 |
|
| 30 |
//Remove post update massage and link |
| 31 |
function ppv_updated_messages( $messages ) { |
| 32 |
$messages['ppt_viewer'][1] = __('Updated', 'ppv'); |
| 33 |
return $messages; |
| 34 |
} |
| 35 |
add_filter('post_updated_messages','ppv_updated_messages'); |
| 36 |
|
| 37 |
// After activation redirect |
| 38 |
register_activation_hook(__FILE__, 'ppv_plugin_activate'); |
| 39 |
add_action('admin_init', 'ppv_plugin_redirect'); |
| 40 |
|
| 41 |
function ppv_plugin_activate() { |
| 42 |
add_option('ppv_plugin_do_activation_redirect', true); |
| 43 |
} |
| 44 |
|
| 45 |
function ppv_plugin_redirect() { |
| 46 |
if (get_option('ppv_plugin_do_activation_redirect', false)) { |
| 47 |
delete_option('ppv_plugin_do_activation_redirect'); |
| 48 |
wp_redirect('edit.php?post_type=ppt_viewer&page=ppv_help'); |
| 49 |
} |
| 50 |
|
| 51 |
if(get_option('ppv_import', '0') < PPV_IMPORT){ |
| 52 |
Import::import(); |
| 53 |
update_option('ppv_import', PPV_IMPORT); |
| 54 |
} |
| 55 |
} |
| 56 |
|