Changeset 3346640
- Timestamp:
- 08/18/2025 08:15:45 PM (8 months ago)
- Location:
- themify-audio-dock
- Files:
-
- 22 added
- 3 edited
-
tags/2.0.6 (added)
-
tags/2.0.6/assets (added)
-
tags/2.0.6/assets/admin.css (added)
-
tags/2.0.6/assets/admin.css.gz (added)
-
tags/2.0.6/assets/admin.js (added)
-
tags/2.0.6/assets/admin.js.gz (added)
-
tags/2.0.6/assets/jquery.minicolors.css (added)
-
tags/2.0.6/assets/jquery.minicolors.css.gz (added)
-
tags/2.0.6/assets/jquery.minicolors.min.js (added)
-
tags/2.0.6/assets/jquery.minicolors.min.js.gz (added)
-
tags/2.0.6/assets/jquery.minicolors.png (added)
-
tags/2.0.6/assets/scripts.js (added)
-
tags/2.0.6/assets/scripts.js.gz (added)
-
tags/2.0.6/assets/styles.css (added)
-
tags/2.0.6/assets/styles.css.gz (added)
-
tags/2.0.6/includes (added)
-
tags/2.0.6/includes/admin.php (added)
-
tags/2.0.6/includes/template.php (added)
-
tags/2.0.6/init.php (added)
-
tags/2.0.6/languages (added)
-
tags/2.0.6/languages/readme.txt (added)
-
tags/2.0.6/readme.txt (added)
-
trunk/includes/admin.php (modified) (3 diffs)
-
trunk/init.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
themify-audio-dock/trunk/includes/admin.php
r2941443 r3346640 46 46 */ 47 47 public function admin_init() { 48 register_setting( 'themify_audio_dock_option_group', 'themify_audio_dock_playlist' ); 49 register_setting( 'themify_audio_dock_option_group', 'themify_audio_dock_collapsed' ); 50 register_setting( 'themify_audio_dock_option_group', 'themify_audio_dock_bar_color' ); 51 register_setting( 'themify_audio_dock_option_group', 'themify_audio_dock_track_color' ); 48 register_setting( 49 'themify_audio_dock_option_group', 50 'themify_audio_dock_playlist', 51 array( 52 'sanitize_callback' => array( $this, 'sanitize_playlist' ) 53 ) 54 ); 55 register_setting( 56 'themify_audio_dock_option_group', 57 'themify_audio_dock_collapsed', 58 array( 59 'sanitize_callback' => array( $this, 'sanitize_collapsed' ) 60 ) 61 ); 62 register_setting( 63 'themify_audio_dock_option_group', 64 'themify_audio_dock_bar_color', 65 array( 66 'sanitize_callback' => array( $this, 'sanitize_color' ) 67 ) 68 ); 69 register_setting( 70 'themify_audio_dock_option_group', 71 'themify_audio_dock_track_color', 72 array( 73 'sanitize_callback' => array( $this, 'sanitize_color' ) 74 ) 75 ); 52 76 53 77 add_settings_section( … … 121 145 foreach( $playlist as $key => $track ) { 122 146 echo '<div class="themify-track">'; 123 printf( '<label>%s <input class="widefat" type="text" name="themify_audio_dock_playlist[%s][name]" value="%s"></label>', __( 'Name', 'themify-audio-dock' ), $key, $track['name']);124 printf( '<label>%s <input class="widefat song-file-field" type="text" name="themify_audio_dock_playlist[%s][file]" value="%s"></label>', __( 'Song File', 'themify-audio-dock' ), $key, $track['file']);147 printf( '<label>%s <input class="widefat" type="text" name="themify_audio_dock_playlist[%s][name]" value="%s"></label>', __( 'Name', 'themify-audio-dock' ), $key, esc_attr($track['name']) ); 148 printf( '<label>%s <input class="widefat song-file-field" type="text" name="themify_audio_dock_playlist[%s][file]" value="%s"></label>', __( 'Song File', 'themify-audio-dock' ), $key, esc_attr($track['file']) ); 125 149 echo '<a href="#" class="themify-audio-dock-media-browse" data-uploader-title="' . __( 'Browse Audio', 'themify-audio-dock' ) . '" data-uploader-button-text="' . __( 'Insert Audio', 'themify-audio-dock' ) . '" data-type="audio">' . __( 'Browse Library', 'themify-audio-dock' ) . '</a>'; 126 150 echo '<a href="#" class="themify-audio-dock-delete-track">X</a>'; … … 150 174 wp_enqueue_script( 'themify-player-admin', $url . 'assets/admin.js', array( 'jquery', 'audiodock-colorpicker' ),$v,true ); 151 175 } 176 177 public function sanitize_playlist( $playlist ) { 178 if ( ! is_array( $playlist ) ) { 179 return array(); 180 } 181 foreach ( $playlist as $key => $track ) { 182 $playlist[$key]['name'] = sanitize_text_field( $track['name'] ); 183 $playlist[$key]['file'] = esc_url_raw( $track['file'] ); 184 } 185 return $playlist; 186 } 187 188 public function sanitize_collapsed( $value ) { 189 return in_array( $value, array( 'yes', 'no' ), true ) ? $value : 'no'; 190 } 191 192 public function sanitize_color($color) 193 { 194 // Accept valid hex (#fff, #ffffff) or rgba(r,g,b,a) format 195 $color = trim($color); 196 if (preg_match('/^#([A-Fa-f0-9]{3}){1,2}$/', $color)) { 197 return $color; 198 } 199 if (preg_match('/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/', $color)) { 200 // Validate each channel 201 $parts = []; 202 preg_match('/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/', $color, $parts); 203 $r = (int)$parts[1]; 204 $g = (int)$parts[2]; 205 $b = (int)$parts[3]; 206 $a = (float)$parts[4]; 207 if ($r >= 0 && $r <= 255 && $g >= 0 && $g <= 255 && $b >= 0 && $b <= 255 && $a >= 0 && $a <= 1) { 208 return "rgba($r,$g,$b,$a)"; 209 } 210 } 211 return ''; 212 } 152 213 } 153 214 new Themify_Player_Admin; -
themify-audio-dock/trunk/init.php
r3184692 r3346640 3 3 Plugin Name: Themify Audio Dock 4 4 Plugin URI: https://themify.me/ 5 Version: 2.0. 55 Version: 2.0.6 6 6 Author: Themify 7 7 Author URI: https://themify.me … … 44 44 45 45 public static function get_version(){ 46 return '2.0. 5';46 return '2.0.6'; 47 47 } 48 48 -
themify-audio-dock/trunk/readme.txt
r3184692 r3346640 4 4 Tags: audio, audio-player, playlist 5 5 Requires at least: 4.3 6 Tested up to: 6. 6.07 Stable tag: 2.0. 56 Tested up to: 6.8.2 7 Stable tag: 2.0.6 8 8 License: GPL v2 9 9 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.