Title: LibWp
Author: Mostafa Soufi
Published: <strong>2012 年 7 月 19 日</strong>
Last modified: 2021 年 4 月 4 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/libwp/assets/icon-256x256.png?rev=1043606)

# LibWp

 作者：[Mostafa Soufi](https://profiles.wordpress.org/mostafas1990/)

[下载](https://downloads.wordpress.org/plugin/libwp.2.2.zip)

 * [详情](https://cn.wordpress.org/plugins/libwp/#description)
 * [评价](https://cn.wordpress.org/plugins/libwp/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/libwp/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/libwp/#developers)

 [支持](https://wordpress.org/support/plugin/libwp/)

## 描述

Provide some simple functionality to register some hooks that could not register
inside the WordPress themes

### Quick Start

Get instance of main class.

    ```
    LibWp();
    ```

**Post type**

    ```
    LibWp()->postType();
    ```

**Taxonomy**

    ```
    LibWp()->taxonomy();
    ```

### Register a new taxonomy

    ```
    LibWp()->postType()
        ->setName('book')
        ->setLabels([
            'name'          => _x('Books', 'Post type general name', 'textdomain'),
            'singular_name' => _x('Book', 'Post type singular name', 'textdomain'),
            'menu_name'     => _x('Books', 'Admin Menu text', 'textdomain'),
            'add_new'       => __('Add New', 'textdomain'),
            'edit_item'     => __('Edit Book', 'textdomain'),
            'view_item'     => __('View Book', 'textdomain'),
            'all_items'     => __('All Books', 'textdomain'),
        ])
        ->setFeatures([
            'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'
        ])
        ->setArgument('show_ui', true)
        ->register();
    ```

### Register a new taxonomy belongs to previous post type

    ```
    LibWp()->taxonomy()
        ->setName('types')
        ->setPostTypes('book')
        ->setArgument('show_in_rest', true)
        ->setLabels([
            'name'          => _x('Types', 'taxonomy general name', 'textdomain'),
            'singular_name' => _x('Type', 'taxonomy singular name', 'textdomain'),
            'search_items'  => __('Search Types', 'textdomain'),
            'all_items'     => __('All Types', 'textdomain'),
            'edit_item'     => __('Edit Type', 'textdomain'),
            'add_new_item'  => __('Add New Type', 'textdomain'),
            'new_item_name' => __('New Type Name', 'textdomain'),
            'menu_name'     => __('Types', 'textdomain'),
        ])
        ->register();
    ```

## 安装

 1. Upload `libwp` to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 评价

此插件暂无评价。

## 贡献者及开发者

「LibWp」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Mostafa Soufi ](https://profiles.wordpress.org/mostafas1990/)
 *   [ Navid Kashani ](https://profiles.wordpress.org/kashani/)
 *   [ VeronaLabs ](https://profiles.wordpress.org/veronalabs/)

[帮助将「LibWp」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/libwp)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/libwp/)，查看[SVN仓库](https://plugins.svn.wordpress.org/libwp/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/libwp/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/libwp/)。

## 更新日志

#### 2.2

 * Added support filters post type and taxonomy
 * Registered an example of post type & taxonomy after plugin initialization.

#### 2.1

 * Added support custom argument for register the taxonomy

#### 2.0

 * Changed the structure fo boilerplate

#### 1.0

 * Initial the plugin

## 额外信息

 *  版本 **2.2**
 *  最后更新：**5 年前**
 *  活跃安装数量 **400+**
 *  WordPress 版本 ** 3.0 或更高版本 **
 *  已测试的最高版本为 **5.6.17**
 *  PHP 版本 ** 7.1 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/libwp/)
 * 标签
 * [functionality](https://cn.wordpress.org/plugins/tags/functionality/)[library](https://cn.wordpress.org/plugins/tags/library/)
   [post type](https://cn.wordpress.org/plugins/tags/post-type/)[taxonomy](https://cn.wordpress.org/plugins/tags/taxonomy/)
   [theme](https://cn.wordpress.org/plugins/tags/theme/)
 *  [高级视图](https://cn.wordpress.org/plugins/libwp/advanced/)

## 评级

 4 星（最高 5 星）。

 *  [  0 条 5 星评价     ](https://wordpress.org/support/plugin/libwp/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/libwp/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/libwp/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/libwp/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/libwp/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/libwp/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/libwp/reviews/)

## 贡献者

 *   [ Mostafa Soufi ](https://profiles.wordpress.org/mostafas1990/)
 *   [ Navid Kashani ](https://profiles.wordpress.org/kashani/)
 *   [ VeronaLabs ](https://profiles.wordpress.org/veronalabs/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/libwp/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://wp-sms-pro.com/donate)