plugin_url = plugins_url( '360-product-rotation/', YOFLA_360_PLUGIN_PATH); //set path to yofla360 folder within uploads $wp_uploads = wp_upload_dir(); $this->products_path = $wp_uploads['basedir'].'/'.YOFLA_360_PRODUCTS_FOLDER.'/'; } /** * Add sytles and scripts for plugin media page */ function load_custom_wp_admin_style($hook) { if( $hook == 'media_page_yofla-360-media') { wp_register_style( 'yofla_360_add_media_css', $this->plugin_url.'styles/add-media.css', false, '1.0.0' ); wp_enqueue_style( 'yofla_360_add_media_css' ); wp_register_script( 'yofla_360_add_media_js_form', $this->plugin_url.'/js/vendor/jquery.form.js', false, '1.0.0' ); wp_enqueue_script( 'yofla_360_add_media_js_form' ); wp_register_script( 'yofla_360_add_media_js_add', $this->plugin_url.'/js/add-media.js', false, '1.0.0' ); wp_enqueue_script( 'yofla_360_add_media_js_add' ); } } /** * Add options page */ public function add_plugin_media_page() { // This page will be under "Settings" add_media_page( '360° Views', '360° Views', 'edit_posts', 'yofla-360-media', //menu slug array( $this, 'create_plugin_media_page' ) ); } /** * Options page callback */ public function create_plugin_media_page() { $y360_options = get_option( 'yofla_360_options' ); //read options stored in WP options database $is_using_license = !empty($y360_options['license_id']); $is_using_rotatetooljs_url = !empty($y360_options['rotatetooljs_url']) && filter_var($y360_options['rotatetooljs_url'], FILTER_VALIDATE_URL); $is_using_localengine = !empty($y360_options['local_engine']); if ($is_using_license || $is_using_rotatetooljs_url || $is_using_localengine) { $license_info = ''; } else { $license_info = '

License info

'; $license_info .= '

You are using the free version of the player. You can set up your license'; $license_info .= ' in the plugin settings.

'; } ?>

360° Views :: Manage & Embed

Upload new 360° view:

  1. Use FTP to upload the folder with images or the unzipped folder exported by the online 360 Product View creator to the wp-content/uploads/yofla360/ directory on your server.
  2. or try this build-in uploader. Experimental, might not work reliable with your server.
  3. You can download this sample 360-View-Demo.zip zip file and upload it using the built-in .zip uploader or you can upload it extracted using FTP the the uploads/yofla360 directory.

Available 360° views:

_parse_size(ini_get('post_max_size')); // If upload_max_size is less, then reduce. Except if upload_max_size is // zero, which indicates no limit. $upload_max = $this->_parse_size(ini_get('upload_max_filesize')); if ($upload_max > 0 && $upload_max < $max_size) { $max_size = $upload_max; } } return $max_size; } private function _parse_size($size) { $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size. $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size. if ($unit) { // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by. return round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); } else { return round($size); } } private function _formatBytes($bytes, $precision = 2) { $units = array('B', 'KB', 'MB', 'GB', 'TB'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); // Uncomment one of the following alternatives $bytes /= pow(1024, $pow); // $bytes /= (1 << (10 * $pow)); return round($bytes, $precision) . ' ' . $units[$pow]; } }