Server IP : 172.67.157.199 / Your IP : 3.128.94.42 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/mu-plugins/vendor/wpex/godaddy-launch/includes/ |
Upload File : |
<?php /** * The PageMetaServiceProvider class. * * @package GoDaddy */ namespace GoDaddy\WordPress\Plugins\Launch; use GoDaddy\WordPress\Plugins\Launch\ServiceProvider; /** * PageMetaServiceProvider class. */ class PageMetaServiceProvider extends ServiceProvider { /** * This method will be used for hooking into WordPress with actions/filters. * * @return void */ public function boot() { include_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( ! is_plugin_active( 'wordpress-seo/wp-seo.php' ) ) { add_filter( 'pre_get_document_title', array( $this, 'filter_document_title' ) ); add_action( 'wp_head', array( $this, 'add_meta_tags' ) ); } } /** * This method will be used to bind things to the container. * * @return void */ public function register() {} /** * Filters the document title. * * @param string $title The document title. Default empty string. * * @return string The document title. */ public function filter_document_title( $title ) { $post_meta_title = get_post_meta( get_the_ID(), '_yoast_wpseo_title', true ); if ( ! empty( $post_meta_title ) ) { return $post_meta_title; } return $title; } /** * Prints data in the head tag on the front end. */ public function add_meta_tags() { $post_meta_description = get_post_meta( get_the_ID(), '_yoast_wpseo_metadesc', true ); if ( ! empty( $post_meta_description ) ) { echo '<meta name="description" content="' . esc_attr( $post_meta_description ) . '">' . PHP_EOL; } } }