Forum Replies Created
-
AuthorPosts
-
RachelMemberI figured it out!
Turns out, this is a bug only in Chrome and is fixed in the latest version of TinyMCE. Going off of the bug explanation, that you can’t have editable items nested within a non editable item, if you change
<div class="wpview-body" contenteditable="false">-> to<div class="wpview-body">.You guys might want to add to the next release. 🙂
RachelMemberCool. Thank you!
RachelMemberDid you figure anything out related to this? Still seeing this issue in 0.9.9.7.
March 21, 2016 at 11:28 am in reply to: update condition in add_more group not working in v 9.9.7 #6131
RachelMember@Steve, is there a fix for this yet?
RachelMember@Steve I wanted to see if there was an explicit false value that could be set, but I can make this work.
Thanks!
RachelOctober 27, 2015 at 10:57 am in reply to: Creating conditional field for something not equal to 'none' #4761
RachelMemberThat makes sense. I was trying to see if part of the condition could get the post info once the select option changes.
RachelMemberThat does, I was just hoping there was some way of adding an index to the data model… any suggestions?
I am now using the WP-API plugin and see that they come in the correct order, but I’d like to harden things a bit more by having an index if possible.
RachelMemberHmmm, there appears to be an a and s key in the array, but it seems to not have anything to do with source order.
Here’s my piklist code:
piklist('field', array( 'type' => 'group' ,'label' => __('Sources') ,'description' => __('Any additional sources to cite') ,'field' => 'sources_group' ,'add_more' => true ,'fields' => array( array( 'type' => 'text' ,'field' => 'source_title' ,'label' => 'Source Title' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ) ) ,array( 'type' => 'text' ,'field' => 'source_text' ,'label' => 'Source Text' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ) ) ,array( 'type' => 'text' ,'field' => 'source_url' ,'label' => 'Source URL' ,'columns' => 12 ,'attributes' => array( 'class' => 'large-text' ), 'validate' => array( array( 'type' => 'url' ) ) ) ) ));and the JSON:
{ "status": "ok", "post": { "id": 31, "type": "post", "slug": "testing-a-cited-post", "url": "http://localhost:8888/2015/10/26/testing-a-cited-post/", "status": "publish", "title": "Testing a cited post", "title_plain": "Testing a cited post", "content": "<p>Body text</p>\n", "excerpt": "<p>Hello excerpt here</p>\n", "date": "2015-10-26 14:58:10", "modified": "2015-10-26 14:58:19", "categories": [ { "id": 2, "slug": "memos", "title": "Memos", "description": "", "parent": 0, "post_count": 2 } ], "tags": [], "author": { "id": 1, "slug": "admin", "name": "admin", "first_name": "", "last_name": "", "nickname": "admin", "url": "", "description": "" }, "comments": [], "attachments": [], "comment_count": 0, "comment_status": "open", "custom_fields": { "media_label": [ "" ], "author_name": [ "" ], "author_title": [ "" ], "author_twitter": [ "" ], "demo_add_more": [ "single" ], "sources_group": [ "a:3:{s:12:\"source_title\";a:2:{i:0;s:25:\"Title of source somewhere\";i:1;s:30:\"Title of Source somewhere else\";}s:11:\"source_text\";a:2:{i:0;s:9:\"more text\";i:1;s:9:\"some text\";}s:10:\"source_url\";a:2:{i:0;s:24:\"http://www.somewhere.com\";i:1;s:28:\"http://www.somewhereelse.com\";}}" ] } }, "previous_url": "http://localhost:8888/2015/10/14/another-post/" }October 26, 2015 at 10:49 am in reply to: Creating conditional field for something not equal to 'none' #4745
RachelMemberHow would I go about replacing them with the selected post title, image, and excerpt?
RachelMemberIs there a way to expose this in the same array? I’m using this with the JSON API plugin
RachelMemberEssentially I want to get some awareness in the data model of the user chosen sorting order of the add more fields which are draggable.

Perhaps the json would look something like this:
{ "sources_group": { "order": "0", "source_title": "Title of source", "source_text": "some text", "source_url": "http://www.somewhere.com" }, "order": "1", "source_title": "Title of source", "source_text": "more text", "source_url": "http://www.somewhereelse.com" } }Attachments:
You must be logged in to view attached files.October 22, 2015 at 4:06 pm in reply to: Creating conditional field for something not equal to 'none' #4704
RachelMemberGreat! That worked, now I just need to replace the image, title, and excerpt with the real thing.
piklist('field', array( 'type' => 'select' ,'field' => 'featured_post_id' ,'label' => 'Choose post to feature' ,'columns' => 6 ,'choices' => array('none' => '-') + piklist( get_posts( array( 'post_type' => 'post' ,'orderby' => 'post_date' ) ,'objects' ) ,array( 'ID' ,'post_title' ) ) )); piklist('field', array( 'type' => 'html' ,'label' => 'Post Selected' ,'field' => 'featured_post_preview' ,'description' => 'The selected post to be featured' ,'value' => '<img src="Post image"/><h2>Post Title</h2><p>Excerpt</p>' ,'conditions' => array( array( 'field' => 'featured_post_id' ,'value' => 'none' ,'compare' => '!=' ) ) )); -
AuthorPosts