WordPress.org

Ready to get started?Download WordPress

Forums

All in One SEO Pack
[resolved] aioseop_home_page_title does not get applied anymore (3 posts)

  1. yeahfree
    Member
    Posted 1 year ago #

    Hi,

    i have been happily using all in one seo pack on a couple of my sites. i am making use of dynamic data on my page / post / home titles.
    example title could be:
    best blue widgets in [getYear]
    in this example [getYear] would dynamically be replaced with 2013

    for that i'm add_filter, to hook into for instance the aioseop_description, aioseop_post_title, aioseop_keywords, aioseop_home_page_title

    so far this have always worked good.

    I did not update the all in one seo pack for a while. i have recently updated all in one seo pack to the latest version (2.02) and noticed the 'aioseop_home_page_title' does not get applied anymore. With the aioseop_home_page_title i was able to hook into the homepage title, now i'm not anymore.

    Can this be added again to the plugin?
    if not, is there a workaround?

    here some stuff to make it easiest:

    Current sourcecode aioseop_class.php, function get_aioseop_title, line 1497-1511: doesn’t apply the aiseop_home_page_title filter

    if ( is_front_page() ) {
                      $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
                      if ( empty( $title ) && !empty( $post ) && $this->is_static_front_page() ) {
                            $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
                            if ( empty( $title ) )
                                 $title = $this->internationalize( $post->post_title );
                            if ( empty( $title ) )
                                 $title = $this->internationalize( $this->get_original_title( '', false ) );
                            if ( !empty( $title ) )
                                 $title = $this->apply_page_title_format( $title );
                      }
                      if (empty( $title ) )
                            $title = $this->internationalize( get_option( 'blogname' ) );
                      return $this->paged_title( $title );
                } else if …

    Fixed version could be: rely on the else-if a couple of lines down (like older versions of aioseop did)

    if ( is_home() && !$this->is_static_posts_page() ) {
                      $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
                      if ( empty( $title ) && !empty( $post ) && $this->is_static_front_page() ) {
                            $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
                            if ( empty( $title ) )
                                 $title = $this->internationalize( $post->post_title );
                            if ( empty( $title ) )
                                 $title = $this->internationalize( $this->get_original_title( '', false ) );
                            if ( !empty( $title ) )
                                 $title = $this->apply_page_title_format( $title );
                      }
                      if (empty( $title ) )
                            $title = $this->internationalize( get_option( 'blogname' ) );
                      return $this->paged_title( $title );
                } else if …

    Alternate fix: do apply the aiseop_home_page_title filter here as well

    if ( is_front_page() ) {
                      $title = $this->internationalize( $aioseop_options['aiosp_home_title'] );
                      if ( empty( $title ) && !empty( $post ) && $this->is_static_front_page() ) {
                            $title = $this->internationalize( get_post_meta( $post->ID, "_aioseop_title", true ) );
                            if ( empty( $title ) )
                                 $title = $this->internationalize( $post->post_title );
                            if ( empty( $title ) )
                                 $title = $this->internationalize( $this->get_original_title( '', false ) );
                            if ( !empty( $title ) )
                                 $title = $this->apply_page_title_format( $title );
                      }
                      if (empty( $title ) )
                            $title = $this->internationalize( get_option( 'blogname' ) );
                      return apply_filters( 'aioseop_home_page_title', $this->paged_title( $title ) );
                } else if …

    http://wordpress.org/extend/plugins/all-in-one-seo-pack/

  2. yeahfree
    Member
    Posted 1 year ago #

    ignore, now using the add_filter on aioseop_title instead, always seems to work now

  3. Peter Baylies
    Member
    Plugin Author

    Posted 1 year ago #

    yeahfree,

    Yes, filtering the title should work; thanks for the bug report and the comparisons, this should be fixed in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic