Closed pnpetroff closed 9 years ago
Anyone? Ideas?
@pe6o can you one by one disable the Unyson extensions that you have enable in order to localize from what extension you have this problem, because when you disable the whole plugin , you disable all extensions, here is an screenshot that explain how to disable extensions.
@llemurya It's happening with the Page Builder extension.The moment I enable it, in the URL of the page is inserted the post type before its slug.
@pe6o you trying this with the last version of the page builder, builder? Please download it from this page, and pay attention if you have the latest version of the Unyson that is v2.2.8, please test it and say if bug remains?
Yes, I'm using the latest version.
Strange things are happening..
I disabled the custom post type plugin, enabled Unyson with Page Builder and whatever Page I click on, it has the same title. The custom post type slug is removed from the permalink of the page but holy goly look at this screenshot!
It gives the same errors (notices) when I try to add new page.
@pe6o can you see other third party plugins maybe they cause your errors? please disable one by one and give us an answer.
There is nothing enabled except for Unyson. Not the only way to remove those errors is either to disable Unyson or enable the custom post type plugin and Unyson.
I stripped all the functionality of the plugin and left only the post type register. It uses the known Wordpress Plugin Boilerplate - here is a link.
@pe6o I tested and for me it works, but WordPress have an strange behavior because you name your custom post type post_type
I think this naming is improper , it can cause name collision in the WordPress, as a proof you can see this video , pay attention when the post type is named post_type
the pages didn't show but their exists. If it helps, please close the issue.
It's strange, the example I gave you is with book
post_type.
Okay, I found the culprit. It's directly connected to my solution trying to implement prepopulated multi select field - https://github.com/ThemeFuse/Unyson/issues/456#issuecomment-93731176
I was passing the non-existent (when the plugin is not installed) custom post type to the helper function that is populating my selection array. Implemented a post_type_exists
check and now it works.
This issue was not connected with the framework... I'm really sorry for the lost time.
Okay, the bug is back and I managed to target it. When I create the array population function ( in options.php
of the shortcode or hooks.php
of the theme, it doesn't matter) the post type slug is attached in the URL of the page.
Here is a link to the page builder shortcode -https://www.dropbox.com/s/dxqhrbpq0xsalzj/addable-shortcode.zip?dl=0
Open its options.php
to see the function, you can try putting it in hooks.php
.
Install also the plugin with the custom post type books
(as the array have to be populated with books
posts) and then try to create new Page, you should get the bug.
Whoa, why is $post
changed and wp_reset_postdata()
is not resetting it?
I implemented the solution and now it works. Can't understand why the global $post
stayed changed..
I registered new custom post type in a plugin like this:
And with Unyson installed and activated I'm seeing my (default wordpress) Pages have this custom post type. It's permalink also have the post type slug. When I disable my plugin and open a Page for editing it gives
Writing
print_r($post->post_type);
on line 1196 inposts.php
gives me the custom post type name in the page editor. Tried resetting the Permalinks but the error still stays. I'm also runningflush_rewrite_rules();
when my plugin is activated or disabled.Disabling Unyson fixes the problem..