Load by slug not working
-
After a routine database cleanup which removed transients, soliloquy is no longer able to load a slider by its slug. Loading by ID works.
The root of the problem lies in the SQL generated by
get_posts()
in_get_slider_by_slug()
. The SQL contains:wp_posts.post_type IN ('post', 'page', 'attachment', 'tribe_venue', 'tribe_events')
, which is missing ‘soliloquy’. This post type list is what WordPress thinks'post_type' => 'any'
should be.I’ve verified that ‘soliloquy’ is a registered post type.
get_post_types() Array ( [post] => post [page] => page [attachment] => attachment [revision] => revision [nav_menu_item] => nav_menu_item [soliloquy] => soliloquy [acf-field-group] => acf-field-group [acf-field] => acf-field [tribe_venue] => tribe_venue [tribe_organizer] => tribe_organizer [tribe_events] => tribe_events )
I don’t necessarily think that this is a soliloquy bug. Soliloquy appears to be registering the post type correctly. I am also not the one who keeps WordPress and plugins updated, so I can’t pinpoint if an update started this.
Though, I believe this can easily be prevented by only performing get_posts on ‘soliloquy’ post_type, rather than ‘any’. This is how I have restored functionality on our side.
Has anyone else encountered this?
- The topic ‘Load by slug not working’ is closed to new replies.