custom_upload_dir did not set post_id, no %post_*% variables
-
Hi,
the plugin custom_upload_dir promised to provide a great feature. Unfortunately, it did not work at first, because all %post*%
variables dependend on post_id in the function cud_custom_upload_dir()
did not work. The reason was that post_id was defined as global
in the function and it got the initial value 0. The correct initialization was skipped due to the (wrong) if clause.
PHP Version: 5.2.17 .Solution:
# diff custom_upload_dir.php custom_upload_dir.php.save
[…]
< if(!isset($post_id) || !(is_numeric($post_id) && ($post_id>0))){
< // print(“DEBUG: setting post_id…\n”);
—
> if(!isset($post_id) && !is_numeric($post_id)){
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘custom_upload_dir did not set post_id, no %post_*% variables’ is closed to new replies.