Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Restrict Upload Access for Users not paid */
- function restrict_upload_access() {
- if ( ! current_user_can( 'administrator' ) ) {
- if ( get_user_option( 'jpw_subscribe_status', get_current_user_id() ) !== 'ACTIVE' ) {
- $url = $_SERVER['REQUEST_URI'];
- $submit_post = strpos( $url, '/editor/' );
- $upload_video = strpos( $url, '/upload/' );
- if ( $submit_post || $upload_video ) {
- wp_redirect( home_url() );
- exit();
- }
- add_action(
- 'wp_head',
- function () {
- ?>
- <style>
- .jeg_button_1,
- .jeg_nav_html,
- .frontend-submit-button {
- display: none;
- }
- </style>
- <?php
- },
- 99
- );
- }
- }
- }
- add_action( 'init', 'restrict_upload_access' );
Add Comment
Please, Sign In to add comment