rg_
rg_

Reputation: 431

Warning: missing argument error

I'm getting the following error message:

Warning: Missing argument 7 for slider_getinfo_by_term(), called in /home/content/51/8870051/html/asan/wp-content/plugins/unpointzero-slider/Slider.php on line 37 and defined in /home/content/51/8870051/html/asan/wp-content/plugins/unpointzero-slider/upzSlider.php on line 207

on this page: http://autisticadvocacy.uniongraphics.org/

I have looked around at other posts about this problem so I understand that it's probably a syntax issue (missing a closing tag somewhere?), but I don't know how to fix it.

The code around Slider.php line 37 is

    if($taxoname!=null && $taxoname!=""){
$allinfos = slider_getinfo_by_term($taxoname,$term,     $slider_view_number,$slider_title_max_char,$slider_title_thumb_max_char,$slider_desc_max_char);
}
elseif (($slider_type==1) || ($slider_type==3))  {
$allinfos = slider_getinfo_by_cat($slider_cat_id,$slider_view_number,$slider_fetch,$slider_title_max_char,$slider_title_thumb_max_char,$slider_desc_max_char);
}else{
$allinfos = slider_getpages($slider_cat_id,$slider_view_number,$slider_title_max_char,$slider_title_thumb_max_char,$slider_desc_max_char);
}

and upzSlider.php around line 207 is

function slider_getinfo_by_term($taxoname, $term, $number, $fetch,$slider_title_max_char,$slider_title_thumb_max_char,$slider_desc_max_char) {
global $post;
global $intername; // used as term
global $taxonamesc; // taxonomy
global $usingshort;

   $myposts = get_posts("post_status=\"publish\"&$taxoname=\"$term\"&numberposts=$fetch");
$postok_number = 0;

foreach($myposts as $post) :
    if(has_post_thumbnail($post->ID)) {
    $post_perma[] = get_permalink($post->ID);
    // Rcuperation des options
    $title = "";
    $title = tronc_str(__($post->post_title),$slider_title_max_char);
    $post_title[] = $title;

    $thumb_title = "";
    $thumb_title = tronc_str(__($post->post_title),$slider_title_thumb_max_char);
    $post_thumb_title[] = $thumb_title;

    $content = "";
    $post_excerpt = get_option('slider-contentexrpt');
    if($post_excerpt==1) {
    $content = tronc_str(__($post->post_excerpt),$slider_desc_max_char);
    }
    else {
    $content = tronc_str(__($post->post_content),$slider_desc_max_char);
    }
    $post_content[] = $content;

    $thumb[] =  get_the_post_thumbnail( $post->ID,'upz-big');

    $thumb_mini[] =  get_the_post_thumbnail( $post->ID,'upz-small');

        if(sizeof($post_title)==$number) {
        wp_reset_query();
        return array($post_perma,$post_title,$post_thumb_title,$post_content,$thumb,$thumb_mini);
        }       

    }
endforeach;
wp_reset_query();
return array($post_perma,$post_title,$post_thumb_title,$post_content,$thumb,$thumb_mini);
}

Upvotes: 1

Views: 6518

Answers (2)

Nirmal
Nirmal

Reputation: 9549

$allinfos = slider_getinfo_by_term($taxoname, $term, $slider_view_number, $slider_title_max_char, $slider_title_thumb_max_char, $slider_desc_max_char);

You have missed to supply a matching variable for $fetch argument in between $slider_view_number and $slider_title_max_char. So just between those two variables, add your intended variable for $fetch in the original function.

Something like:

$allinfos = slider_getinfo_by_term($taxoname, $term, $slider_view_number, $some_variable_of_yours, $slider_title_max_char, $slider_title_thumb_max_char, $slider_desc_max_char);

This is will solve your problem.

Upvotes: 0

Vyktor
Vyktor

Reputation: 20997

Function definition:

function slider_getinfo_by_term($taxoname, $term, $number, $fetch,$slider_title_max_char,$slider_title_thumb_max_char,$slider_desc_max_char)

Function call:

slider_getinfo_by_term($taxoname,$term, $slider_view_number,$slider_title_max_char, $slider_title_thumb_max_char,$slider_desc_max_char);

Comparison definition -> call:

$taxoname ->$taxoname
$term -> $term
$number -> $slider_view_number
$fetch -> $slider_title_max_char
$slider_title_max_char -> $slider_title_thumb_max_char
$slider_title_thumb_max_char -> $slider_desc_max_char
$slider_desc_max_char -> your error

I'd say that you're missing $fetch argument, whatever it is, from your function call :)

Edit: $fetch analysis:

You're using $fetch only on this line:

$myposts = get_posts("post_status=\"publish\"&$taxoname=\"$term\"&numberposts=$fetch");

So I'd guess it's number and your function call should look like:

$fetchNumber = 8; // Somewhere before your function call
slider_getinfo_by_term($taxoname,$term, $fetchNumber, $slider_view_number,$slider_title_max_char, $slider_title_thumb_max_char,$slider_desc_max_char);

Upvotes: 3

Related Questions