[Resolved] Enfold Avia builder cannot show CPT from Types

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

This topic contains 11 replies, has 2 voices.

Last updated by herbie4 3 years ago.

Assigned support staff: Meagan Hanes.

Author
Posts
#498885

I am trying to show the Toolset Types CPT in the advanced editor Avia Builder for example in the module blog post grid. All other CPT show up fine, but not the one created with Types.

Enfold support gives the following suggestion:
"We usually recommend the following plugins which automatically register the post type to the posts element of the advance layout builder."

Or switch to use CPT UI plug-in. I tested this and it works, CPT shows up.

Is there any way to get Types CPT listed as all other CPT are?

#498890

Hi there! Thanks for reporting this issue.

I'm curious as to why exactly Avia Builder isn't able to detect our CPT, as we create it using WordPress standards.

To best troubleshoot the issue, please make a snapshot of your site using the Duplicator plugin: https://wordpress.org/plugins/duplicator/. Once the snapshot is complete, either upload the snapshot ZIP file and the installer.php file to a file sharing service such as Dropbox (and share the link in your reply) or right click the Duplicator links in your wp-admin and paste in your reply.

Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.

I will enable the next reply to be private so only you and I have access to it!

Thanks,
Meagan

#500805

Thanks for the site copy. I've had a look and can see that indeed, the Enfold theme is not detecting Toolset Types-created custom post types.

Unfortunately, there's nothing we can do here to solve this problem - the problem is with the Enfold theme not detecting custom post types correctly. As our page here notes (https://toolset.com/home/compatibility-toolset-plugins-themes/), Types follows all WordPress standards in creating these custom post types.

I would open up a thread with the Enfold team and report this incompatibility. Please feel free to include a link to this thread so that they can get a sense of the problem. They can reach out to us through the Community Forums here: https://toolset.com/forums/forum/general-and-pre-sales-questions/

Sorry I'm not able to provide you with a better solution, but thanks for reporting it.
Meagan

#501065

Okay, Thank you for the quick response Meagan. I opend up a support issue at Kriesi about this. If I find a sollution I will let you know by posting it here. Thanks again!

#501184

Hi Meagan,

There is a open question from Kriesi (Enfold developers) here: hidden link

"Please ask the Toolset support if they have an existing function to retrieve registered custom post types via their plugin."

Can you answer this?

#501252

Our developers have responded to their question with:

"Types registers its custom post types at `init:10` which is the usual place to do such thing: https://codex.wordpress.org/Function_Reference/register_post_type" which means that get_post_types should work as intended.

I've escalated this to our internal developers in case they can help offer insight as to why these CPTs aren't being shown. I'll keep you updated with anything they find.

Thanks,
Meagan

#502209

Hi there,
Just want to keep you posted on what I have been testing in conjuction with Kriesi. You can find the support thread here: hidden link

#502266

I have an update from our developers, which should be shared with the theme authors:

"The case with Enfold is exactly the same. Their init:10 callbacks includes a AviaBuilder::init method, which calls the AviaBuilder::createShortcode method, which instantiates all the aviaShortcodeTemplate subclasses. Each one of those subclasses constructor then calls their aviaShortcodeTemplate::extra_config method, which then calls the popup_elements method of each individual shortcode class.

In the case of the portfolio module (shortcode), that popup_elements method contains a call to AviaHtmlHelper::get_registered_post_type_array which fires a native get_post_types call.

By the time this all happens, we still did not reach the init:10 callback by Types, wpcf_init_custom_types_taxonomies, hence no post type or taxonomy from Types is available.

Again, as we do register our items in the right place, I would strongly suggest contacting the Enfold theme authors and encourage them to initialize anything requiring custom post types or taxonomies to happen way later."

It seems that the priority of callbacks should be modified so that custom post types created with the correct priority aren't excluded.

Please pass this information on to the theme author and hopefully they'll provide a fix soon.

Thanks again for reporting this!
Meagan

#502636

Hello Meagan,

Kriesi came up with a temporary fix:
hidden link

Thank you for the update. I forwarded all info to Kriesi, theme developers. Now waiting to hear what they will do with this.

#502797

Hello Meagan,
The fix provided by Kriesi is not a great way to go as it involves a hack of core theme files. Is there anyway to make Types register its post types earlier?

#503122

I suggest you use the workaround they've provided - we won't be changing the priority of Types registration as it is correct according to WordPress standards. It is the Kriesi team who should fix their code, as it will likely have problems with other plugins which also follow WordPress standards.

Since they're aware of it, I'll be closing this thread.
Thanks again for your help in bringing this to their attention!
Meagan

#503835

Meagan, Thank you for the great support.

The forum ‘Types Community Support’ is closed to new topics and replies.