/i', do_shortcode($post->post_content), $matches); // array containing empty value could not be checked by empty(), so first empty value should be removed, then checked //http://stackoverflow.com/questions/2216052/how-to-tell-if-a-php-array-is-empty // remove all empty value or array from $matches variable. otherwise, Notice: Undefined offset: 0 is shown. foreach ($matches as $key => $value) { if (empty($value)) { unset($matches[$key]); } } if ( !empty($matches) ) { $first_img = $matches[1][0]; } //if(empty($first_img)) { // $first_img = APS_PLUGIN_URI .'/img/featured_image_placeholder.jpg'; //} return $first_img; } /** * Check if required version of WordPress is installed or not * @param $required_version Required WordPress version * * @return boolean true or false */ function aps_check_min_wp_version($required_version) { include( ABSPATH . WPINC . '/version.php' ); // get an unmodified $wp_version return ( version_compare( $wp_version, $required_version, '<' ) ); } /** * Show warning to the user if unsupported wp version is used * @param $min_wp_version | Minimum required wp version. * */ function aps_warn_if_unsupported_wp() { $wp_ver = ! empty( $GLOBALS['wp_version'] ) ? $GLOBALS['wp_version'] : '(undefined)'; ?>
upgrade your WordPress Version'; ?>