Thodoris
Forum Replies Created
-
Forum: Plugins
In reply to: [CMB2] Two fields in same row in back endThank you for your reply.
I will do it with css, just I was wondering if there is option and miss it
Thanks
Forum: Fixing WordPress
In reply to: Regenerate / recalculate file sizes ?Thanks
oops I miss the reply,
Thanks you Joy,
So I guess I didn’t done any mistake.Anyway as workaround I can get all post and the filter the array.
Thanks
Thank you @keraweb
Hello Jory ( @keraweb ),
Thank you for your reply, I will try it even I don’t get 100% that you say but you give me a hind.
So, I guess is not possible to call pods_api_post_save_pod_item_post filter for specific post programmatically? it called only when save the post.
One more think
I made some test and I found some weird behavior.
I POD1 -> FIELD1 have relationship with POD2->FIELD1
If you set relationship values in post from POD1 and remove the relation from post in POD2 the values for relation between fields in database table _podsrel and values from _postmeta for post from POD2 removed correctly but the values in _postmeta for post from POD1 remains.
I want to investigate more at new installation when I have time and be sure it happens always. This is normal or looks like bug?
Where I can report it if it’s a bug?
ThanksHello Jory,
You are right, I thought about this after asking the question
Thanks for your reply.
Thodoris.Finally pods_api_post_save_pod_item_post works
Here is a sample from the code
add_filter( 'pods_api_pre_save_pod_item_post', 'save_cats_and_tags', 10, 2); function save_cats_and_tags( $pieces, $is_new_item ) { // get tags $fields = array( $pieces[ 'fields' ][ 'tags_field' ][ 'value' ], ); $tags = array(); foreach ( $fields as $field ) { foreach ( $field as $id ) { if ( !in_array( $id, $tags ) ) { $tags [] = intval ( $id ); } } } // save tags if ( !empty( $tags ) ) { sort($tags); } wp_set_object_terms( get_the_ID() , $tags, post_tag ); }