WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Custom Post Type UI] Version 0.4.1 partially working with WP3 Beta 1 (38 posts)

  1. Matt Hill
    Member
    Posted 4 years ago #

    Latest version of Custom Post Type UI is partially working work with my fresh install of WordPress 3 Beta 1.

    Although I can use the "Add New" option, if I try to edit a Post Type using "Manage Post Types", I receive this error:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cpt_manage_cpt' was given in F:\Projects\wp3beta\wp-includes\plugin.php on line 395

    Any ideas?

    http://wordpress.org/extend/plugins/custom-post-type-ui/

  2. MichaelH
    Member
    Posted 4 years ago #

    Not seeing that error when editing a post type. Exactly what option configuration did you have for that post type?

  3. Matt Hill
    Member
    Posted 4 years ago #

    Hi Michael. I can't actually get into the necessary screen to tell you what settings the post type has: this error happens before you can see the post type. From memory though, I recall I accepted all the defaults, except for switching off some of the meta boxes (I think this was Comments, Revisions and Custom Fields). I didn't create any taxonomies yet.

    It also doesn't seem to make any difference what settings the post type has anyway: this error is also generated if you select "Manage Post Types" before you've even created a custom post type.

  4. Brad Williams
    Member
    Posted 4 years ago #

    Thanks for reporting. I'll see if I can reproduce this error in my install.

  5. ronbme
    Member
    Posted 4 years ago #

    I tried to duplicate this error but couldn't.

    What it looks like is that the custom post type wasn't created in the first place. That would also account for the error you got when trying to access "Manage Post Types". There weren't any new types created so it threw up an error. (But, if that was the case, you should have gotten an error saying there were no new types created.)

    One thing to keep in mind is that you are working with a beta version of WordPress. Something which worked ok yesterday might not work after you upgrade to a newer build.

  6. Milan Petrovic
    Member
    Posted 4 years ago #

    I am author of GD Custom Posts And Taxonomies Tools plugin, that also implements interface for custom posts and taxonomies. And I am experimenting daily with each WordPress 3.0 iteration. Some versions of WP break custom post types, or add new things into the mix. My plugins latest version is 100% compatible with latest nightly build of WP 3.0. You might wanna give it a try.

    http://wordpress.org/extend/plugins/gd-taxonomies-tools/

    But, as ronbme said, WP is still in development, and I also expect that things will break from time to time until WP 3.0 is released as final. But, I will follow every change they make to it and change plugin accordingly.

  7. Brad Williams
    Member
    Posted 4 years ago #

    Tested and I can't reproduce this error. Like others said there was probably a small bug in the nightly build. The code won't break if no custom post types or custom taxonomies exist. It just won't list anything

  8. smakdaddy
    Member
    Posted 4 years ago #

    I'm getting the same error as gambit37 using v0.5 of Custom Post Type UI and WP3.0 Beta 1.

    I get the following error as soon as i click on 'Manage Post Types'

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'cpt_manage_cpt' not found or invalid function name in [path removed]\wp-includes\plugin.php on line 395

    I do have custom post types created as the appear under the default screen .

    I also get a 404 if i click on 'Edit' for any of the custom post types that do exist.

  9. Brad Williams
    Member
    Posted 4 years ago #

    Are you both running WordPress locally? I wonder if that is causing the issue.

  10. smakdaddy
    Member
    Posted 4 years ago #

    I am running locally, using wamp. Any suggestions?

  11. Mark Barnes
    Member
    Posted 4 years ago #

    I'm getting the same error on a production server using a 3.0 nightly downloaded today. Perhaps those without the error could try a vanilla install to see if they can replicate.

  12. ronbme
    Member
    Posted 3 years ago #

    smakdaddy, I'm running locally too.
    You might want to put a copy of jquery.min.js in the same directory with the plugin. Then you'll need to edit the line in the plugin which references an external jquery.min.js file. Like this:

    // <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js">
    <script type="text/javascript" src="jquery.min.js">

    You can just comment out that first line and make a new line with what I have.

    That will allow you to view the "Advanced Options" for Custom Post Types and Taxonomies.

    Not sure why you are getting the "invalid function" error.

    mark8barnes, I just did a complete reinstall yesterday. Still not having that problem.

    One thing you and smakdaddy could check is to make sure that you have "administrator rights". If you don't, that is the problem.

    Ron

  13. Matt Hill
    Member
    Posted 3 years ago #

    I've just upgraded to a nightly build of WP3 and also upgraded to Custom POst Type UI 0.5.1 -- and I'm still getting this error. In fact, it comes up in other places now.

    I'm running locally using Wampserver 2.0 (MySQL 5.1.33, PHP 5.2.9-2) on WinXP.

    I'll do a fresh install and see if there's anything different.

  14. Matt Hill
    Member
    Posted 3 years ago #

    Fresh install makes no difference, I still get the original error:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cpt_manage_cpt' was given in F:\Projects\wp3beta\wp-includes\plugin.php on line 395

    Also, If I click EDIT next to a newly created custom post type (on the Custom Post Type main screen, the one with the Vimeo movie), I get a 404 Not found screen displayed in the 2010 theme (even though the URL is still showing I'm in the backend)

    If I try to delete a post type, I also get the original error.

    I have my permalinks set to /%posttype%/.

  15. ronbme
    Member
    Posted 3 years ago #

    gambit37,
    Why do you have your permalinks set to /%posttype%/? I would set that to /%postname%/, or just use the default until you get things working.

    Also, do you have the network option, multi sites, set up on your build?

    If you're getting a 404, it would seem that the path is not being found.

    Ron

  16. Matt Hill
    Member
    Posted 3 years ago #

    Oops, I did in fact mean /%postname%/

    No multi site stuff set up at all. It's a fresh out of the box install of WordPress 3 Beta 1 updated to yesterday's nightly build. Nothing else added or changed. CPT UI is the only plugin active.

  17. ronbme
    Member
    Posted 3 years ago #

    gambit37,
    If you just put your cursor on "Manage Post Types", you should be seeing the following at the bottom of your page:

    "/** your path **/wp-admin/admin.php?page=custom-post-type-ui/custom-post-type-ui.php_cpt_manage_cpt "

    Is that what you are seeing?

    The error is saying that it cannot find "cpt_manage_cpt" which is the function it needs.

    If you are not seeing the path that I typed, then try entering it yourself and see what you get. Type in your path and then you can paste or type the rest.

    Also, you said that you could use the "Add New" for custom types. If that worked then you should be seeing your metaboxes in the left side of the admin screen, i.e. movies, or whatever the name of your custom type was. If you don't see the metabox for your custom post type, then it was never created and "Add New" is not working.

    Ron

  18. Matt Hill
    Member
    Posted 3 years ago #

    Hi Ron, the link you asked for is:

    http://local.wp3beta/wp-admin/admin.php?page=custom-post-type-ui/custom-post-type-ui.php_cpt_manage_cpt

    Doesn't matter if I paste this manually into the browser bar, same error is generated.

    I do indeed have new Metaboxes in my left hand menu and can create and edit new posts under that category ('Portfolio' in this case).

  19. ronbme
    Member
    Posted 3 years ago #

    Hi gambit37, I've got a couple of questions.

    Have you tried just setting your permalinks to the default? That might
    help if there is a problem with the path.

    Have you looked at your site path in phpMyAdmin? Browse wp_options. The Option Name should say "siteurl" and the value should be "http://local/wp3beta". There should be no trailing slash. Is that what you get?
    BTW, why aren't you using "localhost" instead of "local"?

    My next suggestion, (if those don't work), would be to include some code at certain points to see how far you get before it fails. (And to give a backtrace to track down the problem.)

    You're not the only one having this problem, so there must be something that you all have in common.

    Ron

  20. Matt Hill
    Member
    Posted 3 years ago #

    Hi Ron

    Using default permalinks actually creates a browser error screen, not even a themed 404.

    The site path is stored in wp_options correctly.

    I use "local.nameofproject" as my own convention for domains on my local machine. Always works fine.

    Your last suggestion is a bit beyond me -- I'm a designer/front-end guy -- where would I insert this code? I think you mean I should edit the CPT UI plugin code? I'd be happy to work with the author (williamsba1) to troubleshoot this but he can't replicate this problem, so I guess we're stuck?

    Cheers.

  21. ronbme
    Member
    Posted 3 years ago #

    Hi gambit37,

    The code is:

    if ( is_wp_error($the_['function'] ) ) {
      var_dump( debug_backtrace() );
      die();
    }

    I would put it on the line right after the point where you are having the error, i.e. line 396 in wp-includes\plugin.php.

    Naturally, if there is an error there, the code will stop executing and y9ou should have a backtrace. I would copy this out somewhere so it can be examined, and so you can paste it in the forum.

    I can't reproduce the error myself. But somehow I have no problem getting constant errors in the new menu system. (Which is not ready for primetime in my opinion.)

    BTW, I noticed in the WordPress trac that they are working on some tickets that could pertain to your problem. (And also several tickets on the menu system, which could solve my problem.)

    Let me know what you find out.

    Ron

  22. Matt Hill
    Member
    Posted 3 years ago #

    I tried your suggestion but no extra info is output. Do you know where I find this 'backtrace'? Should it be output in the HTML?

  23. ronbme
    Member
    Posted 3 years ago #

    Did you get the warning when you clicked on "Manage Post Types"?

    Yes, it would have been output in the HTML.

  24. Matt Hill
    Member
    Posted 3 years ago #

    Yes, the original PHP error warning is still output, but no extra backtrace info is output.

  25. ronbme
    Member
    Posted 3 years ago #

    gambit37,

    Ok. Try this. Just list the following line right after the
    call_user_func_array line. That will probably be around line 396:

    var_dump( debug_backtrace() );

    This will definitely dump a lot of output.

    Click on "Manage Post Types" just as you did before and then I would save the whole screen of output to a text file so that you can refer to it later.

    BTW, this is not going to be in html format. (I think I misunderstood what you were asking before.) These are the instructions generated starting from call_user_func_array and working backwards, but it will give us the info we need to see where the problem is. (Hopefully!)

    We're actually looking for the call which has "cpt_manage_cpt" as part of the path.

    Ron

  26. Matt Hill
    Member
    Posted 3 years ago #

    I'll have to come back to you on this as I've ditched the plugin for now and have hand coded my custom posts stuff. Gotta get this project out the door! :-)

  27. Matt Hill
    Member
    Posted 3 years ago #

    I've also been getting similar errors using another plugin, Verve Meta Boxes. When I reported it to the author, he fixed it: "Modified code to work in environments that utilize PHP strict."

    So I wonder if Custom Post Types GUI also needs to be modified to work with PHP strict?

  28. ronbme
    Member
    Posted 3 years ago #

    So I wonder if Custom Post Types GUI also needs to be modified to work with PHP strict?

    Good question! I just read where some major changes have been made to custom post types and taxonomies. They are advising plugin authors to recheck their code.

    I think Brad will probably be checking the Custom Post Types UI plugin to see what changes are needed. Maybe he can check for the PHP strict at that time.

    Ron

  29. Fearghal Hendron
    Member
    Posted 3 years ago #

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'cpt_manage_cpt' not found or invalid function name in C:\wamp\www\wp-includes\plugin.php on line 395

    Im getting the same problem, is there a fix coming any time soon??

  30. melodian
    Member
    Posted 3 years ago #

    I'm getting the same problem.
    on php 5.3.2

    I soloved this problem ,
    when I change the position of function "cpt_manage_cpt" and "cpt_manage_taxonomies" after "function curPageURL".

Topic Closed

This topic has been closed to new replies.

About this Topic