• Resolved stefanr

    (@stefanr)


    Hi,
    I cannot get the ‘after’ parameter to work. I am creating a shortcode with the text after=’30 days ago’ – I can see that a date query is created in the query args, but it is an empty arrary.

    I am running version 0.74.2 of the plugin. Looking at the code in lcp-parameters.php I think the problem lies in the following piece of code (starting on line 326)

         *  Check which paramaters are set and find out which subarrays
         *  should be created.
         */
        foreach ($params_set as $key=>$value){
          if ( isset($this->{$key}) ){
            $params_set[$key] = true;
            $trutify = substr($key, 0, strpos( $key, '_') );
            ${$trutify} = true;
          }
        }
    

    I think that is the parameter is merely ‘after’ rather then ‘after_year’ etc. then the $trutify string is blank and no query is created for ‘after’.

    I have managed to get things working by temporarily amending the code as follows:

    
         *  Check which paramaters are set and find out which subarrays
         *  should be created.
         */
        foreach ($params_set as $key=>$value){
          if ( isset($this->{$key}) ){
            $params_set[$key] = true;
    		if (strpos( $key, '_') === false){
    			$trutify = $key;	
    			}
    		else {
    			$trutify = substr($key, 0, strpos( $key, '_') );
    			}
            ${$trutify} = true;
    		}
        }
    

    This is now working for me, but it will be overwritten the next time the plugin is updated.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘after not creating date query’ is closed to new replies.