ral.attachment_redirect_default' ); /** * Redirect atachment to its parent post. * * @param string $redirect URL as calculated for redirection. * @param WP_Post $post Current post instance. */ Helper::redirect( $this->do_filter( 'frontend/attachment/redirect_url', $redirect, $post ), 301 ); exit; } /** * Redirect date & author archives if the setting is enabled. */ public function archive_redirect() { global $wp_query; if ( ( Helper::get_settings( 'titles.disable_date_archives' ) && $wp_query->is_date ) || ( true === Helper::get_settings( 'titles.disable_author_archives' ) && $wp_query->is_author ) ) { Helper::redirect( get_bloginfo( 'url' ), 301 ); exit; } } /** * Adds the RSS header and footer messages to the RSS feed item content. * * @param string $content Feed item content. * * @return string */ public function embed_rssfooter( $content ) { return $this->embed_rss( $content, 'full' ); } /** * Adds the RSS header and footer messages to the RSS feed item excerpt. * * @param string $content Feed item excerpt. * * @return string */ public function embed_rssfooter_excerpt( $content ) { return $this->embed_rss( $content, 'excerpt' ); } /** * Add data-ampdevmode attribute to enqueued scripts. * * @since 1.0.45 * * @param string $tag The script tag. * @param string $handle The script handle. * * @return string Modified script tag. */ public function add_amp_dev_mode_attributes( $tag, $handle ) { if ( ! in_array( $handle, [ 'rank-math', 'jquery-core', 'jquery-migrate' ], true ) ) { return $tag; } return preg_replace( '/(?<=)/i', ' data-ampdevmode', $tag ); } /** * Add data-ampdevmode attributes to the elements that need it. * * @since 1.0.45 * * @param string[] $xpaths XPath queries for elements that should get the data-ampdevmode attribute. * * @return string[] XPath queries. */ public function add_amp_dev_mode_xpaths( $xpaths ) { $xpaths[] = '//script[ contains( text(), "var rankMath" ) ]'; $xpaths[] = '//*[ @id = "rank-math-css" ]'; $xpaths[] = '//a[starts-with(@href, "tel://")]'; return $xpaths; } /** * Inserts the RSS header and footer messages in the RSS feed item. * * @param string $content Feed item content. * @param string $context Feed item context, 'excerpt' or 'full'. * * @return string */ private function embed_rss( $content, $context = 'full' ) { if ( false === $this->can_embed_footer( $content, $context ) ) { return $content; } $before = $this->get_rss_content( 'before' ); $after = $this->get_rss_content( 'after' ); if ( '' === $before && '' === $after ) { return $content; } if ( 'excerpt' === $context && '' !== trim( $content ) ) { $content = wpautop( $content ); } return $before . $content . $after; } /** * Check if we can add the RSS footer and/or header to the RSS feed item. * * @copyright Copyright (C) 2008-2019, Yoast BV * The following code is a derivative work of the code from the Yoast(https://github.com/Yoast/wordpress-seo/), which is licensed under GPL v3. * * @param string $content Feed item content. * @param string $context Feed item context, either 'excerpt' or 'full'. * * @return bool */ private function can_embed_footer( $content, $context ) { /** * Allow the RSS footer to be dynamically shown/hidden. * * @param bool $show_embed Indicates if the RSS footer should be shown or not. * @param string $context The context of the RSS content - 'full' or 'excerpt'. */ if ( false === $this->do_filter( 'frontend/rss/include_footer', true, $context ) ) { return false; } return is_feed(); } /** * Get RSS content for specified location. * * @param string $which Location ID. * * @return string */ private function get_rss_content( $which ) { $content = $this->do_filter( 'frontend/rss/' . $which . '_content', Helper::get_settings( 'general.rss_' . $which . '_content' ) ); return '' !== $content ? wpautop( $this->rss_replace_vars( $content ) ) : $content; } /** * Replace variables with the actual values in RSS header and footer messages. * * @param string $content The RSS content. * * @return string */ private function rss_replace_vars( $content ) { global $post; /** * Add nofollow for the links in the RSS header and footer messages. Default: true. * * @param bool $unsigned Whether or not to follow the links in RSS feed, defaults to true. */ $no_follow = $this->do_filter( 'frontend/rss/nofollow_links', true ); $no_follow = true === $no_follow ? 'rel="nofollow" ' : ''; $author_link = ''; if ( is_object( $post ) ) { $author_link = '' . esc_html( get_the_author() ) . ''; } $post_link = '' . esc_html( get_the_title() ) . ''; $blog_link = '' . esc_html( get_bloginfo( 'name' ) ) . ''; $blog_desc_link = '' . esc_html( get_bloginfo( 'name' ) ) . ' - ' . esc_html( get_bloginfo( 'description' ) ) . ''; // Featured image. $image = Helper::get_thumbnail_with_fallback( $post->ID, 'full' ); $image = isset( $image[0] ) ? '' : ''; $content = stripslashes( trim( $content ) ); $content = str_replace( '%AUTHORLINK%', $author_link, $content ); $content = str_replace( '%POSTLINK%', $post_link, $content ); $content = str_replace( '%BLOGLINK%', $blog_link, $content ); $content = str_replace( '%BLOGDESCLINK%', $blog_desc_link, $content ); $content = str_replace( '%FEATUREDIMAGE%', $image, $content ); return $content; } }
Fatal error: Uncaught Error: Class 'RankMath\Frontend\Frontend' not found in /home/mpir1/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php:375 Stack trace: #0 /home/mpir1/public_html/wp-includes/class-wp-hook.php(308): RankMath->init_frontend('') #1 /home/mpir1/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array) #2 /home/mpir1/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /home/mpir1/public_html/wp-settings.php(480): do_action('plugins_loaded') #4 /home/mpir1/public_html/wp-config.php(90): require_once('/home/mpir1/pub...') #5 /home/mpir1/public_html/wp-load.php(50): require_once('/home/mpir1/pub...') #6 /home/mpir1/public_html/wp-blog-header.php(13): require_once('/home/mpir1/pub...') #7 /home/mpir1/public_html/index.php(17): require('/home/mpir1/pub...') #8 {main} thrown in /home/mpir1/public_html/wp-content/plugins/seo-by-rank-math/rank-math.php on line 375