• Currently the image handling does the following

    $the_images = array();
    if ( we find images in the post ) {
       - add to $the_images
    }
    else if ( $the_images is empty ) {
       - grab image attachments if any
    }
    else {
       - use default
    }

    The issue with this is that the block of code in the final else clause is never called because the ‘else if’ block will be true if the first ‘if’ fails. I would even suggest the ‘else if’ block in some cases could fail. The code would be better if it were:

    $the_images = array();
    if ( preg_match_all('/<img (.+?)>/', $post->post_content, $matches) ) { // Gets the images in the post content
    ...
    }
    if (empty($the_images)) {   // Gets the image uploaded in the gallery
    ...
    }
    if (empty($the_images)) { // Use default
    ...
    }

    http://wordpress.org/extend/plugins/facebook-revised-open-graph-meta-tag/

  • The topic ‘[Plugin: Facebook Revised Open Graph Meta Tag] Fix default image handling’ is closed to new replies.