"; } if ( ! empty( $options['yandex'] ) ) { $array[] = ""; } if ( ! empty( $options['bing'] ) ) { $array[] = ""; } // Website Verification Services if ( ! empty( $options['pinterest'] ) ) { $array[] = ""; } if ( ! empty( $options['google_author'] ) ) { $array[] = ""; } if ( ! empty( $options['facebook'] ) ) { $array[] = ""; } if ( ! empty( $options['twitter'] ) ) { $array[] = ""; $array[] = ""; } if ( ! empty( $options['alexa'] ) ) { $array[] = ""; } if ( ! empty( $options['norton'] ) ) { $array[] = ""; } if ( ! empty( $options['wot'] ) ) { $array[] = ""; } if ( ! empty( $options['specificfeeds'] ) ) { $array[] = ""; } if ( ! empty( $options['custom_meta'] ) ) { $array[] = $options['custom_meta']; } // Custom meta tags for specific pages if ( is_front_page() && is_home() ) { // Default Home Page if ( ! empty( $options['blog_description'] ) ) { $array[] = ""; } if ( ! empty( $options['blog_keywords'] ) ) { $array[] = ""; } } elseif ( is_front_page() ) { // Static Home Page if ( ! empty( $options['home_description'] ) ) { $array[] = ""; } if ( ! empty( $options['home_keywords'] ) ) { $array[] = ""; } } elseif ( is_home() ) { // Blog Page if ( ! empty( $options['blog_description'] ) ) { $array[] = ""; } if ( ! empty( $options['blog_keywords'] ) ) { $array[] = ""; } } // Custom meta tags for the entire website if ( ! empty( $options['author'] ) ) { $array[] = ""; } if ( ! empty( $options['designer'] ) ) { $array[] = ""; } if ( ! empty( $options['contact'] ) ) { $array[] = ""; } if ( ! empty( $options['copyright'] ) ) { $array[] = ""; } if ( ! empty( $options['keywords'] ) ) { $array[] = ""; } // WooCommerce & Google Shopping (Merchant Center) if ( class_exists( 'WooCommerce' ) ) { if ( is_product() ) { // Get product data $name = str_replace( "'", "’", strip_tags( get_the_title() ) ); $description = str_replace( "'", "’", strip_tags( get_the_excerpt() ) ); $image = simplexml_load_string( get_the_post_thumbnail() ); if ( ! empty( $image ) ) { $imagesrc = $image->attributes()->src; } else { $imagesrc = ""; } $price = get_post_meta( get_the_ID(), '_price', true ); $currency = get_woocommerce_currency(); // Generate output code with product data $google_shopping = "
"; $array[] = $google_shopping; } } // Add comment if ( count( $array ) > 0 ) { array_unshift( $array, "" ); array_push( $array, "" ); } // Return the processed data return $array; } /** * Process the custom meta tags * @return string by using "echo" */ function spacexchimp_p004_exec() { echo PHP_EOL, implode(PHP_EOL, spacexchimp_p004_generator()), PHP_EOL, PHP_EOL; } /** * Inject the custom meta tags into the website's frontend (head section) */ add_action( 'wp_head', 'spacexchimp_p004_exec', 0 ); /** * Preview the custom meta tags * @return string by using "echo" */ function spacexchimp_p004_preview() { $array = spacexchimp_p004_generator(); if ( ! empty( $array ) ) { if ( is_array( $array ) ) { if ( count( $array ) > 0 ) { array_shift( $array ); } if ( count( $array ) > 0 ) { array_pop( $array ); } if ( count( $array ) > 0 ) { $array = implode( PHP_EOL, $array ); } } } // Return the processed data echo $array; }