options = get_option('yofla_360_options'); $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'general'; ?>

360° Product Rotation Plugin Settings

'; // This prints out all hidden setting fields settings_fields('yofla_360_option_group'); do_settings_sections('yofla-360-admin-legacy'); submit_button(); echo ''; } elseif ($active_tab == 'x_woocommerce') { echo '
'; // This prints out all hidden setting fields settings_fields('yofla_360_option_group'); do_settings_sections('yofla-360-admin-woocommerce'); submit_button(); echo '
'; } else { ?>

Cache Settings

Utils()->clear_cache()) { echo 'Cache cleared!'; } else { echo 'Failed deleting cache!'; } } ?>

Delete the content of the wp-content/uploads/yofla360/_cache directory. Useful when migrating the site from http to https.

'; wp_nonce_field('test_button_clicked'); echo ''; submit_button('Delete Cache'); echo ''; echo '
'; } // end if/else ?> License Key:', array($this, 'licensekey_callback'), 'yofla-360-admin', 'yofla_360_settings_section_general' ); //license id in legacy settings add_settings_field( 'license_id', 'License Key or Id:', array($this, 'licenseid_callback'), 'yofla-360-admin', 'yofla_360_settings_section_legacy' ); //local engine add_settings_field( 'local_engine', 'Local Engine:', array($this, 'local_engine_callback'), 'yofla-360-admin', 'yofla_360_settings_section_legacy' ); //rotatetooljs_url add_settings_field( 'rotatetooljs_url', 'rotatetool.js url:
(optional)
', array($this, 'rotatetooljs_url_callback'), 'yofla-360-admin', 'yofla_360_settings_section_legacy' ); //global player styles add_settings_field( 'theme_url', 'Override player theme url:
(optional)
', array($this, 'theme_url_callback'), 'yofla-360-admin', 'yofla_360_settings_section_legacy' ); //iframe styles add_settings_field( 'iframe_styles', 'Iframe Styles:', array($this, 'iframe_styles_callback'), 'yofla-360-admin', 'yofla_360_settings_section_general' ); //gaEnabled add_settings_field( 'ga_enabled', 'ga_enabled:', array($this, 'ga_enabled_callback'), 'yofla-360-admin', 'yofla_360_settings_section_shortcode' ); //ga tracking id add_settings_field( 'ga_tracking_id', 'ga_tracking_id:', array($this, 'ga_tracking_id_callback'), 'yofla-360-admin', 'yofla_360_settings_section_shortcode' ); if (YoFLA360::$isWooCommerce) { add_settings_section( 'yofla_360_settings_section_woocommerce', // ID 'WooCommerce', // Title array($this, 'print_section_info_woocommerce'), // Callback 'yofla-360-admin' // Page ); //url settings add_settings_field( 'woocommerce_360thumb_url', '360 Thumb Url:', array($this, 'woocommerce_360thumb_url_callback'), 'yofla-360-admin', 'yofla_360_settings_section_woocommerce' ); //woocomemrce alternate embedding add_settings_field( 'woocommerce_alternate_embedding', 'WooCommerce alternate embedding:', array($this, 'woocommerce_alternate_embedding_callback'), 'yofla-360-admin', 'yofla_360_settings_section_woocommerce' ); } } /** * Sanitize each setting field as needed * * @param array $input Contains all settings fields as array keys * @return array */ public function sanitize($input) { $new_input = array(); if (isset($input['license_id'])) { $firstTwoChars = strtolower( substr($this->options['license_id'],0,2)); if($firstTwoChars == 'yc'){ $new_input['license_id'] = 'please_do_not_use_cloud-based_license_key_here'; } else{ $new_input['license_id'] = sanitize_text_field($input['license_id']); } } if (isset($input['license_key'])) { $new_input['license_key'] = sanitize_text_field($input['license_key']); } if (isset($input['rotatetooljs_url'])) { $new_input['rotatetooljs_url'] = sanitize_text_field($input['rotatetooljs_url']); $new_input['rotatetooljs_url'] = YoFLA360()->Utils()->addHttp($new_input['rotatetooljs_url']); } if (isset($input['theme_url'])) { $new_input['theme_url'] = sanitize_text_field($input['theme_url']); } if (isset($input['iframe_styles'])) { $new_input['iframe_styles'] = sanitize_text_field($input['iframe_styles']); //remove trailing/leading " or ' $new_input['iframe_styles'] = trim($new_input['iframe_styles'], " '\""); } if (isset($input['ga_tracking_id'])) { $new_input['ga_tracking_id'] = sanitize_text_field($input['ga_tracking_id']); //remove trailing/leading " or ' $new_input['ga_tracking_id'] = trim($new_input['ga_tracking_id'], " '\""); } if (isset($input['ga_enabled'])) { $new_input['ga_enabled'] = 1; } if (isset($input['local_engine'])) { $new_input['local_engine'] = 1; } if (isset($input['woocommerce_alternate_embedding'])) { $new_input['woocommerce_alternate_embedding'] = 1; } if (isset($input['woocommerce_360thumb_url'])) { $new_input['woocommerce_360thumb_url'] = sanitize_text_field($input['woocommerce_360thumb_url']); } return $new_input; } public function print_section_info_general() { $link_plugin_media = '360 Views Library'; echo $link_plugin_media; } /** * Print the Legacy Section text */ public function print_legacy_section_info() { echo 'Show legacy player settings (for local 360 views created using the desktop application "3DRT Setup Utility")'; echo '