Saturday, October 15, 2022
HomeWordPress Developmentphotographs - Uncaught Error: Name to undefined perform file_is_valid_image()

photographs – Uncaught Error: Name to undefined perform file_is_valid_image()


That is the perform doc. However once I ran the under I get Uncaught Error: Name to undefined perform file_is_valid_image()

    $json_file = get_post_meta( $listing->ID, '_json_file', true );
    $thumbnail_id = get_post_meta( $listing->ID, '_thumbnail_id', true );
    $image_file = get_post_meta( $thumbnail_id, '_wp_attached_file', true );

    //DEBUG
    error_log( "path: " .  $upload_basedir . "https://wordpress.stackexchange.com/" . $image_file );
    error_log(" path2: " . $upload_basedir . "https://wordpress.stackexchange.com/" . $json_file );
    
    if ( file_is_valid_image( $upload_basedir . "https://wordpress.stackexchange.com/" . $image_file ) ) {
        error_log("Picture Legitimate");
    }

My file path is like C:laragonwwwtest/wp-content/uploads/2022/10/placeholder.png

UPDATE: Okay, I believe the error is because of the truth that I fired it too early. However how I gradual it down? My add_action( 'after_setup_theme', 'mytheme_setup' ); is already on prime of my capabilities.php

And btw, I am operating the code above as WP cron.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments