Changeset 3321472
- Timestamp:
- 07/02/2025 10:35:40 PM (5 months ago)
- Location:
- guten-free-options/trunk
- Files:
-
- 3 edited
-
guten-free-options.php (modified) (19 diffs)
-
readme.md (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
guten-free-options/trunk/guten-free-options.php
r3316103 r3321472 5 5 Author: Tony Hayes 6 6 Description: Gutenberg Free Options for your WordPressed Burger err I mean Editor 7 Version: 0.9. 67 Version: 0.9.7 8 8 Author URI: https://wpmedic.tech 9 9 GitHub Plugin URI: majick777/guten-free-options … … 384 384 // ---------------------- 385 385 // [unused] - via Classic Editor plugin 386 function gfo_add_edit_links( $actions, $post) {386 function gfo_add_edit_links( $actions, $post ) { 387 387 388 388 // This is in Gutenberg now. … … 461 461 462 462 // --- output the switch editor button on the editor page --- 463 // 0.9.7: add missing escaping to style/class outputs 463 464 echo '<div id="gutenberg-editor-button-wrapper">' . "\n"; 464 465 echo '<a href="' . esc_url( $button['url'] ) . '">' . "\n"; 465 466 echo '<div id="' . esc_attr( $button['id'] ) . '" class="' . esc_attr( $button['class'] ) . '" title="' . esc_attr( $button['title'] ) . '"'; 466 467 if ( !empty( $button['styles'] ) ) { 467 echo ' style="' . $button['styles']. '"';468 echo ' style="' . esc_attr( $button['styles'] ) . '"'; 468 469 } 469 470 echo '>' . "\n"; 470 echo '<span class="' .$button['icon_class'].'"';471 echo '<span class="' . esc_attr( $button['icon_class'] ) . '"'; 471 472 if ( !empty( $button['icon_style'] ) ) { 472 echo ' style="' . $button['icon_style']. '"';473 echo ' style="' . esc_attr( $button['icon_style'] ) . '"'; 473 474 } 474 475 echo '></span>' . "\n"; … … 680 681 $disable_widget_blocks = false; 681 682 $widget_blocks = gfo_get_setting( 'widget_blocks', false ); 682 683 684 // 0.9.7: fix mismatched text domains 683 685 echo '<div class="message">' . "\n"; 684 echo '<b>' . esc_html( __( 'Guten Free Options', ' bioship' ) ) . '</b>: ';686 echo '<b>' . esc_html( __( 'Guten Free Options', 'guten-free-options' ) ) . '</b>: '; 685 687 if ( 'off' == $widget_blocks ) { 686 echo esc_html( __( 'The use of the Block Editor has been disabled for Widgets.', ' bioship' ) );688 echo esc_html( __( 'The use of the Block Editor has been disabled for Widgets.', 'guten-free-options' ) ); 687 689 } elseif ( ( '' == $widget_blocks ) || ( 'auto' == $widget_blocks ) ) { 688 echo esc_html( __( 'No Widgets contain blocks. Auto mode has disabled the Block Editor for Widgets.', ' bioship' ) );690 echo esc_html( __( 'No Widgets contain blocks. Auto mode has disabled the Block Editor for Widgets.', 'guten-free-options' ) ); 689 691 } 690 692 // 0.9.6: link to settings at options-general.php not admin.php … … 1243 1245 // --- update network default editor setting --- 1244 1246 if ( isset( $_POST['gfo_network_default_editor'] ) ) { 1245 $default_editor = sanitize_text_field( $_POST['gfo_network_default_editor']);1247 $default_editor = sanitize_text_field( wp_unslash( $_POST['gfo_network_default_editor'] ) ); 1246 1248 $valid = array( 'classic', 'block' ); 1247 1249 if ( in_array( $default_editor, $valid ) ) { … … 1299 1301 if ( isset( $_GET['updated'] ) ) { 1300 1302 echo '<tr><td></td><td></td><td>' . "\n"; 1301 if ( 'yes' == sanitize_text_field( $_GET['updated']) ) {1303 if ( 'yes' == sanitize_text_field( wp_unslash( $_GET['updated'] ) ) ) { 1302 1304 $message = esc_html( $settings['title'] ) . ' '; 1303 1305 if ( $network ) { … … 2233 2235 if ( has_filter( 'replace_editor', 'gutenberg_init' ) 2234 2236 || has_filter( 'load-post.php', 'gutenberg_intercept_edit_post' ) 2235 || has_filter( 'load-post-new.php', 'gutenberg_intercept_post_new' ) ) {2237 || has_filter( 'load-post-new.php', 'gutenberg_intercept_post_new' ) ) { 2236 2238 return 'plugin'; 2237 2239 } … … 2258 2260 if ( 'yes' == gfo_get_setting( 'check_blocks' ) ) { 2259 2261 $protocol = 'http'; 2260 if ( isset( $_SERVER['HTTPS'] ) && ( 'off' !== $_SERVER['HTTPS'] ) ) {2262 if ( isset( $_SERVER['HTTPS'] ) && ( 'off' !== $_SERVER['HTTPS'] ) ) { 2261 2263 $protocol = 'https'; 2262 2264 } … … 2342 2344 // use querystring or set to post for post-new.php if not specified and on that page 2343 2345 if ( isset( $_GET['post_type'] ) ) { 2344 $post_type = sanitize_text_field( $_GET['post_type']);2346 $post_type = sanitize_text_field( wp_unslash( $_GET['post_type'] ) ); 2345 2347 } elseif ( gfo_is_gutenberg_admin_url( array( 'post-new.php' ) ) ) { 2346 2348 $post_type = 'post'; … … 2378 2380 if ( !$locked ) { 2379 2381 if ( isset( $_GET['editor'] ) ) { 2380 if ( 'block' == $_GET['editor']) {2382 if ( 'block' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) { 2381 2383 $gutenfree['last'] = 'querystring'; 2382 2384 return true; 2383 } elseif ( 'classic' == $_GET['editor']) {2385 } elseif ( 'classic' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) { 2384 2386 $gutenfree['last'] = 'querystring'; 2385 2387 return false; … … 2625 2627 // --- check for editor querystrings (manual user override) --- 2626 2628 if ( isset( $_GET['editor'] ) ) { 2627 if ( 'block' == $_GET['editor']) {2629 if ( 'block' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) { 2628 2630 $gutenfree['last'] = 'querystring'; 2629 2631 return true; 2630 } elseif ( 'classic' == $_GET['editor']) {2632 } elseif ( 'classic' == sanitize_text_field( wp_unslash( $_GET['editor'] ) ) ) { 2631 2633 $gutenfree['last'] = 'querystring'; 2632 2634 return false; … … 2746 2748 $can_edit = false; 2747 2749 $gutenfree['last'] = 'meta'; 2748 gfo_debug_log( 'Post ' . $post_id . ' Meta Other -> Classic' );2750 gfo_debug_log( 'Post ' . $post_id . ' Meta Other -> Classic' ); 2749 2751 } 2750 2752 … … 3105 3107 3106 3108 // 0.9.6: removed unused and undefined onchange variable 3107 echo '<td><span class="editor-override-label">' . __( 'Editor','guten-free-options' ) . '</span></td>'; 3109 // 0.9.7: adding missing escaping on editor label 3110 echo '<td><span class="editor-override-label">' . esc_html( __( 'Editor','guten-free-options' ) ) . '</span></td>'; 3108 3111 echo '<td><select name="editor_override" id="editor_override">'; 3109 3112 foreach ( $options as $option => $label ) { … … 3118 3121 // --- set a help icon with title for the setting --- 3119 3122 $posttypeobject = get_post_type_object( get_post_type($post->ID ) ); 3120 $title = __( 'Set the Editor for this', 'guten-free-options' ) . " ". $posttypeobject->labels->singular_name;3123 $title = __( 'Set the Editor for this', 'guten-free-options' ) . ' ' . $posttypeobject->labels->singular_name; 3121 3124 echo '<td><span id="editor-override-help" class="dashicons dashicons-editor-help" title="' . esc_attr( $title ) . '"></span></td>'; 3122 3125 … … 3187 3190 } 3188 3191 if ( isset( $_POST['editor_override'] ) ) { 3189 $override = sanitize_text_field( $_POST['editor_override']);3192 $override = sanitize_text_field( wp_unslash( $_POST['editor_override'] ) ); 3190 3193 $options = array( 3191 3194 '' => __( 'Do Not Override', 'guten-free-options' ), … … 3270 3273 $referer = sanitize_text_field( wp_unslash( $_POST['_wp_http_referer'] ) ); 3271 3274 if ( false !== strpos( $referer, '&classic-editor' ) ) { 3272 $location = add_query_arg( 'classic-editor', '', $location);3275 $location = add_query_arg( 'classic-editor', '', $location ); 3273 3276 } 3274 3277 if ( false !== strpos( $referer, '&editor=classic' ) ) { 3275 $location = add_query_arg( 'editor', 'classic', $location );3278 $location = add_query_arg( 'editor', 'classic', $location ); 3276 3279 } 3277 3280 // not sure if will ever really be needed... but let us add the other way around just in case! … … 3319 3322 function gfo_get_post_name_only( $post_id ) { 3320 3323 global $wpdb; 3321 $query = "SELECT post_name FROM " .$wpdb->prefix."posts WHERE ID = '%d'";3324 $query = "SELECT post_name FROM " . $wpdb->prefix . "posts WHERE ID = '%d'"; 3322 3325 $query = $wpdb->prepare( $query, $post_id ); 3323 3326 $result = $wpdb->get_var( $query ); … … 3335 3338 global $wpdb; 3336 3339 // 0.9.6: remove unnecessary quotes around integer value 3337 $query = "SELECT post_content FROM " .$wpdb->prefix."posts WHERE ID = %d";3340 $query = "SELECT post_content FROM " . $wpdb->prefix . "posts WHERE ID = %d"; 3338 3341 // 0.9.2: fix to use post_id not id 3339 3342 $query = $wpdb->prepare( $query, $post_id ); … … 3352 3355 return true; 3353 3356 } 3354 $active_plugins = (array) get_option( 'active_plugins' );3357 $active_plugins = (array) get_option( 'active_plugins' ); 3355 3358 if ( in_array( 'gutenberg/gutenberg.php', $active_plugins ) ) { 3356 3359 $active = true; -
guten-free-options/trunk/readme.md
r3316103 r3321472 10 10 Requires at least: 4.9.0 11 11 Tested up to: 6.8.1 12 Stable tag: 0.9. 612 Stable tag: 0.9.7 13 13 14 Gutenberg Free Options for your WordPressed Burger err I mean Editor 14 Gutenberg Free Options for your WordPressed Burger err I mean Editor. 15 15 16 16 == Description == 17 17 18 18 Want to use and/or not use the new Block Editor (Gutenberg) according to *your needs*? 19 20 Guten Free Options provides this for your WordPressed Burger err I mean Editor. 19 21 20 22 Guten Free Options allows you to smoothly transition your writing experience to WordPress 5+ by giving you full control over when a post should be edited with the Classic Editor or Block Editor... plus have a button to easily switch between them like other page builders. … … 73 75 74 76 == Changelog == 77 78 = 0.9.7 = 79 * Fixed: extra sanitization and escaping 75 80 76 81 = 0.9.6 = -
guten-free-options/trunk/readme.txt
r3316103 r3321472 10 10 Requires at least: 4.9.0 11 11 Tested up to: 6.8.1 12 Stable tag: 0.9. 612 Stable tag: 0.9.7 13 13 14 14 Gutenberg Free Options for your WordPressed Burger err I mean Editor. … … 76 76 == Changelog == 77 77 78 = 0.9.7 = 79 * Fixed: extra sanitization and escaping 80 78 81 = 0.9.6 = 79 82 * Updated: WordQuest Helper (1.8.3)
Note: See TracChangeset
for help on using the changeset viewer.