Forum Replies Created
-
AuthorPosts
-
Dave
ParticipantNick, MB Frontend Submission was insufficient for my needs. I ended up writing the my own UI, AJAX, and server code to handle the requests. I still used the MB Relationship php helper methods to process the data on the server.
Dave
ParticipantThank you Anh!
I went to inc/class-mb-custom-table-cache.php and set $row = false; in the get() function. Then it fixed things (even though I won't have the benefit of the caching).
The FacetWP is still complaining but it may be because of something else.
Dave
ParticipantUnfortunately, this did not work. No change.
I've dug into the code to try and figure out what is going on and I keep coming back to this function.
'public static function call()' in this file '/inc/field.php'.It calls 'call_user_func_array( array( RWMB_Helpers_Field::get_class( $field ), $method ), $args )' but I'm confused where this goes.
Remember, I'm updating the custom table in the database manually with $wpdb->update() and then calling rwmb_meta( $field_id, ['storage_type' => 'custom_table', 'table' => $table_name] ); right afterwards.
The issue is that I'm calling these in the same server request. If I send another request and ask for the data with rwmb_meta(), it comes back correct.
The reason I need this to work is that I'm also using FacetWP and I want to index a post after saving. When I run the FacetWP index function the data it's using to index is INCORRECT!
Dave
ParticipantAnh, I found this thread and I'm a little confused. Lets say I have a custom post called 'Classes' and I want to link that to a custom post type of 'Room'. I want to be able to edit the 'Class' with MB Frontend and select or add a new 'Room' from a 'select_advanced' field. How could I do that?
Dave
ParticipantAnother way I might be able to achieve this is to create a custom post type to store my data and then create a relationship to the custom taxonomy. This way I can use MB Frontend on the custom post and then link to the taxonomy in code.
January 17, 2020 at 1:55 AM in reply to: ✅Hooking into get_post_metadata and add_post_metadata #17870Dave
ParticipantThis is what I got working
if (empty(rwmb_get_value('idea_source', null, $post_id ))) { $term = get_term_by('slug', strtolower($tweet_info['source']), 'idea-source'); if (!$term) { $term = wp_insert_term( $tweet_info['source'], 'idea-source', null ); } $term = isset( $term['term_id'] ) ? $term['term_id'] : null; $post_data['source_tax'] = $term; }Later on I did this
$wpdb->update('TABLE_NAME', $post_data, array( 'ID' => $post_id));January 16, 2020 at 8:15 PM in reply to: ✅Hooking into get_post_metadata and add_post_metadata #17867Dave
ParticipantSo this will work but is difficult. I’m trying to programmatically create a new taxonomy term, of it does not already exist, and save the term in a taxonomy_advanced field in a custom table. I’ve been digging into the plugin files to figure out how this is done by default. I’m thinking I can call the ‘value’ method on the advanced taxonomy class?
January 16, 2020 at 3:26 AM in reply to: ✅Hooking into get_post_metadata and add_post_metadata #17857Dave
ParticipantI've got the same issue.
Dave
ParticipantOk, I figured it out. I was using type 'taxonomy' but when I switched to 'taxonomy-advanced' it worked.
Dave
ParticipantHi Anh, I was having the same issue so I just updated my AIO to version 1.10.13 but the issue is still there. The taxonomy field is not saving to my custom table.
Dave
ParticipantExcellent, just what I was looking for.
Dave
ParticipantHi, I found this question while trying to figure out how to generate a post_title by combining several metabox fields. I tried modifying the $_POST['post_title'] = $_POST['FIELD_NAME1'] . ' ' . $POST['FIELD_NAME2']; in the 'rwmb_frontend_before_process' hook but nothing changed. I emailed myself json_encode($_POST) after the change and it did change the $_POST['post_title'] but when the save is made to the database it is not correct. Please help me understand what I'm doing wrong.
-
AuthorPosts