$label"; else : $link_out = "$label"; endif; if ( !empty($textarea) ) : $field_out = ""; else : $field_out = ""; endif; if ( !empty($help) ) : $help_out = " $help "; else : $help_out = ""; endif; // Put table to the variable $out = " $link_out $field_out $help_out"; // Print the generated table echo $out; } /** * Generate the Meta Tags * * @since 3.8 */ function allmetatags_add_meta_tags() { // Read options from BD, sanitiz data and declare variables $options = get_option( 'allmetatags_settings' ); $google = esc_textarea( $options['google'] ); $bing = esc_textarea( $options['bing'] ); $yandex = esc_textarea( $options['yandex'] ); $alexa = esc_textarea( $options['alexa'] ); $pinterest = esc_textarea( $options['pinterest'] ); $google_author = esc_textarea( $options['google_author'] ); $facebook = esc_textarea( $options['facebook'] ); $twitter = esc_textarea( $options['twitter'] ); $norton = esc_textarea( $options['norton'] ); $wot = esc_textarea( $options['wot'] ); $specificfeeds = esc_textarea( $options['specificfeeds'] ); $custom_meta = $options['custom_meta']; $home_description = esc_textarea( $options['home_description'] ); $home_keywords = esc_textarea( $options['home_keywords'] ); $blog_description = esc_textarea( $options['blog_description'] ); $blog_keywords = esc_textarea( $options['blog_keywords'] ); $author = esc_textarea( $options['author'] ); $designer = esc_textarea( $options['designer'] ); $contact = esc_textarea( $options['contact'] ); $copyright = esc_textarea( $options['copyright'] ); $keywords = esc_textarea( $options['keywords'] ); $metatags_arr[] = ""; // Web Master Tools if (!empty($google)) { $metatags_arr[] = ""; } if (!empty($yandex)) { $metatags_arr[] = ""; } if (!empty($bing)) { $metatags_arr[] = ""; } // Website Verification Services if (!empty($pinterest)) { $metatags_arr[] = ""; } if (!empty($google_author)) { $metatags_arr[] = ""; } if (!empty($facebook)) { $metatags_arr[] = ""; } if (!empty($twitter)) { $metatags_arr[] = ""; $metatags_arr[] = ""; } if (!empty($alexa)) { $metatags_arr[] = ""; } if (!empty($norton)) { $metatags_arr[] = ""; } if (!empty($wot)) { $metatags_arr[] = ""; } if (!empty($specificfeeds)) { $metatags_arr[] = ""; } if (!empty($custom_meta)) { $metatags_arr[] = $custom_meta; } // Meta Tags for specific pages if ( is_front_page() && is_home() ) { // Default Home Page if (!empty($home_description)) { $metatags_arr[] = ""; } if (!empty($home_keywords)) { $metatags_arr[] = ""; } } elseif ( is_front_page() ) { // Static Home Page if (!empty($home_description)) { $metatags_arr[] = ""; } if (!empty($home_keywords)) { $metatags_arr[] = ""; } } elseif ( is_home() ) { // Blog Page if (!empty($home_description)) { $metatags_arr[] = ""; } if (!empty($home_keywords)) { $metatags_arr[] = ""; } } // Meta Tags for all website if (!empty($author)) { $metatags_arr[] = ""; } if (!empty($designer)) { $metatags_arr[] = ""; } if (!empty($contact)) { $metatags_arr[] = ""; } if (!empty($copyright)) { $metatags_arr[] = ""; } if (!empty($keywords)) { $metatags_arr[] = ""; } // WooCommerce & Google Shopping (Merchant Center) if ( class_exists( 'WooCommerce' ) ) { if ( is_product() ) { $name = get_the_title(); $description = 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(); $google_shopping = "
"; $metatags_arr[] = $google_shopping; } } // Add comment if ( count( $metatags_arr ) > 0 ) { array_unshift( $metatags_arr, "" ); array_push( $metatags_arr, "" ); } // Return the content of array return $metatags_arr; } /** * Include the Meta Tags in head area * * @since 1.0 */ function allmetatags_add_metadata_head() { echo PHP_EOL, implode(PHP_EOL, allmetatags_add_meta_tags()), PHP_EOL, PHP_EOL; } add_action( 'wp_head', 'allmetatags_add_metadata_head', 0 );