| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: WpStream |
| 4 |
* Plugin URI: http://wpstream.net |
| 5 |
* Description: WpStream is a platform that allows you to live stream, create Video-on-Demand, and offer Pay-Per-View videos. We provide an affordable and user-friendly way for businesses, non-profits, and public institutions to broadcast their content and monetize their work. |
| 6 |
* Version: 3.14.3 |
| 7 |
* Author: wpstream |
| 8 |
* Author URI: http://wpstream.net |
| 9 |
* Text Domain: wpstream |
| 10 |
* Domain Path: /languages |
| 11 |
*/ |
| 12 |
|
| 13 |
// If this file is called directly, abort. |
| 14 |
if ( ! defined( 'WPINC' ) ) { |
| 15 |
die; |
| 16 |
} |
| 17 |
define('WPSTREAM_PLUGIN_VERSION', '3.14.3'); |
| 18 |
define('WPSTREAM_CLUBLINK', 'wpstream.net'); |
| 19 |
define('WPSTREAM_CLUBLINKSSL', 'https'); |
| 20 |
define('WPSTREAM_PLUGIN_URL', plugins_url() ); |
| 21 |
define('WPSTREAM_PLUGIN_DIR_URL', plugin_dir_url(__FILE__) ); |
| 22 |
define('WPSTREAM_PLUGIN_PATH', plugin_dir_path(__FILE__) ); |
| 23 |
define('WPSTREAM_PLUGIN_BASE', plugin_basename(__FILE__) ); |
| 24 |
/** |
| 25 |
* Currently plugin version. |
| 26 |
* Start at version 3.0.1 and use SemVer - https://semver.org |
| 27 |
* Rename this for your plugin and update it as you release new versions. |
| 28 |
*/ |
| 29 |
|
| 30 |
|
| 31 |
/** |
| 32 |
* The code that runs during plugin activation. |
| 33 |
* This action is documented in includes/class-wpstream-activator.php |
| 34 |
*/ |
| 35 |
function activate_wpstream() { |
| 36 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpstream-activator.php'; |
| 37 |
Wpstream_Activator::activate(); |
| 38 |
} |
| 39 |
|
| 40 |
/** |
| 41 |
* The code that runs during plugin deactivation. |
| 42 |
* This action is documented in includes/class-wpstream-deactivator.php |
| 43 |
*/ |
| 44 |
function deactivate_wpstream() { |
| 45 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpstream-deactivator.php'; |
| 46 |
Wpstream_Deactivator::deactivate(); |
| 47 |
} |
| 48 |
|
| 49 |
register_activation_hook( __FILE__, 'activate_wpstream' ); |
| 50 |
register_deactivation_hook( __FILE__, 'deactivate_wpstream' ); |
| 51 |
|
| 52 |
/** |
| 53 |
* The core plugin class that is used to define internationalization, |
| 54 |
* admin-specific hooks, and public-facing site hooks. |
| 55 |
*/ |
| 56 |
require plugin_dir_path( __FILE__ ) . 'includes/class-wpstream.php'; |
| 57 |
require plugin_dir_path( __FILE__ ) . 'wpstream-elementor.php'; |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
/** |
| 62 |
* Begins execution of the plugin. |
| 63 |
* |
| 64 |
* Since everything within the plugin is registered via hooks, |
| 65 |
* then kicking off the plugin from this point in the file does |
| 66 |
* not affect the page life cycle. |
| 67 |
* |
| 68 |
* @since 3.0.1 |
| 69 |
*/ |
| 70 |
|
| 71 |
global $wpstream_plugin; |
| 72 |
$wpstream_plugin = new Wpstream(); |
| 73 |
$wpstream_plugin->run(); |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
add_action('wp_head', 'wpestate_add_custom_meta_to_header'); |
| 78 |
|
| 79 |
function wpestate_add_custom_meta_to_header(){ |
| 80 |
global $post; |
| 81 |
|
| 82 |
|
| 83 |
if ( is_singular('product') || is_singular('wpstream_product') ){ |
| 84 |
$image_id = get_post_thumbnail_id(); |
| 85 |
$share_img = wp_get_attachment_image_src( $image_id, 'full'); |
| 86 |
$the_post = get_post($post->ID); ?> |
| 87 |
|
| 88 |
<meta property='og:title' content="<?php print esc_html(get_the_title($post->ID)); ?>"/> |
| 89 |
<?php if(isset($share_img[0])){ ?> |
| 90 |
<meta property="og:image" content="<?php print esc_url($share_img[0]); ?>"/> |
| 91 |
<meta property="og:image:secure_url" content="<?php print esc_url($share_img[0]); ?>" /> |
| 92 |
<?php }?> |
| 93 |
|
| 94 |
<meta property="og:description" content=" <?php print wp_strip_all_tags( $the_post->post_content);?>" /> |
| 95 |
<?php } |
| 96 |
|
| 97 |
|
| 98 |
} |
| 99 |
|