• Resolved garikaib

    (@garikaib)


    First of all thank you for an awesome plugin and service. It works like a charm and is easy to configure.

    However, I am having issues on one of my sites using custom posts. On one of the sites the send Webpushr notification checkbox does not even appear in Document settings but it appears and works on normal built-in posts.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author webpushr

    (@webpushr)

    Can you please check if the name of the custom post is added to “Post Type” field in our plugin’s configuration page. If not, then that should fix it. If you have already added the name, then read on.

    The plugin should work with the custom posts. How did you create this custom post? Was it hand coded by you or did you use some type of a plugin?

    We tested with a custom post type called “poems” (code below) and it works fine. Please respond back here if you are able to resolve.

    function cptui_register_my_cpts_poem() {
    
    /**
    * Post Type: poems.
    */
    
    $labels = [
    "name" => __( "poems", "twentynineteen" ),
    "singular_name" => __( "poem", "twentynineteen" ),
    ];
    
    $args = [
    "label" => __( "poems", "twentynineteen" ),
    "labels" => $labels,
    "description" => "",
    "public" => true,
    "publicly_queryable" => true,
    "show_ui" => true,
    "show_in_rest" => true,
    "rest_base" => "",
    "rest_controller_class" => "WP_REST_Posts_Controller",
    "has_archive" => false,
    "show_in_menu" => true,
    "show_in_nav_menus" => true,
    "delete_with_user" => false,
    "exclude_from_search" => false,
    "capability_type" => "post",
    "map_meta_cap" => true,
    "hierarchical" => false,
    "rewrite" => [ "slug" => "poem", "with_front" => true ],
    "query_var" => true,
    "supports" => [ "title", "editor", "thumbnail" ],
    ];
    
    register_post_type( "poem", $args );
    }
    
    add_action( 'init', 'cptui_register_my_cpts_poem' );
    • This reply was modified 4 years, 9 months ago by webpushr.
    Plugin Author webpushr

    (@webpushr)

    Also, please make sure the name of the custom post is added to “Post Type” field in our plugin’s configuration page.

    Thread Starter garikaib

    (@garikaib)

    It was the Post Type in the configuration that did it. It appears I had not enabled it for the post type I wanted. Sorry for the trouble and thanks for the patience and fix.

    Plugin Author webpushr

    (@webpushr)

    Happy to help. Have a good day.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Not working with custom posts’ is closed to new replies.