更新wordpress字段“DATE”
问题描述:
So I have been trying to find a solution for this around 1 hour and I cant find the solution.
how do I update DATE with the update_post_meta() function?
I have ACF field which is jquery(date).
Ive tried
1 2 |
update_post_meta($post_id,\'last_date\',$arr[9]); |
when $arr[9]
is 22/09/2018
like my Date format.
图片转代码服务由CSDN问答提供
感谢您的意见,我们尽快改进~
功能建议
所以我一直试图找到一个解决方案大约1小时,我找不到解决方案。</ p >
如何使用update_post_meta()函数更新DATE?
我有ACF字段,即jquery(日期)。
我已经尝试</ p>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
update_post_meta ($ post_id,\'last_date\',$ arr [9]); </ code> </ pre> <p>当<code> $ arr [9] </ code> <strong> 22时 / 09/2018 </ strong> 我的日期格式。</ p> </ div> <h5>网友观点:</h5> <div> <p>For update_post_meta function it doesn\'t matter which kind of value you have. It stores it as a string. So the problem can\'t be related to $arr[9]\'s datetime format. </p> <p>That\'s why there are only two options to check: </p> <ol> <li> <p>Write </p> <p>echo $post_id; </p> </li> </ol> <p>before update_post_meta() function and check if it displays correct ID.</p> <ol> <li>Again, check your database wp_postmeta table and search for \\\"last_date\\\" field. May be it has some another prefix or postfix.</li> </ol> <p>If to do these 2 steps, you will find the reason by 100%.</p> </div> ### <div> <p>try like this, I think your date format is not correct:</p> <pre><code>$date_stamp = strtotime($arr[9]); $postdate = date(\\\"Y-m-d H:i:s\\\", $date_stamp); update_post_meta($post_id,\'last_date\',$postdate); |
由于网站搬家,部分链接失效,如无法下载,请联系站长!谢谢支持!
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » 更新wordpress字段“DATE”
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » 更新wordpress字段“DATE”