Title: Violet Custom Post Meta
Author: Rakib
Published: <strong>2018 年 3 月 6 日</strong>
Last modified: 2018 年 3 月 6 日

---

搜索插件

![](https://ps.w.org/wp-violet/assets/banner-772x250.jpg?rev=1834742)

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

![](https://ps.w.org/wp-violet/assets/icon-128x128.jpg?rev=1834744)

# Violet Custom Post Meta

 作者：[Rakib](https://profiles.wordpress.org/serakib/)

[下载](https://downloads.wordpress.org/plugin/wp-violet.zip)

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

 [支持](https://wordpress.org/support/plugin/wp-violet/)

## 描述

To avoid plugin territory warning for CPT and Meta Boxes, This is a great choice
for you. Violet Custom Post Meta adds necessary CPT, Meta, Texonomy to develop awesome
portfolio theme.

Post Types:

 * services
 * skill
 * portfolio
 * testimonial
 * team
 * partner

Note that this plugin function can be modify as your choice by filter Hooks.

Hook Lists :

    ```
    vcpm_{post_type}_params //to modify post type args.
    vcpm_portfolio_category_params //to modify portfolio texonomy.
    vcpm_meta_fields_{post_type} //provides ability to add, remove, modify meta fields.
    vcpm_meta_box //Provides ability to create, delete and modify meta box.
    vcpm_meta_fields_control //Fields styte, presentation can be modify.
    ```

## 屏幕截图

[⌊Supports input type text, radio, checkbox, range.⌉⌊Supports input type text, radio,
checkbox, range.⌉[

Supports input type text, radio, checkbox, range.

[⌊Portfolio Category and Image picker.⌉⌊Portfolio Category and Image picker.⌉[

Portfolio Category and Image picker.

[⌊Field type checkbox, radio.⌉⌊Field type checkbox, radio.⌉[

Field type checkbox, radio.

[⌊Field type select option.⌉⌊Field type select option.⌉[

Field type select option.

[⌊General meta box register args.⌉⌊General meta box register args.⌉[

General meta box register args.

## 安装

Just install and active the plugin. Custom meta you can use in you theme as by wordpress
rules.

Meta fields list can be checked by plugins `/includes/class-vcpm-meta.php`

## 常见问题

  Installation Instructions

Just install and active the plugin. Custom meta you can use in you theme as by wordpress
rules.

Meta fields list can be checked by plugins `/includes/class-vcpm-meta.php`

  Can I use both Portfolio image and link?

No, When you select portfolio image, Portfolio link would be hidden.

  How to modify meta box render style

Use vcpm_meta_fields_control hook. It accept max 3 arguments ($html,$fields,$post).

    ```
    <?php
        function example_callback( $html, $fields, $post ) {
            foreach ($fields as $field) {
                $value = get_post_meta($post->ID, $field['id'], true);
                // Actions you need to do
            }
            return $html;
        }
        add_filter( 'vcpm_meta_fields_control', 'example_callback' 1, 3 );
    ?>
    ```

  I need samply query code

Hear is sample query code for portfolio post types and their meta.

    ```
    <?php
    //Portfolio post and meta query
    $args = array( 'post_type' => 'portfolio');
    $loop = new WP_Query( $args );
    while ( $loop->have_posts() ) : $loop->the_post();
        $post_id = get_the_ID();
        $terms = get_the_terms( $post_id, 'portfolio_category' );
        $post_custom = get_post_custom($post_id);
        $portfolio_title = get_the_title();
        $portfolio_sub = $post_custom["sub_name"][0];
        $portfolio_img = $post_custom["portfolio_img"][0];
        $portfolio_link = esc_url($post_custom["portfolio_link"][0]);
        $portfolio_thumb_url = '';
            $portfolio_thumb_url = wp_get_attachment_url( get_post_thumbnail_id() );
        }
    ?>
    ```

## 评价

此插件暂无评价。

## 贡献者及开发者

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

贡献者

 *   [ Rakib ](https://profiles.wordpress.org/serakib/)

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

### 对开发感兴趣吗?

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

## 更新日志

#### 1.0

Initial release.

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**8 年前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 4.5 或更高版本 **
 *  已测试的最高版本为 **4.9.29**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-violet/)
 * 标签
 * [custom fields](https://cn.wordpress.org/plugins/tags/custom-fields/)[custom post types](https://cn.wordpress.org/plugins/tags/custom-post-types/)
   [Custom Taxonomies](https://cn.wordpress.org/plugins/tags/custom-taxonomies/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-violet/advanced/)

## 评级

尚未提交反馈。

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

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

## 贡献者

 *   [ Rakib ](https://profiles.wordpress.org/serakib/)

## 支持

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

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

## 捐助

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

 [ 捐助此插件 ](http://www.rakibhossain.cf)