Skip to content

Commit

Permalink
Use WP SEO class method rather than deprecated fn
Browse files Browse the repository at this point in the history
Notice: wpseo_get_value is deprecated since version WPSEO 1.5.0! Use
WPSEO_Meta::get_value() instead.
  • Loading branch information
toddlahman committed May 7, 2014
1 parent 9665239 commit 912aca6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions includes/class-wc-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function pre_get_posts( $q ) {
$q->is_archive = true;

// Fix WP SEO
if ( function_exists( 'wpseo_get_value' ) ) {
if ( class_exists( 'WPSEO_Meta' ) ) {
add_filter( 'wpseo_metadesc', array( $this, 'wpseo_metadesc' ) );
add_filter( 'wpseo_metakey', array( $this, 'wpseo_metakey' ) );
}
Expand Down Expand Up @@ -263,7 +263,8 @@ public function exclude_protected_products( $where ) {
* @return string
*/
public function wpseo_metadesc() {
return wpseo_get_value( 'metadesc', wc_get_page_id('shop') );
return WPSEO_Meta::get_value( 'metadesc', wc_get_page_id('shop') );

}


Expand All @@ -275,7 +276,7 @@ public function wpseo_metadesc() {
* @return string
*/
public function wpseo_metakey() {
return wpseo_get_value( 'metakey', wc_get_page_id('shop') );
return WPSEO_Meta::get_value( 'metakey', wc_get_page_id('shop') );
}


Expand Down

0 comments on commit 912aca6

Please sign in to comment.