Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/accelera.../template...
File: features.php
if(isset($get_meta_excerpt)){
[1500] Fix | Delete
$desc = $get_meta_excerpt;
[1501] Fix | Delete
}
[1502] Fix | Delete
if ( ! is_string( $desc ) || ( is_string( $desc ) && $desc === '' ) ) {
[1503] Fix | Delete
$post_content = get_post(ampforwp_get_the_ID())->post_content;
[1504] Fix | Delete
$desc = wp_trim_words( strip_shortcodes( $post_content ) , 15 );
[1505] Fix | Delete
}
[1506] Fix | Delete
}
[1507] Fix | Delete
return $desc;
[1508] Fix | Delete
}
[1509] Fix | Delete
function ampforwp_custom_yoast_meta_homepage(){
[1510] Fix | Delete
if ( 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && ampforwp_get_setting('ampforwp-seo-yoast-meta') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
[1511] Fix | Delete
if ( class_exists('WPSEO_Options')) {
[1512] Fix | Delete
if( method_exists('WPSEO_Options', 'get_option')){
[1513] Fix | Delete
$options = WPSEO_Options::get_option( 'wpseo_social' );
[1514] Fix | Delete
if ( $options['twitter'] === true ) {
[1515] Fix | Delete
WPSEO_Twitter::get_instance();
[1516] Fix | Delete
}
[1517] Fix | Delete
if ( $options['opengraph'] === true ) {
[1518] Fix | Delete
$GLOBALS['wpseo_og'] = new WPSEO_OpenGraph;
[1519] Fix | Delete
}
[1520] Fix | Delete
}
[1521] Fix | Delete
}
[1522] Fix | Delete
do_action( 'wpseo_opengraph' );
[1523] Fix | Delete
}
[1524] Fix | Delete
}
[1525] Fix | Delete
[1526] Fix | Delete
// Title
[1527] Fix | Delete
function ampforwp_yoast_opengraph_title($title){
[1528] Fix | Delete
$new_title = ampforwp_yoast_social_title('og');
[1529] Fix | Delete
if(!empty($new_title)){
[1530] Fix | Delete
$title = $new_title;
[1531] Fix | Delete
}
[1532] Fix | Delete
return $title;
[1533] Fix | Delete
}
[1534] Fix | Delete
function ampforwp_yoast_twitter_title($title){
[1535] Fix | Delete
$new_title = ampforwp_yoast_social_title('twitter');
[1536] Fix | Delete
if(!empty($new_title)){
[1537] Fix | Delete
$title = $new_title;
[1538] Fix | Delete
}
[1539] Fix | Delete
return $title;
[1540] Fix | Delete
}
[1541] Fix | Delete
[1542] Fix | Delete
function ampforwp_yoast_social_title($type) {
[1543] Fix | Delete
//Added the opengraph for frontpage in AMP #2454
[1544] Fix | Delete
if(ampforwp_is_front_page() || ampforwp_is_blog() ){
[1545] Fix | Delete
$title = $page_id = $post = '';
[1546] Fix | Delete
$page_id = ampforwp_get_the_ID();
[1547] Fix | Delete
if( 'og' == $type ) {
[1548] Fix | Delete
$title = WPSEO_Meta::get_value( 'opengraph-title', $page_id );
[1549] Fix | Delete
}
[1550] Fix | Delete
if( 'twitter' == $type ) {
[1551] Fix | Delete
$title = WPSEO_Meta::get_value('twitter-title',$page_id );
[1552] Fix | Delete
}
[1553] Fix | Delete
if (empty($title) ){
[1554] Fix | Delete
$title .= get_post_meta($page_id, '_yoast_wpseo_title', true);
[1555] Fix | Delete
$title = wpseo_replace_vars( $title,$post );
[1556] Fix | Delete
}
[1557] Fix | Delete
if (empty($title) ){
[1558] Fix | Delete
$title = get_the_title($page_id);
[1559] Fix | Delete
}
[1560] Fix | Delete
return esc_attr($title);
[1561] Fix | Delete
}
[1562] Fix | Delete
return esc_attr( get_bloginfo( 'name' ) );
[1563] Fix | Delete
}
[1564] Fix | Delete
// Description
[1565] Fix | Delete
function ampforwp_yoast_opengraph_desc($desc){
[1566] Fix | Delete
if ( ampforwp_yoast_social_desc('og') ){
[1567] Fix | Delete
$desc = ampforwp_yoast_social_desc('og');
[1568] Fix | Delete
}
[1569] Fix | Delete
return $desc;
[1570] Fix | Delete
}
[1571] Fix | Delete
function ampforwp_yoast_twitter_desc($desc){
[1572] Fix | Delete
if ( ampforwp_yoast_social_desc('twitter') ){
[1573] Fix | Delete
$desc = ampforwp_yoast_social_desc('twitter');
[1574] Fix | Delete
}
[1575] Fix | Delete
return $desc;
[1576] Fix | Delete
}
[1577] Fix | Delete
function ampforwp_yoast_social_desc($type) {
[1578] Fix | Delete
if(ampforwp_is_front_page() || ampforwp_is_blog()){
[1579] Fix | Delete
$desc = $page_id = '';
[1580] Fix | Delete
$page_id = ampforwp_get_the_ID();
[1581] Fix | Delete
if ( 'og' == $type ) {
[1582] Fix | Delete
$desc = trim( WPSEO_Meta::get_value( 'opengraph-description', $page_id ) );
[1583] Fix | Delete
}
[1584] Fix | Delete
if ( 'twitter' == $type ) {
[1585] Fix | Delete
$desc = trim( WPSEO_Meta::get_value( 'twitter-description', $page_id ) );
[1586] Fix | Delete
}
[1587] Fix | Delete
if (empty($desc) ){
[1588] Fix | Delete
$desc = get_post_meta($page_id, '_yoast_wpseo_metadesc', true);
[1589] Fix | Delete
}
[1590] Fix | Delete
if (empty($desc)){
[1591] Fix | Delete
$desc = wp_trim_words(get_post_field('post_content', $page_id), 26);
[1592] Fix | Delete
}
[1593] Fix | Delete
return esc_attr($desc);
[1594] Fix | Delete
}
[1595] Fix | Delete
return esc_attr( get_bloginfo( 'description' ) );
[1596] Fix | Delete
}
[1597] Fix | Delete
function ampforwp_custom_og_url_homepage() {
[1598] Fix | Delete
return esc_url( get_bloginfo( 'url' ) );
[1599] Fix | Delete
}
[1600] Fix | Delete
function ampforwp_custom_twitter_image_homepage(){
[1601] Fix | Delete
$twitter = $WPSEO_get = '';
[1602] Fix | Delete
$WPSEO_Options = WPSEO_Options::get_instance();
[1603] Fix | Delete
if( method_exists($WPSEO_Options, 'get') ){
[1604] Fix | Delete
$WPSEO_get = WPSEO_Options::get( 'twitter_site', '' );
[1605] Fix | Delete
}
[1606] Fix | Delete
if ( ampforwp_get_the_ID() ) {
[1607] Fix | Delete
$post_id = ampforwp_get_the_ID();
[1608] Fix | Delete
$post = get_post($post_id);
[1609] Fix | Delete
// twitter:image
[1610] Fix | Delete
$img = WPSEO_Meta::get_value('twitter-image', $post_id );
[1611] Fix | Delete
if ( $img !== '' ) {
[1612] Fix | Delete
$metatag_key = apply_filters( 'wpseo_twitter_metatag_key', 'name' );
[1613] Fix | Delete
$name = 'image';
[1614] Fix | Delete
$value = esc_url($img);
[1615] Fix | Delete
// Output meta.
[1616] Fix | Delete
echo '<meta ', esc_attr( $metatag_key ), '="twitter:', esc_attr( $name ), '" content="', $value, '" />', "\n";
[1617] Fix | Delete
}
[1618] Fix | Delete
// twitter:creator
[1619] Fix | Delete
$twitter = ltrim( trim( get_the_author_meta( 'twitter', $post->post_author ) ), '@' );
[1620] Fix | Delete
$twitter = apply_filters( 'wpseo_twitter_creator_account', $twitter );
[1621] Fix | Delete
}
[1622] Fix | Delete
if ( is_string( $twitter ) && $twitter !== '' ) {
[1623] Fix | Delete
echo '<meta ', esc_attr( 'name' ), '="twitter:', esc_attr( 'creator' ), '" content="','@' . esc_attr($twitter), '" />', "\n";
[1624] Fix | Delete
}
[1625] Fix | Delete
elseif ( $WPSEO_get !== '' && is_string( $WPSEO_get ) ) {
[1626] Fix | Delete
echo '<meta ', esc_attr( 'name' ), '="twitter:', esc_attr( 'creator'), '" content="', '@' . esc_attr(WPSEO_Options::get( 'twitter_site' )), '" />', "\n";
[1627] Fix | Delete
}
[1628] Fix | Delete
}
[1629] Fix | Delete
function ampforwp_custom_og_image_homepage() {
[1630] Fix | Delete
if ( class_exists('WPSEO_Options') ) {
[1631] Fix | Delete
global $wpseo_og;
[1632] Fix | Delete
$post_id = ampforwp_get_frontpage_id();
[1633] Fix | Delete
$image_url = WPSEO_Meta::get_value( 'opengraph-image', $post_id );
[1634] Fix | Delete
$image_id = WPSEO_Meta::get_value( 'opengraph-image-id', $post_id );
[1635] Fix | Delete
$image = wp_get_attachment_image_src($image_id,'full');
[1636] Fix | Delete
$image_tags = array();
[1637] Fix | Delete
if(is_array($image)){
[1638] Fix | Delete
$image_tags = array(
[1639] Fix | Delete
'width' => esc_attr(isset($image[1]) ? $image[1] : '750'),
[1640] Fix | Delete
'height' => esc_attr(isset($image[2]) ? $image[2] : '500'),
[1641] Fix | Delete
);
[1642] Fix | Delete
}else{
[1643] Fix | Delete
$image_tags = array(
[1644] Fix | Delete
'width' => '750',
[1645] Fix | Delete
'height' => '500',
[1646] Fix | Delete
);
[1647] Fix | Delete
}
[1648] Fix | Delete
[1649] Fix | Delete
if ( method_exists($wpseo_og, 'og_tag') ) {
[1650] Fix | Delete
$wpseo_og->og_tag( 'og:image', esc_url( $image_url ) );
[1651] Fix | Delete
foreach ( $image_tags as $key => $value ) {
[1652] Fix | Delete
if ( ! empty( $value ) ) {
[1653] Fix | Delete
$wpseo_og->og_tag( 'og:image:' . $key, $value );
[1654] Fix | Delete
}
[1655] Fix | Delete
}
[1656] Fix | Delete
}
[1657] Fix | Delete
}
[1658] Fix | Delete
}
[1659] Fix | Delete
[1660] Fix | Delete
[1661] Fix | Delete
/**
[1662] Fix | Delete
* PR by Sybre Waaijer:
[1663] Fix | Delete
* @link https://github.com/ahmedkaludi/accelerated-mobile-pages/pull/761
[1664] Fix | Delete
*
[1665] Fix | Delete
* @since version 0.9.48 :
[1666] Fix | Delete
* 1. Removes unused code.
[1667] Fix | Delete
* 2. Cleaned up code.
[1668] Fix | Delete
* 3. Keeps legacy action in place.
[1669] Fix | Delete
* 4. No longer replaces the title tag.
[1670] Fix | Delete
* 5. Instead, filters the title tag.
[1671] Fix | Delete
* 6. Therefore, it works with all SEO plugins.
[1672] Fix | Delete
* 7. Removed direct Yoast SEO compat -- It's no longer needed.
[1673] Fix | Delete
* 8. Removed unwanted spaces.
[1674] Fix | Delete
* 9. Improved performance.
[1675] Fix | Delete
* 10. Improved security.
[1676] Fix | Delete
* 11. Added support for CPT and attachment pages.
[1677] Fix | Delete
*/
[1678] Fix | Delete
//26. Extending Title Tagand De-Hooking the Standard one from AMP
[1679] Fix | Delete
add_action( 'pre_amp_render_post', 'ampforwp_remove_title_tags');
[1680] Fix | Delete
function ampforwp_remove_title_tags() {
[1681] Fix | Delete
return ampforwp_replace_title_tags();
[1682] Fix | Delete
}
[1683] Fix | Delete
function ampforwp_replace_title_tags() {
[1684] Fix | Delete
[1685] Fix | Delete
add_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
[1686] Fix | Delete
add_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
[1687] Fix | Delete
[1688] Fix | Delete
if(class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') && !ampforwp_is_home() && !ampforwp_is_front_page() && !ampforwp_is_blog() ){
[1689] Fix | Delete
remove_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
[1690] Fix | Delete
remove_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
[1691] Fix | Delete
}
[1692] Fix | Delete
// For Custom homepage
[1693] Fix | Delete
if(class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration') && ampforwp_is_home() && !ampforwp_is_front_page() ){
[1694] Fix | Delete
remove_filter( 'pre_get_document_title', 'ampforwp_add_custom_title_tag', 20 );
[1695] Fix | Delete
remove_filter( 'wp_title', 'ampforwp_add_custom_title_tag', 10, 3 );
[1696] Fix | Delete
}
[1697] Fix | Delete
[1698] Fix | Delete
function ampforwp_add_custom_title_tag( $title = '', $sep = '', $seplocation = '' ) {
[1699] Fix | Delete
global $redux_builder_amp, $post;
[1700] Fix | Delete
$site_title = '';
[1701] Fix | Delete
$genesis_title = '';
[1702] Fix | Delete
if ( ampforwp_is_front_page() ) {
[1703] Fix | Delete
$post_id = ampforwp_get_frontpage_id();
[1704] Fix | Delete
$post = get_post($post_id);
[1705] Fix | Delete
}
[1706] Fix | Delete
if ( ampforwp_is_blog() ) {
[1707] Fix | Delete
$post_id = ampforwp_get_blog_details('id');
[1708] Fix | Delete
$post = get_post($post_id);
[1709] Fix | Delete
}
[1710] Fix | Delete
if ( !$post ) {
[1711] Fix | Delete
return;
[1712] Fix | Delete
}
[1713] Fix | Delete
$post_id = $post->ID;
[1714] Fix | Delete
[1715] Fix | Delete
//* We can filter this later if needed:
[1716] Fix | Delete
$sep = ' | ';
[1717] Fix | Delete
if( class_exists('WPSEO_Options') && method_exists('WPSEO_Options', 'get') && 'yoast' == ampforwp_get_setting('ampforwp-seo-selection') && !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
[1718] Fix | Delete
$separator = WPSEO_Options::get( 'separator' );
[1719] Fix | Delete
$seperator_options = WPSEO_Option_Titles::get_instance()->get_separator_options();
[1720] Fix | Delete
// This should always be set, but just to be sure.
[1721] Fix | Delete
if ( isset( $seperator_options[ $separator ] ) ) {
[1722] Fix | Delete
// Set the new replacement.
[1723] Fix | Delete
$sep = $seperator_options[ $separator ];
[1724] Fix | Delete
}
[1725] Fix | Delete
}
[1726] Fix | Delete
if( defined( 'RANK_MATH_FILE' ) && class_exists('RankMath\\Helper') && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
[1727] Fix | Delete
$sep = RankMath\Helper::get_settings( 'titles.title_separator' );
[1728] Fix | Delete
$sep = ' '.htmlentities( $sep, ENT_COMPAT, 'UTF-8', false ).' ';
[1729] Fix | Delete
}
[1730] Fix | Delete
$sep = apply_filters('ampforwp_title_seperator_type', $sep);
[1731] Fix | Delete
[1732] Fix | Delete
if ( is_singular() ) {
[1733] Fix | Delete
$title = ! empty( $post->post_title ) ? $post->post_title : $title;
[1734] Fix | Delete
$site_title = $title . $sep . get_option( 'blogname' );
[1735] Fix | Delete
} elseif ( is_archive() && $redux_builder_amp['ampforwp-archive-support'] ) {
[1736] Fix | Delete
$site_title = strip_tags( get_the_archive_title( '' ) . $sep . get_bloginfo( 'name' ) );
[1737] Fix | Delete
}
[1738] Fix | Delete
[1739] Fix | Delete
if ( is_home() ) {
[1740] Fix | Delete
// Custom frontpage
[1741] Fix | Delete
$site_title = get_bloginfo( 'name' ) . $sep . get_option( 'blogdescription' );
[1742] Fix | Delete
[1743] Fix | Delete
if ( ampforwp_is_front_page() ) {
[1744] Fix | Delete
//WPML Static Front Page Support for title and description with Yoast #1143
[1745] Fix | Delete
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
[1746] Fix | Delete
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
[1747] Fix | Delete
$ID = get_option( 'page_on_front' );
[1748] Fix | Delete
}
[1749] Fix | Delete
else {
[1750] Fix | Delete
$ID = ampforwp_get_frontpage_id();
[1751] Fix | Delete
}
[1752] Fix | Delete
$site_title = get_the_title( $ID ) .' '. $sep .' '. get_option( 'blogname' );
[1753] Fix | Delete
}
[1754] Fix | Delete
// // Blog page
[1755] Fix | Delete
// if ( ampforwp_is_blog() ) {
[1756] Fix | Delete
// $ID = ampforwp_get_blog_details('id');
[1757] Fix | Delete
// $site_title = get_the_title( $ID ) . $sep . get_option( 'blogname' );
[1758] Fix | Delete
// }
[1759] Fix | Delete
}
[1760] Fix | Delete
[1761] Fix | Delete
if ( is_search() ) {
[1762] Fix | Delete
$site_title = $redux_builder_amp['amp-translator-search-text'] . ' ' . get_search_query();
[1763] Fix | Delete
}
[1764] Fix | Delete
[1765] Fix | Delete
// Yoast SEO Title compatibility #2871
[1766] Fix | Delete
if( class_exists('WPSEO_Frontend') && ('yoast' || 1) == ampforwp_get_setting('ampforwp-seo-selection') ) {
[1767] Fix | Delete
$yoast_title = $WPSEO_Frontend = $yoast_instance = '';
[1768] Fix | Delete
[1769] Fix | Delete
if ( class_exists('Yoast\WP\SEO\Presentations\Indexable_Presentation') ) {
[1770] Fix | Delete
$yoast_instance = new \Yoast\WP\SEO\Presentations\Indexable_Presentation();
[1771] Fix | Delete
}
[1772] Fix | Delete
[1773] Fix | Delete
if ( !class_exists('Yoast\\WP\\SEO\\Integrations\\Front_End_Integration')) {
[1774] Fix | Delete
$WPSEO_Frontend = WPSEO_Frontend::get_instance();
[1775] Fix | Delete
$yoast_title = $WPSEO_Frontend->title($site_title);
[1776] Fix | Delete
if ( ampforwp_is_home() ) {
[1777] Fix | Delete
$yoast_title = $WPSEO_Frontend->get_title_from_options( 'title-home-wpseo' );
[1778] Fix | Delete
}
[1779] Fix | Delete
// For Blog pages and with Blog sub pages for example: site.com/blog/amp/page/3/
[1780] Fix | Delete
if (ampforwp_is_blog()) {
[1781] Fix | Delete
$yoast_title = $WPSEO_Frontend->get_content_title();
[1782] Fix | Delete
}
[1783] Fix | Delete
}
[1784] Fix | Delete
// Custom Front Page Title From Yoast SEO #1163
[1785] Fix | Delete
if ( ampforwp_is_front_page() || ampforwp_is_blog() && class_exists('Yoast\WP\SEO\Presentations\Indexable_Presentation')) {
[1786] Fix | Delete
$yoast_title = get_post_meta(ampforwp_get_the_ID(), '_yoast_wpseo_title', true);
[1787] Fix | Delete
$yoast_title = wpseo_replace_vars( $yoast_title,$post );
[1788] Fix | Delete
// Get info for custom front page, blog page and blog post paginated pages for v14+ #4574
[1789] Fix | Delete
if ( class_exists('Ampforwp_Yoast_Data') ){
[1790] Fix | Delete
$yoast_data = new Ampforwp_Yoast_Data;
[1791] Fix | Delete
$context = $yoast_data->get_context_for_post_id(ampforwp_get_the_ID());
[1792] Fix | Delete
}
[1793] Fix | Delete
if (isset($context->title)) {
[1794] Fix | Delete
$yoast_title = $context->title;
[1795] Fix | Delete
}
[1796] Fix | Delete
}
[1797] Fix | Delete
if ( $yoast_title ) {
[1798] Fix | Delete
$site_title = apply_filters( 'wpseo_title', $yoast_title, $yoast_instance );
[1799] Fix | Delete
}
[1800] Fix | Delete
}
[1801] Fix | Delete
[1802] Fix | Delete
//Genesis #1013
[1803] Fix | Delete
if(function_exists('genesis_theme_support') && 'genesis' == ampforwp_get_setting('ampforwp-seo-selection') ){
[1804] Fix | Delete
if(is_home() && is_front_page() && !$redux_builder_amp['amp-frontpage-select-option']){
[1805] Fix | Delete
// Determine the doctitle.
[1806] Fix | Delete
$genesis_title = genesis_get_seo_option( 'home_doctitle' ) ? genesis_get_seo_option( 'home_doctitle' ) : get_bloginfo( 'name' );
[1807] Fix | Delete
[1808] Fix | Delete
// Append site description, if necessary.
[1809] Fix | Delete
$genesis_title = genesis_get_seo_option( 'append_description_home' ) ? $genesis_title . " $sep " . get_bloginfo( 'description' ) : $genesis_title;
[1810] Fix | Delete
}
[1811] Fix | Delete
elseif ( is_home() && get_option( 'page_for_posts' ) && get_queried_object_id() )
[1812] Fix | Delete
{
[1813] Fix | Delete
$post_id = get_option( 'page_for_posts' );
[1814] Fix | Delete
if ( null !== $post_id || is_singular() ) {
[1815] Fix | Delete
if ( genesis_get_custom_field( '_genesis_title', $post_id ) ) {
[1816] Fix | Delete
$genesis_title = genesis_get_custom_field( '_genesis_title', $post_id );
[1817] Fix | Delete
}
[1818] Fix | Delete
}
[1819] Fix | Delete
}
[1820] Fix | Delete
elseif( is_home() && get_option( 'page_on_front' ) && $redux_builder_amp['amp-frontpage-select-option'] ){
[1821] Fix | Delete
$post_id = get_option('page_on_front');
[1822] Fix | Delete
if ( null !== $post_id || is_singular() ) {
[1823] Fix | Delete
if ( genesis_get_custom_field( '_genesis_title', $post_id ) ) {
[1824] Fix | Delete
$genesis_title = genesis_get_custom_field( '_genesis_title', $post_id );
[1825] Fix | Delete
}
[1826] Fix | Delete
}
[1827] Fix | Delete
}
[1828] Fix | Delete
elseif ( is_archive() ) {
[1829] Fix | Delete
if ( is_category() || is_tag() || is_tax() ) {
[1830] Fix | Delete
$term = get_queried_object();
[1831] Fix | Delete
$title_meta = get_term_meta( $term->term_id, 'doctitle', true );
[1832] Fix | Delete
$genesis_title = ! empty( $title_meta ) ? $title_meta : $title;
[1833] Fix | Delete
}
[1834] Fix | Delete
[1835] Fix | Delete
if ( is_author() ) {
[1836] Fix | Delete
$user_title = get_the_author_meta( 'doctitle', (int) get_query_var( 'author' ) );
[1837] Fix | Delete
$genesis_title = $user_title ? $user_title : $title;
[1838] Fix | Delete
}
[1839] Fix | Delete
[1840] Fix | Delete
if ( is_post_type_archive() && genesis_has_post_type_archive_support() ) {
[1841] Fix | Delete
$genesis_title = genesis_get_cpt_option( 'doctitle' ) ? genesis_get_cpt_option( 'doctitle' ) : $title;
[1842] Fix | Delete
}
[1843] Fix | Delete
[1844] Fix | Delete
}
[1845] Fix | Delete
else {
[1846] Fix | Delete
//$genesis_title = genesis_default_title( $title );
[1847] Fix | Delete
// genesis_default_title has been depreciated, let's do it with another method #2050
[1848] Fix | Delete
$genesis_title = genesis_get_custom_field( '_genesis_title' );
[1849] Fix | Delete
}
[1850] Fix | Delete
if( $genesis_title ){
[1851] Fix | Delete
$site_title = $genesis_title;
[1852] Fix | Delete
}
[1853] Fix | Delete
}
[1854] Fix | Delete
// SEOPress #1589
[1855] Fix | Delete
if ( is_plugin_active('wp-seopress/seopress.php') && 'seopress' == ampforwp_get_setting('ampforwp-seo-selection') ) {
[1856] Fix | Delete
$seopress_title = ampforwp_get_seopress_title();
[1857] Fix | Delete
$seopress_title = ampforwp_seopress_title_sanitize($seopress_title);
[1858] Fix | Delete
if ( $seopress_title ) {
[1859] Fix | Delete
$site_title = $seopress_title;
[1860] Fix | Delete
}
[1861] Fix | Delete
}
[1862] Fix | Delete
// All in One SEO #2816
[1863] Fix | Delete
if ( class_exists('All_in_One_SEO_Pack') && ampforwp_is_front_page()){
[1864] Fix | Delete
$aiseop_title = '';
[1865] Fix | Delete
$aiseop_title = get_post_meta( $post_id, '_aioseop_title', true );
[1866] Fix | Delete
if ( !empty($aiseop_title) ) {
[1867] Fix | Delete
$site_title = $aiseop_title;
[1868] Fix | Delete
}
[1869] Fix | Delete
add_filter('aioseop_title', '__return_false');
[1870] Fix | Delete
}
[1871] Fix | Delete
if(class_exists('All_in_One_SEO_Pack') && ampforwp_is_home()){
[1872] Fix | Delete
global $aioseop_options;
[1873] Fix | Delete
if(!empty($aioseop_options['aiosp_home_title'])){
[1874] Fix | Delete
$aiseop_title = $aioseop_options['aiosp_home_title'];
[1875] Fix | Delete
}
[1876] Fix | Delete
if ( !empty($aiseop_title) ) {
[1877] Fix | Delete
$site_title = $aiseop_title;
[1878] Fix | Delete
}
[1879] Fix | Delete
add_filter('aioseop_title', '__return_false');
[1880] Fix | Delete
}
[1881] Fix | Delete
// Title From Rank Math SEO #2701 & #3358
[1882] Fix | Delete
if ( defined( 'RANK_MATH_FILE' ) && 'rank_math' == ampforwp_get_setting('ampforwp-seo-selection') ) {
[1883] Fix | Delete
$rank_math_title = '';
[1884] Fix | Delete
$post_id = ampforwp_get_the_ID();
[1885] Fix | Delete
if( ampforwp_is_home() || ampforwp_is_blog() ) {
[1886] Fix | Delete
$rank_math_title = RankMath\Paper\Paper::get_from_options( 'homepage_title' );
[1887] Fix | Delete
}
[1888] Fix | Delete
if ( ampforwp_is_front_page() || is_singular() || ampforwp_is_blog() ) {
[1889] Fix | Delete
$rank_math_title = RankMath\Post::get_meta( 'title', $post_id );
[1890] Fix | Delete
if(empty($rank_math_title)){
[1891] Fix | Delete
$rank_math_title = RankMath\Paper\Paper::get()->get_title();
[1892] Fix | Delete
}
[1893] Fix | Delete
}
[1894] Fix | Delete
if ( is_archive() ) {
[1895] Fix | Delete
$object = get_queried_object();
[1896] Fix | Delete
if( !empty($object->taxonomy) ){
[1897] Fix | Delete
$rank_math_title = RankMath\Term::get_meta( 'title', $object, $object->taxonomy );
[1898] Fix | Delete
}
[1899] Fix | Delete
if ( '' == $rank_math_title && !empty($object->taxonomy) ) {
[1900] Fix | Delete
$rank_math_title = RankMath\Paper\Paper::get_from_options( "tax_{$object->taxonomy}_title", $object );
[1901] Fix | Delete
}
[1902] Fix | Delete
}
[1903] Fix | Delete
if ( $rank_math_title ) {
[1904] Fix | Delete
$site_title = $rank_math_title;
[1905] Fix | Delete
}
[1906] Fix | Delete
}
[1907] Fix | Delete
//Bridge Qode SEO Compatibility #2538
[1908] Fix | Delete
if ( function_exists('qode_wp_title') && 'bridge' == ampforwp_get_setting('ampforwp-seo-selection')){
[1909] Fix | Delete
$site_title = get_post_meta($post_id, "qode_seo_title", true);
[1910] Fix | Delete
}
[1911] Fix | Delete
// The SEO Framework Compatibility #2670
[1912] Fix | Delete
if ( function_exists( 'the_seo_framework' ) && 'seo_framework' == ampforwp_get_setting('ampforwp-seo-selection') ) {
[1913] Fix | Delete
$tsf_title = $ampforwp_tsf = '';
[1914] Fix | Delete
$ampforwp_tsf = \the_seo_framework();
[1915] Fix | Delete
$tsf_title = $ampforwp_tsf->get_title();
[1916] Fix | Delete
if ( $tsf_title ) {
[1917] Fix | Delete
$site_title = $tsf_title;
[1918] Fix | Delete
}
[1919] Fix | Delete
}
[1920] Fix | Delete
if (class_exists('WPSEO_Frontend') && $sep == 'sc-dash') {
[1921] Fix | Delete
return esc_html( convert_chars( trim( $site_title ) ) );
[1922] Fix | Delete
}
[1923] Fix | Delete
return esc_html( convert_chars( wptexturize( trim( $site_title ) ) ) );
[1924] Fix | Delete
}
[1925] Fix | Delete
}
[1926] Fix | Delete
// Get SEOPress Title #1589
[1927] Fix | Delete
function ampforwp_get_seopress_title(){
[1928] Fix | Delete
$seopress_title = $seopress_options = '';
[1929] Fix | Delete
$post_id = ampforwp_get_the_ID();
[1930] Fix | Delete
$post = get_post($post_id);
[1931] Fix | Delete
$seopress_get_current_cpt = get_post_type($post);
[1932] Fix | Delete
$seopress_options = get_option("seopress_titles_option_name");
[1933] Fix | Delete
if ( get_post_meta($post_id,'_seopress_titles_title',true) ) {
[1934] Fix | Delete
$seopress_title = get_post_meta($post_id,'_seopress_titles_title',true);
[1935] Fix | Delete
}
[1936] Fix | Delete
elseif ( isset($seopress_options['seopress_titles_single_titles'][$seopress_get_current_cpt]['title'])) {
[1937] Fix | Delete
$seopress_title = $seopress_options['seopress_titles_single_titles'][$seopress_get_current_cpt]['title'];
[1938] Fix | Delete
$seopress_title = ampforwp_seopress_title_sanitize($seopress_title);
[1939] Fix | Delete
}
[1940] Fix | Delete
if ( ampforwp_is_home() || ampforwp_is_blog() ) {
[1941] Fix | Delete
$seopress_titles_template_variables_array = array('%%sitetitle%%','%%tagline%%');
[1942] Fix | Delete
$seopress_titles_template_replace_array = array( get_bloginfo('name'), get_bloginfo('description') );
[1943] Fix | Delete
$seopress_title = $seopress_options['seopress_titles_home_site_title'];
[1944] Fix | Delete
$seopress_title = str_replace($seopress_titles_template_variables_array, $seopress_titles_template_replace_array, $seopress_title);
[1945] Fix | Delete
}
[1946] Fix | Delete
if ( is_archive() ) {
[1947] Fix | Delete
$seopress_title = get_term_meta(get_queried_object()->{'term_id'},'_seopress_titles_title',true);
[1948] Fix | Delete
}
[1949] Fix | Delete
if ( $seopress_title ) {
[1950] Fix | Delete
return $seopress_title;
[1951] Fix | Delete
}
[1952] Fix | Delete
}
[1953] Fix | Delete
// Sanitize SEOPress Title #1589
[1954] Fix | Delete
function ampforwp_seopress_title_sanitize($title){
[1955] Fix | Delete
global $post;
[1956] Fix | Delete
$seopress_titles_template_variables_array = array(
[1957] Fix | Delete
'%%sep%%',
[1958] Fix | Delete
'%%sitetitle%%',
[1959] Fix | Delete
'%%sitename%%',
[1960] Fix | Delete
'%%tagline%%',
[1961] Fix | Delete
'%%post_title%%',
[1962] Fix | Delete
'%%post_excerpt%%',
[1963] Fix | Delete
'%%post_date%%',
[1964] Fix | Delete
'%%post_modified_date%%',
[1965] Fix | Delete
'%%post_author%%',
[1966] Fix | Delete
'%%post_category%%',
[1967] Fix | Delete
'%%post_tag%%',
[1968] Fix | Delete
'%%_category_title%%',
[1969] Fix | Delete
'%%_category_description%%',
[1970] Fix | Delete
'%%tag_title%%',
[1971] Fix | Delete
'%%tag_description%%',
[1972] Fix | Delete
'%%term_title%%',
[1973] Fix | Delete
'%%term_description%%',
[1974] Fix | Delete
'%%search_keywords%%',
[1975] Fix | Delete
'%%current_pagination%%',
[1976] Fix | Delete
'%%cpt_plural%%',
[1977] Fix | Delete
'%%archive_title%%',
[1978] Fix | Delete
'%%archive_date%%',
[1979] Fix | Delete
'%%archive_date_day%%',
[1980] Fix | Delete
'%%archive_date_month%%',
[1981] Fix | Delete
'%%archive_date_year%%',
[1982] Fix | Delete
'%%wc_single_cat%%',
[1983] Fix | Delete
'%%wc_single_tag%%',
[1984] Fix | Delete
'%%wc_single_short_desc%%',
[1985] Fix | Delete
'%%wc_single_price%%',
[1986] Fix | Delete
'%%wc_single_price_exc_tax%%',
[1987] Fix | Delete
'%%currentday%%',
[1988] Fix | Delete
'%%currentmonth%%',
[1989] Fix | Delete
'%%currentyear%%',
[1990] Fix | Delete
'%%currentdate%%',
[1991] Fix | Delete
'%%currenttime%%',
[1992] Fix | Delete
);
[1993] Fix | Delete
$sep = '';
[1994] Fix | Delete
$seopress_excerpt ='';
[1995] Fix | Delete
$seopress_excerpt_length = 50;
[1996] Fix | Delete
$seopress_excerpt_length = apply_filters('seopress_excerpt_length',$seopress_excerpt_length);
[1997] Fix | Delete
if ($seopress_excerpt !='') {
[1998] Fix | Delete
$seopress_get_the_excerpt = wp_trim_words(esc_attr(stripslashes_deep(wp_filter_nohtml_kses(strip_shortcodes($seopress_excerpt)))), $seopress_excerpt_length);
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function