承接 bojaghi/seed-objects 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bojaghi/seed-objects

最新稳定版本:1.0.1

Composer 安装命令:

composer require bojaghi/seed-objects

包简介

Seed objects module.

README 文档

README

Seed posts and terms helper

How to use

See example below:

<?php

use Bojaghi\SeedObjects\SeedsObjects;

$seedObjects = new SeedsObjects(
    [
        'isPlugin'             => true,  // 'true' for plugins, 'false' for themes.
        'removeOnDeactivation' => false, // 'true' if you want to delete all seed objects after the deactivation.
        'mainFile'             => '/path/to/plugin/main_file' // Required if isPlugin=true.
        'comments'             => '',    // Path or configuration array for comments/posts/terms/users.
        'posts'                => '',
        'terms'                => '',
        'users'                => '',
    ],
);

Each configuration array is a series of arguments, which should be adapted into wp_insert_*() function call. For example, 'posts' configuration file:

<?php
/** 
 * /path/to/posts/configuration/post-seeds.php 
 */
 
// Prevent direct access.
if (!defined('ABSPATH')) {
    exist;
}

return array(
    // #1
    array(
        'post_title' => 'Foo #1',
        'post_type'  => 'post',
        /* ... */
    ),
    // #2
    array(/* .. */),
     // #3
    array(/* .. */),
     // #4
    array(/* .. */),
);

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-12-11