Make WordPress Core

Changeset 43923


Ignore:
Timestamp:
11/21/2018 07:29:11 PM (8 years ago)
Author:
youknowriad
Message:

Block Editor: Fix PHP warning showing up when loading editor styles while in RTL.

In RTL languages, WordPress adds style-editor-rtl.css editor styles to the global $editor_styles
This patch ignores handling these styles if the file is not preset.

Props desrosj, mostafa.s1990.
Fixes #45288.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-admin/edit-form-blocks.php

    r43919 r43923  
    198198                        }
    199199                } else {
    200                         $file     = get_theme_file_path( $style );
    201                         $styles[] = array(
    202                                 'css'     => file_get_contents( get_theme_file_path( $style ) ),
    203                                 'baseURL' => get_theme_file_uri( $style ),
    204                         );
     200                        $file = get_theme_file_path( $style );
     201                        if ( file_exists( $file ) ) {
     202                                $styles[] = array(
     203                                        'css'     => file_get_contents( $file ),
     204                                        'baseURL' => get_theme_file_uri( $style ),
     205                                );
     206                        }
    205207                }
    206208        }
Note: See TracChangeset for help on using the changeset viewer.