File tree 3 files changed +8
-6
lines changed
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,11 @@ public function adminInit()
77
77
return ;
78
78
}
79
79
80
- $ slugs = Endpoint::slugsTitles ();
80
+ $ slugs = Endpoint::getSlugs ();
81
81
$ published = [];
82
82
if (tos ()->overwriteEndpoints ()) {
83
- foreach ($ slugs as $ slug => $ title ) {
84
- $ page = get_page_by_title ( $ title );
83
+ foreach (array_keys ( $ slugs) as $ slug ) {
84
+ $ page = get_page_by_path ( $ slug );
85
85
if (!is_null ($ page ) && $ page ->post_status == 'publish ' ) {
86
86
$ published [$ slug ] = $ page ->ID ;
87
87
}
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ public static function addEndpoint()
65
65
66
66
public static function endpointTemplateRedirect ()
67
67
{
68
+ $ pagePath = '' ;
68
69
$ title = '' ;
69
70
$ prefix = '' ;
70
71
$ locale = Locale::getLocale ();
@@ -84,17 +85,18 @@ public static function endpointTemplateRedirect()
84
85
wp_redirect (site_url ($ langSegment . $ r ));
85
86
exit ;
86
87
} elseif ($ urlSlug == $ slug && $ langCode == $ lang ) {
88
+ $ pagePath = $ slug ;
87
89
$ title = self ::slugsTitles ()[$ key ];
88
90
$ prefix = self ::defaultSlugs ()[$ key ];
89
91
break 2 ;
90
92
}
91
93
}
92
94
}
93
- if (!$ title || !$ prefix ) {
95
+ if (!$ pagePath || ! $ title || !$ prefix ) {
94
96
return ;
95
97
}
96
98
if (tos ()->overwriteEndpoints ()) {
97
- $ page = get_page_by_title ( $ title );
99
+ $ page = get_page_by_path ( $ pagePath );
98
100
if (!is_null ($ page ) && $ page ->post_status == 'publish ' ) {
99
101
// Replaces double line breaks with paragraph elements
100
102
$ content = wpautop ($ page ->post_content );
Original file line number Diff line number Diff line change 4
4
Plugin Name: RRZE Legal
5
5
Plugin URI: https://gitlab.rrze.fau.de/rrze-webteam/rrze-legal
6
6
Description: Legal Mandatory Information & GDPR.
7
- Version: 2.6.4
7
+ Version: 2.6.5
8
8
Author: RRZE Webteam
9
9
Author URI: https://blogs.fau.de/webworking/
10
10
License: GNU General Public License Version 3
You can’t perform that action at this time.
0 commit comments