File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
plugins/hwp-previews/src/Integration Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -198,22 +198,22 @@ public function is_faust_rewrites_enabled(): bool {
198198 * @param string $url The URL to be rewritten.
199199 */
200200 public function replace_faust_preview_rewrite ($ url ): string {
201- if ( function_exists ( '\WPE\FaustWP\Settings\faustwp_get_setting ' ) ) {
202- $ frontend_uri = \WPE \FaustWP \Settings \faustwp_get_setting ( 'frontend_uri ' );
201+ if ( ! function_exists ( '\WPE\FaustWP\Settings\faustwp_get_setting ' ) ) {
202+ return $ url ;
203+ }
203204
204- // Return the URL as is if frontend uri is empty.
205- if ( ! $ frontend_uri ) {
206- return $ url ;
207- }
205+ $ frontend_uri = \WPE \FaustWP \Settings \faustwp_get_setting ( 'frontend_uri ' );
208206
209- $ frontend_uri = trailingslashit ( $ frontend_uri );
210- $ home_url = trailingslashit ( get_home_url () );
207+ // Return the URL as is if frontend uri is empty.
208+ if ( ! $ frontend_uri ) {
209+ return $ url ;
210+ }
211211
212+ $ frontend_uri = trailingslashit ( $ frontend_uri );
213+ $ home_url = trailingslashit ( get_home_url () );
212214
213- return str_replace ( $ frontend_uri , $ home_url , $ url );
214- }
215215
216- return $ url ;
216+ return str_replace ( $ frontend_uri , $ home_url , $ url ) ;
217217 }
218218
219219 /**
You can’t perform that action at this time.
0 commit comments