Getting arguments for register_post_type from a plugin generated post type

I’ve taken over website from another developer and they used a plugin to generate a custom post type. The plugin is no l

I’ve taken over website from another developer and they used a plugin to generate a custom post type. The plugin is no longer maintained and is causing an error 505 when try and load the plugins admin page. The front end site works fine.

So I was wondering if there was anyway to get arguments for use in register_post_type() for the post type that is generated by the plugin so that don't have to use the plugin? The plugin still works it's just it courses and error 505 on plugins admin page, all plugin pages work but unfortunately there is no export option for that can be used to give me arguments for register_post_type().

The plugin is Toolset Types if that helps

I’ve taken over website from another developer and they used a plugin to generate a custom post type. The plugin is no longer maintained and is causing an error 505 when try and load the plugins admin page. The front end site works fine.

So I was wondering if there was anyway to get arguments for use in register_post_type() for the post type that is generated by the plugin so that don't have to use the plugin? The plugin still works it's just it courses and error 505 on plugins admin page, all plugin pages work but unfortunately there is no export option for that can be used to give me arguments for register_post_type().

The plugin is Toolset Types if that helps

Share Improve this question edited Apr 11, 2019 at 17:36 Qaisar Feroz 2,1471 gold badge9 silver badges20 bronze badges asked Apr 11, 2019 at 15:49 lomokevlomokev 1831 gold badge2 silver badges10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

So I was wondering if there was anyway to get arguments for use in register_post_type for the post type that is generated by the plugin so that don't have to use the plugin?

You can use get_post_type_object( string $post_type ). See Documentation and example usage here.

$obj = get_post_type_object( 'certification' );

print_r( $obj ); 

Above code might return something like this, so you can get the arguments used by register_post_type ():

stdClass Object
(
    [labels] => stdClass Object
        (
            [name] => Certification
            [singular_name] => Certification
            [add_new] => Add New
            [add_new_item] => Add New Certification
            [edit_item] => Edit Certification
            [new_item] => New Page
            [view_item] => View Certification
            [search_items] => Search Certification
            [not_found] => Not found
            [not_found_in_trash] => Not found in Trash
            [parent_item_colon] => Parent Certification:
            [all_items] => All Certifications
            [menu_name] => Certifications
            [update_item] => Update Certification
            [name_admin_bar] => Certification
        )
    [description] => Certifications
    [public] => 1
    [hierarchical] => 1
    [exclude_from_search] => 
    [publicly_queryable] => 1
    [show_ui] => 1
    [show_in_menu] => 
    [show_in_nav_menus] => 1
    [show_in_admin_bar] => 1
    [menu_position] => 5
    [menu_icon] => dashicons-welcome-widgets-menus
    [capability_type] => post
    [map_meta_cap] => 1
    [register_meta_box_cb] => 
    [taxonomies] => Array
        (
            [0] => objective
        )
    [has_archive] => 1
    [rewrite] => Array
        (
            [slug] => certification
            [with_front] => 1
            [pages] => 1
            [feeds] => 1
            [ep_mask] => 1
        )
    [query_var] => certification
    [can_export] => 1
    [delete_with_user] => 
    [_builtin] => 
    [_edit_link] => post.php?post=%d
    [label] => Certification
    [name] => certification
    [cap] => stdClass Object
        (
            [edit_post] => edit_post
            [read_post] => read_post
            [delete_post] => delete_post
            [edit_posts] => edit_posts
            [edit_others_posts] => edit_others_posts
            [publish_posts] => publish_posts
            [read_private_posts] => read_private_posts
            [read] => read
            [delete_posts] => delete_posts
            [delete_private_posts] => delete_private_posts
            [delete_published_posts] => delete_published_posts
            [delete_others_posts] => delete_others_posts
            [edit_private_posts] => edit_private_posts
            [edit_published_posts] => edit_published_posts
            [create_posts] => edit_posts
        )
)

I hope this may helps.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745598509a4635261.html

相关推荐

  • Getting arguments for register_post_type from a plugin generated post type

    I’ve taken over website from another developer and they used a plugin to generate a custom post type. The plugin is no l

    12小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信