PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 2.02
WpStream – Live Streaming, Video on Demand, Pay Per View v2.02
4.14.0 4.13.2 4.13.1 4.13 4.12.5 4.12.4 4.12.3 4.12.2 4.12.1 4.12 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5 4.5.1 4.5.11 4.5.11.1 4.5.11.2 4.5.11.4 4.5.11.5 4.5.11.6 4.5.12 All 180 releases
wpstream / main.php

main.php in WpStream – Live Streaming, Video on Demand, Pay Per View 2.02, at main.php

96 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 function wpstream_main_start(){
4
5 add_action( 'wp_enqueue_scripts', 'wpstream_enqueue_styles' );
6 add_action( 'admin_enqueue_scripts', 'wpstream_enqueue_styles_admin');
7 add_action( 'init', 'wpstream_my_custom_endpoints' );
8 add_filter( 'query_vars', 'wpstream_my_custom_query_vars', 0 );
9 add_filter( 'woocommerce_account_menu_items', 'wpstream_custom_my_account_menu_items' );
10 add_action( 'woocommerce_account_event-list_endpoint', 'wpstream_custom_endpoint_content_event_list' );
11 add_action( 'woocommerce_account_video-list_endpoint', 'wpstream_custom_endpoint_video_list' );
12 add_action( 'woocommerce_before_single_product', 'wpstream_user_logged_in_product_already_bought', 10 );
13 add_action( 'after_switch_theme', 'wpstream_custom_flush_rewrite_rules' );
14 add_action('init', 'wpstream_shortcodes');
15
16 if (is_admin()) {
17 add_action('admin_menu', 'wpstream_manage_admin_menu',999);
18 }
19
20 $page_check = get_page_by_title('wpstream');
21 if (!isset($page_check->ID)) {
22 $my_post = array(
23 'post_title' => 'wpstream',
24 'post_type' => 'page',
25 'post_status' => 'publish',
26 );
27 $new_id = wp_insert_post($my_post);
28
29 }
30
31 $page_check = get_page_by_title('vodkey');
32 if (!isset($page_check->ID)) {
33 $my_post = array(
34 'post_title' => 'vodkey',
35 'post_type' => 'page',
36 'post_status' => 'publish',
37 );
38 $new_id = wp_insert_post($my_post);
39
40 }
41
42 $page_check = get_page_by_title('Userkey');
43 if (!isset($page_check->ID)) {
44 $my_post = array(
45 'post_title' => 'Userkey',
46 'post_type' => 'page',
47 'post_status' => 'publish',
48 );
49 $new_id = wp_insert_post($my_post);
50
51 }
52
53
54 }
55
56
57
58
59 function wpstream_manage_admin_menu() {
60
61 add_menu_page( __('WpStream','wpestream'), __('WpStream ','wpstream'), 'administrator', 'wpstream_plugin_options', 'wpstream_set_wpstream_credentials');
62
63 add_submenu_page( 'wpstream_plugin_options', __('WpStream Options','wpestream'), __('WpStream Options','wpestream'), 'administrator', 'wpstream_plugin_options', 'wpstream_set_wpstream_credentials');
64 add_submenu_page( 'wpstream_plugin_options', __('WpStream Channels','wpestream'), __('WpStream Channels','wpestream'), 'administrator', 'wpstream_new_general_set', 'wpstream_new_general_set');
65 add_submenu_page( 'wpstream_plugin_options', __('WpStream Media Management','wpestream'), __('WpStream Media Management','wpestream'), 'administrator', 'wpstream_media_management', 'wpstream_media_management');
66
67
68 }
69
70
71
72 function wpstream_non_image_content_wrapper_start() {
73 if ( is_user_logged_in() ) {
74 global $product;
75 $current_user = wp_get_current_user();
76 $product_id = get_the_ID();
77
78 if ( wc_customer_bought_product( $current_user->user_email, $current_user->ID, $product->id ) ){
79 echo '<div id="wpstream_product_wrap">';
80 }else{
81 echo '<div id="wpstream_product_wrap_no_buy">';
82 }
83 }
84
85 }
86
87
88
89 function wpstream_non_image_content_wrapper_end() {
90 // echo '</div>';
91 }
92
93
94 add_action( 'woocommerce_before_single_product', 'wpstream_non_image_content_wrapper_start', 20 );
95 add_action( 'woocommerce_after_single_product', 'wpstream_non_image_content_wrapper_end', 20 );
96