WPIntell

Source evidence

Custom Post Types

DK PDF – WordPress PDF Generator · support · 2025-04-28T19:38:00+00:00

mixedsentiment
mediumseverity
0.78relevance
9replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 17 rows with source links

23.5% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

13 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Sea Jay resolved
On the PDF Button screen, not all post types are appearing in “Post types to apply”. Only 5 show up and we have more than that. Is there anything we need to do to get the others to appear? Hello @jcollier , Not sure why those post types are not there but you can try to use dkpdf_posts_arr filter that allows you add more post types to show the PDF Button. In the following example it adds a custom post type with slug nav_menu_item: <?php /** * Adds post type nav_menu_item in PDF Button Post types to apply */ function add_dkpdf_posts_arr( $post_arr ) { array_push( $post_arr, 'nav_menu_item' ); } add_filter( 'dkpdf_posts_arr', 'add_dkpdf_posts_arr' ); ?> I added that code to functions.php, changing nav_menu_item to my custom post type and it removed all post types from the PDF button screen. Should that code go somewhere else? @jcollier sorry my bad, the example I provided is missing the return after adding the post type. Try adding this line after the array push: return $post_arr; Try it and let me know. When I added the updated code, our resources custom post type now appears as a choice on the PDF Button tab. Thank you. However, the button is not appearing after the content on those resource posts, as it is appearing on all pages. @jcollier do you know how that custom post type is registered? or is there a way I can check that via a plugin or register post type code snippet? Here is what the plugin uses to get the post types, currently only public post types, maybe yours is private? $args = array( 'public' => true, '_builtin' => false ); $post_types = get_post_types( $args ); Hi @dinamiko The post type is registered by Pods as Public, Public Queryable, Content Visibility is Public, and User Capability is the same as Page.. Yes, please do send a code snippet that I can add to functions.php and I’ll report the results. TIA! This reply was modified 1 year ago by Sea Jay . Hi! Any update on this? The custom post type is set to public in all facets. @jcollier sorry for the delay, I’ve found why Pods post types are not displayed in “PDF Button / Post types to apply” option, in the settings code the init action has a priority of 11 which is lower that the one used by Pods, to fix it you can change the value from 11 to 20, by doing so Pods custom post types should appear correctly. I’ll include this fix in the next release, in the meantime you can change the value manually in the following file in line 20: includes/class-dkpdf-settings.php That works. Thank you so much!!!

Comments

9 shown
dinamiko 2025-05-01T09:53:00+00:00

Hello @jcollier , Not sure why those post types are not there but you can try to use dkpdf_posts_arr filter that allows you add more post types to show the PDF Button. In the following example it adds a custom post type with slug nav_menu_item: <?php /** * Adds post type nav_menu_item in PDF Button Post types to apply */ function add_dkpdf_posts_arr( $post_arr ) { array_push( $post_arr, 'nav_menu_item' ); } add_filter( 'dkpdf_posts_arr', 'add_dkpdf_posts_arr' ); ?>

Sea Jay 2025-05-02T18:10:00+00:00

I added that code to functions.php, changing nav_menu_item to my custom post type and it removed all post types from the PDF button screen. Should that code go somewhere else?

dinamiko 2025-05-04T20:44:00+00:00

@jcollier sorry my bad, the example I provided is missing the return after adding the post type. Try adding this line after the array push: return $post_arr; Try it and let me know.

Sea Jay 2025-05-06T15:50:00+00:00

When I added the updated code, our resources custom post type now appears as a choice on the PDF Button tab. Thank you. However, the button is not appearing after the content on those resource posts, as it is appearing on all pages.

dinamiko 2025-05-11T17:15:00+00:00

@jcollier do you know how that custom post type is registered? or is there a way I can check that via a plugin or register post type code snippet? Here is what the plugin uses to get the post types, currently only public post types, maybe yours is private? $args = array( 'public' => true, '_builtin' => false ); $post_types = get_post_types( $args );

Sea Jay 2025-05-12T17:52:00+00:00

Hi @dinamiko The post type is registered by Pods as Public, Public Queryable, Content Visibility is Public, and User Capability is the same as Page.. Yes, please do send a code snippet that I can add to functions.php and I’ll report the results. TIA! This reply was modified 1 year ago by Sea Jay .

Sea Jay 2025-05-22T20:22:00+00:00

Hi! Any update on this? The custom post type is set to public in all facets.

dinamiko 2025-05-25T17:42:00+00:00

@jcollier sorry for the delay, I’ve found why Pods post types are not displayed in “PDF Button / Post types to apply” option, in the settings code the init action has a priority of 11 which is lower that the one used by Pods, to fix it you can change the value from 11 to 20, by doing so Pods custom post types should appear correctly. I’ll include this fix in the next release, in the meantime you can change the value manually in the following file in line 20: includes/class-dkpdf-settings.php

Sea Jay 2025-05-27T19:08:00+00:00

That works. Thank you so much!!!