• Hello!

    I have not yet been able to make the Upload path relative to date. I would love to be able to have it as: uploads/%year%/%monthnum%/, right now those are not available. Only the following are available at the moment: %userid%, %username%, %blogid%, %pageid% and %pagetitle%. Can you point in the right direction where those are handled, then I may be able to create those on my website. ??

    Regards
    Jonas, Denmark

    • This topic was modified 6 years, 3 months ago by jonassmith.
Viewing 1 replies (of 1 total)
  • Plugin Author nickboss

    (@nickboss)

    Hi, use the following hook code:

    if (!function_exists('wfu_before_file_check_handler')) {
    	function wfu_before_file_check_handler($changable_data, $additional_data) {
    		$changable_data["file_path"] = str_replace("%year%", date("Y"), $changable_data["file_path"]);
    		$changable_data["file_path"] = str_replace("%monthnum%", date("m"), $changable_data["file_path"]);
    		return $changable_data;
    	}
    	add_filter('wfu_before_file_check', 'wfu_before_file_check_handler', 10, 2); 
    }

    Put it at the end of functions.php file of your theme. It will make %year% and %monthnum% variables to work.

    Regards

    Nickolas

Viewing 1 replies (of 1 total)
  • The topic ‘Path relative to date’ is closed to new replies.