// OPTIMIZED: Cached settings to avoid repeated function calls - DISABLED LIKES & NOTIFICATIONS public function get_registered_settings() { static $cached_settings = null; if ($cached_settings !== null) { return $cached_settings; } $pages_options = array( '' => '- Select Page -' ); $pages = get_pages(); if ( $pages ) { foreach ( $pages as $page ) { $pages_options[ $page->ID ] = $page->post_title; } } $types_options = array( '' => '- Select Post Types -' ); $_types_options = array(); foreach ( get_post_types( array( 'public' => true ), 'objects' ) as $id => $type ) { if ( ! empty( $type->labels->name ) ) { $types_options[$id] = $type->labels->name; $_types_options[$id] = $type->labels->name; } } global $wp_roles; $wp_roles_names = array_reverse( $wp_roles->role_names ); $roles_options = array(); foreach ($wp_roles_names as $role_slug => $role_name ) { $roles_options[$role_slug] = $role_name; } $count_options = array( 'day-Ymd' => 'Day', 'week-YW' => 'Week', 'month-Ym' => 'Month', 'year-Y' => 'Year', ); $play_settings = array( 'general' => array( 'title' => __( 'General', 'play-block' ), 'settings' => array( 'play_types' => array( 'id' => 'play_types', 'name' => __( 'Post Types', 'play-block' ), 'desc' => __( 'Select the post types that will have Play Block functionality.', 'play-block' ), 'type' => 'multicheck', 'multiple' => true, 'options' => $_types_options ), 'disable_login_modal' => array( 'id' => 'disable_login_modal', 'name' => __( 'Disable login modal', 'play-block' ), 'label' => __( 'Check this option to disable login modal popup.', 'play-block' ), 'type' => 'checkbox' ), 'page_login' => array( 'id' => 'page_login', 'name' => __( 'Login Page', 'play-block' ), 'type' => 'select', 'options' => $pages_options, 'desc' => __( 'This is the page where users will register and login.
The [play_login_form] shortcode must be on this page.', 'play-block' ), ), 'page_upload' => array( 'id' => 'page_upload', 'name' => __( 'Upload Page', 'play-block' ), 'type' => 'select', 'options' => $pages_options, 'desc' => __( 'This is the page where users will upload their files.
The [play_upload_form] shortcode must be on this page.', 'play-block' ), ), 'page_download' => array( 'id' => 'page_download', 'name' => __( 'Download Page', 'play-block' ), 'type' => 'select', 'options' => $pages_options, 'desc' => __( 'This is the page where users will be redirected to download files.
The [play_download] shortcode must be on this page.', 'play-block' ), ), 'page_rank' => array( 'id' => 'page_rank', 'name' => __( 'Rank Page', 'play-block' ), 'type' => 'select', 'options' => $pages_options, 'hide' => true, 'desc' => __( 'This is the page where the ranks link to.
The Loop Block sorted by play count must be on this page.', 'play-block' ), ) ) ), 'player' => array( 'title' => __( 'Player', 'play-block' ), 'settings' => array( 'default_id' => array( 'id' => 'default_id', 'name' => __( 'Default Play ID', 'play-block' ), 'type' => 'text', ), 'youtube_api_key' => array( 'id' => 'youtube_api_key', 'name' => __( 'Youtube API Key', 'play-block' ), 'type' => 'text', 'desc' => sprintf( __( 'This your own personal Youtube API key to allow importing of watch URLs. You can obtain a key from the Google Developer Console.', 'play-block' ), 'https://console.developers.google.com/' ), ), 'ad_tagurl' => array( 'id' => 'ad_tagurl', 'name' => __( 'VAST Ad Tag URL', 'play-block' ), 'type' => 'text', 'mediaUpload' => true, 'desc' => __( 'Enter a VAST compatible ad tag URL here. Test Google Sample Tags', 'play-block' ), ), 'ad_interval' => array( 'id' => 'ad_interval', 'name' => __( 'Ad Interval', 'play-block' ), 'type' => 'number', 'desc' => __( 'Play advertisment after every x number of streams.', 'play-block' ), ), 'ad_free_role' => array( 'id' => 'ad_free_role', 'name' => __( 'Ad-Free Roles', 'play-block' ), 'type' => 'multicheck', 'multiple' => true, 'options' => $roles_options, 'desc' => __( 'Select the user roles exempt from advertisments.', 'play-block' ), ), 'login_to_play' => array( 'id' => 'login_to_play', 'name' => __( 'Login To Play', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to disable unregistered user to play.', 'play-block' ), ), 'player_history' => array( 'id' => 'player_history', 'name' => __( 'Player History', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to enable player history.', 'play-block' ), ), 'php_stream' => array( 'id' => 'php_stream', 'name' => __( 'Stream Media Files', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to use PHP to stream locally hosted media files. This helps mask the location of your media files.', 'play-block' ), ), 'preview_length' => array( 'id' => 'preview_length', 'name' => __( 'Preview Length (Seconds)', 'play-block' ), 'type' => 'number', 'desc' => __( 'Only play x number of seconds for users.
Stream Media Files must be checked.', 'play-block' ), ), 'preview_free_role' => array( 'id' => 'preview_free_role', 'name' => __( 'Preview-Free Roles', 'play-block' ), 'type' => 'multicheck', 'multiple' => true, 'options' => $roles_options, 'desc' => __( 'Select the user roles exempt from the preview limit.', 'play-block' ), ), 'count_play' => array( 'id' => 'count_play', 'name' => __( 'Count Plays', 'play-block' ), 'type' => 'multicheck', 'multiple' => true, 'options' => $count_options, 'desc' => __( 'Count the plays for each time', 'play-block' ), ), 'count_play_time' => array( 'id' => 'count_play_time', 'name' => __( 'Start Count (Seconds)', 'play-block' ), 'type' => 'number', 'std' => 10, 'desc' => __( '', 'play-block' ), ), ) ), // OPTIMIZED: Only show upload and download settings - DISABLED likes/notifications 'upload' => array( 'title' => __( 'Uploads', 'play-block' ), 'settings' => array( 'post_type' => array( 'id' => 'post_type', 'name' => __( 'Upload Post Type', 'play-block' ), 'desc' => __( 'Select the upload post type for frontend submissions.', 'play-block' ), 'type' => 'select', 'options' => $types_options ), 'post_playlist_type' => array( 'id' => 'post_playlist_type', 'name' => __( 'Playlist Post Type', 'play-block' ), 'desc' => __( 'Select the playlist post type for frontend submissions.', 'play-block' ), 'type' => 'select', 'options' => $types_options ), 'register_playlist' => array( 'id' => 'register_playlist', 'name' => __( 'Register Playlist Post Type', 'play-block' ), 'label' => __( 'Check this option to register playlist post type.', 'play-block' ), 'type' => 'checkbox', ), 'post_attachment' => array( 'id' => 'post_attachment', 'name' => __( 'Auto Create Posts', 'play-block' ), 'label' => __( 'Check this option to add new posts when add audio/video files in media library.', 'play-block' ), 'type' => 'checkbox', ), 'post_public' => array( 'id' => 'post_public', 'name' => __( 'Auto Approve Posts', 'play-block' ), 'label' => __( 'Check this option to allow users to publish frontend submitted posts without approval.', 'play-block' ), 'type' => 'checkbox', 'desc' => __( 'User submitted posts will be private by default.', 'play-block' ), ), 'post_playlist_public' => array( 'id' => 'post_playlist_public', 'name' => __( 'Auto Approve Playlists', 'play-block' ), 'label' => __( 'Check this option to allow users to publish frontend submitted playlists without approval.', 'play-block' ), 'type' => 'checkbox', 'desc' => __( 'User submitted playlists will be private by default.', 'play-block' ), ), 'post_verified_public' => array( 'id' => 'post_verified_public', 'name' => __( 'Auto Approve Verified Users', 'play-block' ), 'label' => __( 'Check this option to allow verified users to publish posts and playlist without approval.', 'play-block' ), 'type' => 'checkbox', 'desc' => sprintf( __( 'Verify by editing a user and checking the Verified checkbox. View Users.', 'play-block' ), admin_url( 'users.php' ) ), ), 'post_upload' => array( 'id' => 'post_upload', 'name' => __( 'Allow File Uploads', 'play-block' ), 'label' => __( 'Check this option to allow users to upload files on frontend submissions.', 'play-block' ), 'type' => 'checkbox', 'desc' => __( 'Supports WordPress compatible audio and video file formats.', 'play-block' ), ), 'post_upload_online' => array( 'id' => 'post_upload_online', 'name' => __( 'Allow Online Stream URLs', 'play-block' ), 'label' => __( 'Check this option to allow users to enter online stream URLs on frontend submissions.', 'play-block' ), 'type' => 'checkbox', 'desc' => __( 'Supports YouTube.com and HeartThis.at.', 'play-block' ), ), 'purchaseable' => array( 'id' => 'purchaseable', 'name' => __( 'Allow Purchase URLs', 'play-block' ), 'label' => __( 'Check this option to allow users to enter purchase link URLs on frontend submissions.', 'play-block' ), 'type' => 'checkbox', 'desc' => __( 'Supports Apple iTunes, Amazon, BeatPort and custom purchase URLs.', 'play-block' ), ), 'upload_role' => array( 'id' => 'upload_role', 'name' => __( 'Upload Roles', 'play-block' ), 'type' => 'multicheck', 'multiple' => true, 'options' => $roles_options, 'desc' => __( 'Select the user roles who can submit frontend submissions.', 'play-block' ), ), ) ), 'downloads' => array( 'title' => __( 'Downloads', 'play-block' ), 'settings' => array( 'downloadable' => array( 'id' => 'downloadable', 'name' => __( 'Require Registration', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to allow only registered users to download files.', 'play-block' ), ), 'download_role' => array( 'id' => 'download_role', 'name' => __( 'Download Roles', 'play-block' ), 'type' => 'multicheck', 'multiple' => true, 'options' => $roles_options, 'desc' => __( 'Select the user roles that can download files.', 'play-block' ), ), 'page_download_redirect' => array( 'id' => 'page_download_redirect', 'name' => __( 'Download Redirect', 'play-block' ), 'type' => 'select', 'options' => $pages_options, 'desc' => __( 'This is the page where users will be redirected to if do not have download roles.', 'play-block' ), ), ) ), 'emails' => array( 'title' => __( 'Emails', 'play-block' ), 'settings' => array( 'email_activation' => array( 'id' => 'email_activation', 'name' => __( 'Require Email Activation', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to require email activation for new user registrations.
Put the {activation.url} in new user email content, Make sure the wp_mail function works', 'play-block' ), ), 'email_newuser' => array( 'id' => 'email_newuser', 'name' => __( 'Customize New User Email', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to customize new user email.', 'play-block' ), 'class' => 'play-option-group-newuser', 'group' => 'play-option-group-newuser', ), 'email_newuser_subject' => array( 'id' => 'email_newuser_subject', 'name' => __( 'New User Email Subject', 'play-block' ), 'type' => 'text', 'std' => __( 'Your {site.name} account has been created!', 'play-block' ), 'class' => 'play-option-group-newuser', ), 'email_newuser_content' => array( 'id' => 'email_newuser_content', 'name' => __( 'New User Email Content', 'play-block' ), 'type' => 'rich_editor', 'std' => __( 'Welcome to {site.name}
Click below link to login.
{login.url}', 'play-block' ), 'desc' => __( 'Supported tokens: {site.name} {site.url} {user.name} {user.email} {login.url} {activation.url}', 'play-block' ), 'class' => 'play-option-group-newuser', ), 'email_retrievepwd' => array( 'id' => 'email_retrievepwd', 'name' => __( 'Customize Retrieve Password Email', 'play-block' ), 'type' => 'checkbox', 'label' => __( 'Check this option to customize retrieve password email.', 'play-block' ), 'class' => 'play-option-group-retrievepwd', 'group' => 'play-option-group-retrievepwd', ), 'email_retrieve_password_title' => array( 'id' => 'email_retrieve_password_title', 'name' => __( 'Retrieve Password Email Subject', 'play-block' ), 'type' => 'text', 'std' => __( '[{site.name}] Password Reset', 'play-block' ), 'class' => 'play-option-group-retrievepwd', ), 'email_retrieve_password_message' => array( 'id' => 'email_retrieve_password_message', 'name' => __( 'Retrieve Password Email Content', 'play-block' ), 'type' => 'rich_editor', 'std' => __( 'It looks like you need to reset your password on the site. If this is correct, simply click the link below. If you were not the one responsible for this request, ignore this email and nothing will happen.
{resetpassword.url}', 'play-block' ), 'class' => 'play-option-group-retrievepwd', 'desc' => __( 'Supported tokens: {site.name} {site.url} {user.name} {user.email} {login.url} {resetpassword.url}', 'play-block' ) ), ) ), 'endpoints' => array( 'title' => __( 'Endpoints', 'play-block' ), 'settings' => array( 'title-1' => array( 'id' => 'title-1', 'title' => __( 'Endpoints', 'play-block' ), 'desc' => __( 'Play Block offers you the ability to create a custom URL structure for your permalinks and archives. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links.', 'play-block' ), 'type' => 'html', 'class' => 'section-placeholder', ), 'station_base' => array( 'id' => 'station_base', 'name' => __( 'Station base', 'play-block' ), 'type' => 'text', 'std' => 'station', 'desc' => '%genre%, %author%, %artist%' ), 'genre_base' => array( 'id' => 'genre_base', 'name' => __( 'Genre base', 'play-block' ), 'type' => 'text', 'std' => 'genre', ), 'artist_base' => array( 'id' => 'artist_base', 'name' => __( 'Artist base', 'play-block' ), 'type' => 'text', 'std' => 'artist', 'class' => apply_filters('play_register_audio_type', true) ? '' : 'play-option-hide', ), 'mood_base' => array( 'id' => 'mood_base', 'name' => __( 'Mood base', 'play-block' ), 'type' => 'text', 'std' => 'mood', 'class' => apply_filters('play_register_audio_type', true) ? '' : 'play-option-hide', ), 'activity_base' => array( 'id' => 'activity_base', 'name' => __( 'Activity base', 'play-block' ), 'type' => 'text', 'std' => 'activity', 'class' => apply_filters('play_register_audio_type', true) ? '' : 'play-option-hide', ), 'tag_base' => array( 'id' => 'tag_base', 'name' => __( 'Tag base', 'play-block' ), 'type' => 'text', 'std' => 'station_tag', ), 'title-2' => array( 'id' => 'title-2', 'title' => __( 'User endpoints', 'play-block' ), 'desc' => __( 'Endpoints are appended to user page URLs to handle specific actions. They should be unique.
NOTE: Go to "Appearance > Menus" to change the user URLS after you change those endpoints.', 'play-block' ), 'type' => 'html', 'class' => 'section-placeholder', ), 'user_base' => array( 'id' => 'user_base', 'name' => __( 'User base', 'play-block' ), 'type' => 'text', 'std' => 'user', ), 'stations_endpoint' => array( 'id' => 'stations_endpoint', 'name' => __( 'Stations', 'play-block' ), 'type' => 'text', 'std' => 'stations', ), 'albums_endpoint' => array( 'id' => 'albums_endpoint', 'name' => __( 'Albums', 'play-block' ), 'type' => 'text', 'std' => 'albums', 'class' => apply_filters('play_register_audio_type', true) ? '' : 'play-option-hide', ), 'playlists_endpoint' => array( 'id' => 'playlists_endpoint', 'name' => __( 'Playlists', 'play-block' ), 'type' => 'text', 'std' => 'playlists', ), // DISABLED: Remove like, follow, notification endpoints from settings // 'likes_endpoint' => array( // 'id' => 'likes_endpoint', // 'name' => __( 'Likes', 'play-block' ), // 'type' => 'text', // 'std' => 'likes', // ), // 'followers_endpoint' => array( // 'id' => 'followers_endpoint', // 'name' => __( 'Followers', 'play-block' ), // 'type' => 'text', // 'std' => 'followers', // ), // 'following_endpoint' => array( // 'id' => 'following_endpoint', // 'name' => __( 'Following', 'play-block' ), // 'type' => 'text', // 'std' => 'following', // ), // 'notifications_endpoint' => array( // 'id' => 'notifications_endpoint', // 'name' => __( 'Notifications', 'play-block' ), // 'type' => 'text', // 'std' => 'notifications', // ), 'download_endpoint' => array( 'id' => 'downloads_endpoint', 'name' => __( 'Downloads', 'play-block' ), 'type' => 'text', 'std' => 'download', ), 'profile_endpoint' => array( 'id' => 'profile_endpoint', 'name' => __( 'Profile', 'play-block' ), 'type' => 'text', 'std' => 'profile', ), 'upload_endpoint' => array( 'id' => 'upload_endpoint', 'name' => __( 'Upload', 'play-block' ), 'type' => 'text', 'std' => 'upload', ), ) ), // DISABLED: Completely remove Advanced tab with notification settings // 'advanced' => array( // 'title' => __( 'Advanced', 'play-block' ), // 'settings' => array( // // Notification settings removed // ) // ) ); $cached_settings = apply_filters('play_settings', $play_settings); return $cached_settings; }