在插件中使用 nextgen 画廊功能
我正在尝试编写一个简单的 Wordpress 插件来读取 XML feed 并将数据放入自定义帖子中。 数据来自某房产网站。 我可以阅读其中的所有信息并使用 wp_insert_post( $mypost, $wp_error );
创建新帖子,我可以设置条款并更新这篇文章的元,但在尝试时我感到很困惑将图像放入 Nextgen 画廊。
我可以读取所有图像的网址。我想做的是为属性创建一个新图库,然后将图像添加到该图库中。
我尝试过 nggAdmin::create_gallery($title, $defaultpath);
而且
$result = $wpdb->query("
INSERT INTO $wpdb->nggallery (name, slug, path, title, galdesc, pageid, previewpic, author)
VALUES (‘testgallery’, ‘testgallery’, ‘wp-content/gallery/testgallery’, ‘testgallery’, ”, 0, 0, 1)";
我只是得到一个空白屏幕。
有人可以告诉我文件中包含哪些内容以及如何从 Nextgen gallery 调用所需的函数。
I am trying to write a simple Wordpress plugin to read an XML feed and put the data into a custom post.
The data is from a property website.
I can read all the information in and use wp_insert_post( $mypost, $wp_error );
to create the new post and I can set the terms and update the meta for this post, but I am stumped when trying to get the images into Nextgen gallery.
I can read all the urls for the images. What I would like to do, is create a new gallery for a property, then add the images to this gallery.
I have tried nggAdmin::create_gallery($title, $defaultpath);
and also
$result = $wpdb->query("
INSERT INTO $wpdb->nggallery (name, slug, path, title, galdesc, pageid, previewpic, author)
VALUES (‘testgallery’, ‘testgallery’, ‘wp-content/gallery/testgallery’, ‘testgallery’, ”, 0, 0, 1)";
I just get a blank screen.
Can someone tell me what INCLUDES to put in the file and how to call the functions needed from Nextgen gallery.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论