| @@ -51,9 +51,9 @@ | ||
| 51 | 51 | * |
| 52 | 52 | * @return void |
| 53 | 53 | */ |
| 54 | 54 | public function render_menu_editor_page() { |
| 55 | - $editor = filter_input( INPUT_GET, 'editor', FILTER_SANITIZE_STRING ); | |
| 55 | + $editor = filter_input( INPUT_GET, 'editor', FILTER_SANITIZE_URL ); | |
| 56 | 56 | if ( ! empty( $editor ) && 'rmp_menu' === get_post_type() && current_user_can( 'administrator' ) ) { |
| 57 | 57 | set_current_screen(); |
| 58 | 58 | include RMP_PLUGIN_PATH_V4 . '/templates/rmp-editor.php'; |
| 59 | 59 | exit; |
| @@ -104,8 +104,13 @@ | ||
| 104 | 104 | * |
| 105 | 105 | * @param HTML. |
| 106 | 106 | */ |
| 107 | 107 | public function footer_section() { |
| 108 | + global $wp_filesystem; | |
| 109 | + if ( empty( $wp_filesystem ) ) { | |
| 110 | + require_once ABSPATH . 'wp-admin/includes/file.php'; | |
| 111 | + } | |
| 112 | + WP_Filesystem(); | |
| 108 | 113 | ?> |
| 109 | 114 | <div id="rmp-editor-footer" class="rmp-editor-footer"> |
| 110 | 115 | |
| 111 | 116 | <!-- Update the settings button in footer--> |
| @@ -140,11 +145,11 @@ | ||
| 140 | 145 | <div class="rmp-preview-device-wrapper"> |
| 141 | 146 | |
| 142 | 147 | <button type="button" id="rmp-preview-mobile" class=" rmp-device-preview rmp-preview-mobile active" aria-pressed="1" data-device="mobile"> |
| 143 | 148 | <?php |
| 144 | - $svg_mobile = wp_remote_get( RMP_PLUGIN_URL_V4 . '/assets/admin/icons/svg/mobile.svg' ); | |
| 145 | - if ( is_array( $svg_mobile ) && ! is_wp_error( $svg_mobile ) ) { | |
| 146 | - echo wp_kses( $svg_mobile['body'], rmp_allow_svg_html_tags() ); | |
| 149 | + $svg_mobile = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/mobile.svg' ); | |
| 150 | + if ( $svg_mobile ) { | |
| 151 | + echo wp_kses( $svg_mobile, rmp_allow_svg_html_tags() ); | |
| 147 | 152 | } |
| 148 | 153 | ?> |
| 149 | 154 | <span class="screen-reader-text"> |
| 150 | 155 | <?php esc_html_e( 'Enter mobile preview mode', 'responsive-menu' ); ?> |
| @@ -152,11 +157,11 @@ | ||
| 152 | 157 | </button> |
| 153 | 158 | |
| 154 | 159 | <button type="button" id="rmp-preview-tablet" class="rmp-preview-tablet rmp-device-preview" aria-pressed="" data-device="tablet"> |
| 155 | 160 | <?php |
| 156 | - $svg_tablet = wp_remote_get( RMP_PLUGIN_URL_V4 . '/assets/admin/icons/svg/tablet.svg' ); | |
| 157 | - if ( is_array( $svg_tablet ) && ! is_wp_error( $svg_tablet ) ) { | |
| 158 | - echo wp_kses( $svg_tablet['body'], rmp_allow_svg_html_tags() ); | |
| 161 | + $svg_tablet = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/tablet.svg' ); | |
| 162 | + if ( $svg_tablet ) { | |
| 163 | + echo wp_kses( $svg_tablet, rmp_allow_svg_html_tags() ); | |
| 159 | 164 | } |
| 160 | 165 | ?> |
| 161 | 166 | <span class="screen-reader-text"> |
| 162 | 167 | <?php esc_html_e( 'Enter tablet preview mode', 'responsive-menu' ); ?> |
| @@ -164,11 +169,11 @@ | ||
| 164 | 169 | </button> |
| 165 | 170 | |
| 166 | 171 | <button type="button" id="rmp-preview-desktop" class="rmp-preview-desktop rmp-device-preview" aria-pressed="" data-device="desktop"> |
| 167 | 172 | <?php |
| 168 | - $svg_desktop = wp_remote_get( RMP_PLUGIN_URL_V4 . '/assets/admin/icons/svg/desktop.svg' ); | |
| 169 | - if ( is_array( $svg_desktop ) && ! is_wp_error( $svg_desktop ) ) { | |
| 170 | - echo wp_kses( $svg_desktop['body'], rmp_allow_svg_html_tags() ); | |
| 173 | + $svg_desktop = $wp_filesystem->get_contents( RMP_PLUGIN_PATH_V4 . '/assets/admin/icons/svg/desktop.svg' ); | |
| 174 | + if ( $svg_desktop ) { | |
| 175 | + echo wp_kses( $svg_desktop, rmp_allow_svg_html_tags() ); | |
| 171 | 176 | } |
| 172 | 177 | ?> |
| 173 | 178 | <span class="screen-reader-text"> |
| 174 | 179 | <?php esc_html_e( 'Enter desktop preview mode', 'responsive-menu' ); ?> |
| @@ -184,9 +189,9 @@ | ||
| 184 | 189 | * Filters the editor footer html. |
| 185 | 190 | * |
| 186 | 191 | * @param string|HTML $html |
| 187 | 192 | */ |
| 188 | - echo apply_filters( 'rmp_editor_footer_html', $html ); | |
| 193 | + echo apply_filters( 'rmp_editor_footer_html', '' ); | |
| 189 | 194 | } |
| 190 | 195 | |
| 191 | 196 | /** |
| 192 | 197 | * Function to return the markups for sidebar drawers. |