• Resolved dsienko

    (@dsienko)


    Here’s the log that I’m getting causing the error.

    Fatal error:  /home2/tulalipl/public_html/wp-content/themes/the-language-of-puget-sound/functions.php on line 233

    Here’s the code section. Starting with Line 232

    function my_cptui_featured_image_support() {
    $cptui_post_types = cptui_get_post_type_slugs();
    add_theme_support( ‘post-thumbnails’, $cptui_post_types );
    }
    add_action( ‘after_setup_theme’, ‘my_cptui_featured_image_support’ );

    • This topic was modified 1 year ago by dsienko.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not seeing the actual error here, just that there is one and the sources.

    I know we have a very similar function at https://github.com/WebDevStudios/custom-post-type-ui/blob/1.14.0/inc/utility.php#L1006-L1024 but that’s from the plugin, not your theme.

    I also know we have this change https://github.com/WebDevStudios/custom-post-type-ui/commit/97e1977ce0633431dd21d282c261c089db0c8e49 pending release on Monday, with regards to PHP8 compatibility.

    My guess is your error is null being used incorrectly with an in_array() check?

    Thread Starter dsienko

    (@dsienko)

    Here’s the full error message. Though it sounds like I should wait for the release on Monday and see if that fixes the problem.


    Fatal error: Uncaught Error: Call to undefined function cptui_get_post_type_slugs() in /home2/tulalipl/public_html/wp-content/themes/the-language-of-puget-sound/functions.php:233 Stack trace: #0 /home2/tulalipl/public_html/wp-includes/class-wp-hook.php(310): my_cptui_featured_image_support(”) #1 /home2/tulalipl/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #2 /home2/tulalipl/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /home2/tulalipl/public_html/wp-settings.php(610): do_action(‘after_setup_the…’) #4 /home2/tulalipl/public_html/wp-config.php(91): require_once(‘/home2/tulalipl…’) #5 /home2/tulalipl/public_html/wp-load.php(50): require_once(‘/home2/tulalipl…’) #6 /home2/tulalipl/public_html/wp-blog-header.php(13): require_once(‘/home2/tulalipl…’) #7 /home2/tulalipl/public_html/index.php(17): require(‘/home2/tulalipl…’) #8 {main} thrown in /home2/tulalipl/public_html/wp-content/themes/the-language-of-puget-sound/functions.php on line 233

    Thinking out it though, the custom post type doesn’t use any images, just audio.

    • This reply was modified 1 year ago by dsienko.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    No, the error I fixed with that commit is different. For whatever reason, your version of the code isn’t finding the cptui_get_post_type_slugs() function for some reason.

    That said, since we have essentially have matching code to what you’re trying, in the plugin, yours shouldn’t be needed.

    Thread Starter dsienko

    (@dsienko)

    So I should comment out, that function from my functions.php file?

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You should be able to remove all of this:

    function my_cptui_featured_image_support() {
    	$cptui_post_types = cptui_get_post_type_slugs();
    	add_theme_support( ‘post-thumbnails’, $cptui_post_types );
    }
    add_action( ‘after_setup_theme’, ‘my_cptui_featured_image_support’ );
    Thread Starter dsienko

    (@dsienko)

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Fatal Error in Functions php points to cptui’ is closed to new replies.