当用户单击表行时,我想:
在用户配置文件中保存一个值,转到页面,我在这个循环中:
<?php $query = new WP_Query(array(\'post_type\' => \'aanvraag\', \'posts_per_page\' =>\'-1\', \'post_status\' => array(\'publish\', \'pending\', \'draft\', \'private\'/* , \'trash\' */) ) ); ?>
<?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
<?php endwhile; endif; ?>
这不起作用:
<tr onclick="window.location.href=\'http://www.areal-agro.nl/<?php
$user = get_the_title();
update_usermeta( $current_user->id, \'current_user\', $user );
?>\'">
如果我
echo 这个
$user 值,则输出右侧(当前)值
如果我使用
update_usermeta 如前所述,它使用最后一个值
如果我使用
update_usermeta( $current_user->id, \'current_user\', \'test\'); 它起作用了。
如何导出current 价值为什么是onclick 表现得不像是在循环中,我如何才能改进这一点?