- This topic has 6 replies, 2 voices, and was last updated 7 years, 10 months ago by
luminaire801.
-
AuthorPosts
-
-
April 1, 2014 at 8:44 pm #1633
luminaire801MemberHi guys, been working with Piklist for a while now and it has been wonderful!
I’m wondering if there is a way to add revisions support for CPT metadata using piklist?
I found this post but it didn’t really help, http://piklist.com/support/topic/revisions-masterful-coding/ -
April 2, 2014 at 8:39 pm #1637
SteveKeymasterRevision support for post metadata is supported in Piklist. If you take a post, change data in some Piklist fields and save, you will see the entry in the
wp_postandwp_postmetatables. However, the UI for viewing this data in the WordPress admin has not been created… yet.Here is an article I found on how to implement. We haven’t tested this.
-
April 2, 2014 at 9:03 pm #1638
luminaire801MemberHi Steve, is there anything that I should add to the field? I have a CPT called Projects, I have a Title and a Client (piklist field). When I change the Client field, it doesn’t create a revision, but when I edit the Title it creates a revision. And when I edit both and submit, it creates a revision, however when I restore the revision, it doesn’t include the Client metadata.
The code for the Client Field
piklist('field', array( 'type' => 'select' ,'field' => 'client' ,'supports' => 'revisions' ,'label' => 'Choose a Client' ,'choices' => piklist( get_users( array( 'orderby' => 'display_name' ,'order' => 'asc' ,'role' => 'Subscriber' ) ,'objects' ) ,array( 'ID' ,'display_name' ) ) ));The code for the Post Type
//Adds Menu Option for Project add_filter('piklist_post_types' , 'project_post_type'); function project_post_type($post_types){ $post_types['project'] = array( 'labels' => piklist('post_type_labels' , 'Project') ,'title' => __('Enter title for New Project') ,'public' => true ,'rewrite' => array( 'slug' => 'project' ) ,'supports' => array( 'author' ,'revisions' ,'title' ) ,'capability_type' => 'post' ,'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png') ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png') ,'post_states' => false ,'hide_post_row_actions' => array( 'trash' ) ,'hide_meta_box' => array( 'slug' ,'author' ) ); return $post_types; } -
April 3, 2014 at 9:03 am #1639
SteveKeymasterI apologize. My comment was misleading. Piklist does support metadata revisions but only if post_title, post_content or post_excerpt are updated… which is the WordPress default. We will eventually tackle this and make it better.
This plugin seems to do what you want. We have never tried it, and if you do, please let us know how it works. Maybe we can move part of it into Piklist.
-
April 3, 2014 at 8:14 pm #1643
luminaire801MemberNo problem, Steve.
I will report back to you when I get to test it out.
Thanks again.
-
April 15, 2014 at 9:49 pm #1650
luminaire801MemberHi guys,
I’m happy to report back that the Custom Field Revisions plugin works.
It does however, have some bugs. The current custom field revisions have a difference of 1 past revision.
Also, if you want Custom Field revisions to show when comparing revisions, you need to copy a file in to wp-admin folder.Ex.
Orig post:
title: Hello
cf-name: John
Then I edit cf-name to “Mary”
Rev1:
title: Hello
cf-name:
Rev2:
title: Hello
cf-name: JohnSo if you edit it again, it will have..
Rev3:
title: Hello
cf-name: Mary -
April 15, 2014 at 9:50 pm #1651
luminaire801MemberI would really love to have this built into Piklist out of the box.
Thanks! Piklist has been awesome!
-
-
AuthorPosts
- You must be logged in to reply to this topic.