我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何设置/分配我自己的ID到我在WooCommerce中使用PHP插入的产品?

I know that when I:

wp_insert_post

for each product, each entry get its own ID in database by default. But the case is that I want to assign my OWN IDs in order to be able to check product stock availability to a local database that uses those same IDs.

Any ideas?

I would suggest not use custom ID because it might hamper the internal functioning of wordpress.

You can use add_post_meta() and get_post_meta()

to store your custom Ids.

近期文章

  • 只需显示3条标题/时间戳/类别/传情/链接的最新帖子
  • 致命错误:从Android应用程序输入String时,在php中调用boolean上的成员函数bind_param()
  • 希望使用preg_replace从我的字符串中删除字符
  • PHP ReflectionMethod没有获得param的默认布尔值
  • php简单递归返回null
  • 在php中将数组转换为treeview
  • Url使用动态类别重写
  • welcome.blade.php不在laravel工作
  • 如何在梨邮件中设置auth方法
  • PHP在多个页面中使用SESSION
  • 在弹性beanstalk AWS中部署应用程序
  • 获取JSON数据到angularJS模块[重复]
  • 如何在Laravel刀片上使用Angular参数
  • 无法让Composer在Windows上运行
  • Laravel在npm run dev命令中出错
  • 如果刀片模板存在,如何扩展?
  • 将bootstrap类添加到dateTime属性Symfony
  • Mink selenium2驱动程序无法正常工作
  • 使用htaccess可以使用不同类型的URL
  • 将字符串连接成一个单独的字符串作为php中的变量

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华