File tree 1 file changed +16
-4
lines changed 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,6 @@ public function init() {
79
79
* return bool false Whether to show Custom Permalink form or not.
80
80
*/
81
81
private function exclude_custom_permalinks ( $ post ) {
82
- $ args = array (
83
- 'public ' => true ,
84
- );
85
82
$ exclude_post_types = apply_filters (
86
83
'custom_permalinks_exclude_post_type ' ,
87
84
$ post ->post_type
@@ -96,7 +93,22 @@ private function exclude_custom_permalinks( $post ) {
96
93
'custom_permalinks_exclude_posts ' ,
97
94
$ post
98
95
);
99
- $ public_post_types = get_post_types ( $ args , 'objects ' );
96
+ $ post_types = get_post_types (
97
+ array (
98
+ 'public ' => true ,
99
+ ),
100
+ 'objects '
101
+ );
102
+ $ public_post_types = array ();
103
+
104
+ foreach ( $ post_types as $ post_type_name => $ single ) {
105
+ // Check conditions for accessible single post URLs.
106
+ if ( 'page ' === $ post_type_name || 'post ' === $ post_type_name ) {
107
+ $ public_post_types [ $ post_type_name ] = $ single ;
108
+ } elseif ( $ single ->publicly_queryable && $ single ->rewrite ) {
109
+ $ public_post_types [ $ post_type_name ] = $ single ;
110
+ }
111
+ }
100
112
101
113
if ( isset ( $ this ->permalink_metabox ) && 1 === $ this ->permalink_metabox ) {
102
114
$ check_availability = true ;
You can’t perform that action at this time.
0 commit comments