• Resolved pauladams07

    (@pauladams07)


    Hi,

    I am currently trying to debug a website which is running Events Manager and Events Manager Pro. The website also utilises Yoast and Yoast’s breadcrumb functionality.

    After enabling debug, it has logged 1500 lines of the following issue:
    [03-Dec-2020 13:45:40 UTC] PHP Deprecated: WPSEO_Utils::get_title_separator is deprecated since version WPSEO 15.2! Use Yoast\WP\SEO\Helpers\Options_Helper::get_title_separator instead. in D:\home\site\wwwroot\wp-includes\functions.php on line 4777

    Having searched the Project folder it seems the only place get_title_separator() is being used by a function called em_content_wpseo_title, which is in: plugins/events-manager/em-events.php

    Will you be able to fix this, or shall I update this in your plugin file?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Same I noticed since a while.
    Code should be upgraded to use
    YoastSEO()->helpers->options->get_title_separator()
    directly.

    Unfortunately, I didn’t find a GitHub / GitLab repo of the plugin, so I couldn’t send a pull request which fixes this.

    This change in wp-events.php is what I use:

    /**
     * Yoast SEO friendly short circuit, fixes issues in Yoast 14 update by changing the $sep function into the actual separator.
     * @param $title
     * @param string|mixed $sep
     * @param string $seplocation
     * @return string
     */
    function em_content_wpseo_title($title, $sep = '', $seplocation = ''){
    	if( function_exists('YoastSEO') && method_exists('\Yoast\WP\SEO\Helpers\Options_Helper', 'get_title_separator') ){
    		// YoastSEO >= 15.2
    		$sep = YoastSEO()->helpers->options->get_title_separator();
    	}elseif( class_exists('WPSEO_Utils') && method_exists('WPSEO_Utils', 'get_title_separator') ){
    		// YoastSEO < 15.2
    		$sep = WPSEO_Utils::get_title_separator();
    	}elseif( !is_string( $sep ) ){
    		$sep = '';
    	}
    	if( !is_string($seplocation) ){
    		$seplocation = '';
    	}
    	return em_content_wp_title( $title, $sep, $seplocation = '' );
    }
    • This reply was modified 4 years, 3 months ago by toxicum.
    Thread Starter pauladams07

    (@pauladams07)

    Thanks for your reply’s Toxicum ??
    I’ll modify the code in em-events.php and hope in the next update they implement the fix.
    I also tried to find a repo without any luck.

    • This reply was modified 4 years, 3 months ago by pauladams07.

    Just encountered this issue again, hope there is a fixed release in the near future.

    • This reply was modified 4 years, 3 months ago by strarsis.
    Plugin Support angelo_nwl

    (@angelo_nwl)

    Hi,

    EM 5.9.9 is out now, you can try and confirm.

    • This reply was modified 4 years, 2 months ago by angelo_nwl.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PHP Deprecated: WPSEO_Utils::get_title_separator’ is closed to new replies.