Forums

[Plugin: GD Custom Posts And Taxonomies Tools] get_post_types issue (4 posts)

  1. maorb
    Member
    Posted 2 years ago #

    Hi,

    I tried your plugin, looks great to easy use, after I did all the types with the resister_post_type function.

    Anyway, I saw there is a new functions get_post_types that returns an array for all the post_types that are registered.

    Somehow, if I register new types with the plugin, the array that returns from the get_post_types functions, does not contain these types.
    Any ideas why is that?

    Thanks,
    Maor.

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

  2. Milan Petrovic
    Member
    Posted 2 years ago #

    I will check, but I use this function in my projects with this plugin and it works fine. When are you trying to call this function, before init() in init() or after?

  3. maorb
    Member
    Posted 2 years ago #

    I've just found that function and tried to use it in functions.php of the template , assigning it to a variable and var_dumping it just for check. Didn't use it yet for something real, but thought of some things that it might be useful.
    If you say it's working fine for you, I'll be glad to know how you use it to be working.

    Thanks,
    Maor

  4. Milan Petrovic
    Member
    Posted 2 years ago #

    I tried it in several places, and it works. But it all depends when do you call it inside functions.php. All post types are registered on WordPress init action. If you try calling it before the init is run, the results will be invalid.

    Try calling this function inside the template of the theme and will work fine.

    Milan

Topic Closed

This topic has been closed to new replies.

About this Topic