Skip to main content
deleted 1 character in body
Source Link
Mailmulah
  • 97
  • 1
  • 4
  • 13

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error disappear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error disappear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error disappear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

formatting
Source Link
Sumit
  • 4.8k
  • 2
  • 28
  • 36

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error dissapeardisappear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error dissapear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error disappear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

deleted 34 characters in body
Source Link
Mailmulah
  • 97
  • 1
  • 4
  • 13

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <span><?php echo $title; ?></span><<?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error dissapear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <span><?php echo $title; ?></span><?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error dissapear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

I get this error after deleted a few of unused category's product on my woo theme:

Catchable fatal error: Object of class WP_Error could not be converted to string in D:-mytheme\wordpress\wp-content\plugins\myplugin\mymodule.php on line 47

The line 47 is like this:

 <?php  echo '<a href="'.get_term_link($term).'">'.$term->name.'</a>'; ?>

The $term define on:

 <?php 
 class myShortCode {
    protected function content($atts, $content = null){
    $atts =  vc_map_get_attributes( $this->getShortcode(), $atts );
     global $woocommerce, $product; 
    extract( shortcode_atts( array(
        'title' => ''       
    ), $atts ) );
    $term = get_term_by('name', $type_product, 'brands');
    $category = isset($term->term_id) ? $term->term_id : '';    
    $css_class  = "";

    if ( $css_animation != '' ) {
        wp_enqueue_script( 'waypoints' );
        $css_class = ' wpb_animate_when_almost_visible wpb_'.$css_animation;
}       
 ;
 ob_start();
 ?>

The error dissapear only id the category exist and selected.

I have no idea how to fix this. Can anyone throw me a bone?

Thank you.

Source Link
Mailmulah
  • 97
  • 1
  • 4
  • 13
Loading