Forum Replies Created
-
AuthorPosts
-
alpha.media
ParticipantI got it to work using the second option. I had to update the meta box plugin because it was breaking the REST API on the site I was trying to post to. After updating meta box plugin, the issue was fixed and the data posted correctly.
"meta_box": { "meta_key": "meta_value" }alpha.media
ParticipantThanks. I think that could work. Instead of a cron could I just hook into a certain WordPress action that checks to see if it's the settings page on each admin page load? That way it's ordering or deleting them on every page load if needed?
alpha.media
ParticipantCorrect. Basically I am trying to use meta box to create a settings page that allows users to schedule posts that will be featured in 4 featured positions on the homepage. Each position is a separate meta box and within that meta box is a group that contains the post, start date and end date.
My goal would be 3 things.
1.) Order the post entries by start dates.
2.) Delete posts where the current date is past the end date.
3.) Diss-allow users from selecting posts in the same position with the same dates scheduled. (Can probably handle this with Javascript when they are entering dates i'd assume.)Numbers 1 and 2 would make me have to have access to the actual meta values for each repeated group.
I appreciate you helping me with this. Your plugin and extensions are very useful.
alpha.media
ParticipantThanks Anh. Been looking into it but struggling to get anything to work.
$meta_boxes[] = array( 'id' => 'featured_position_1', 'title' => __( 'Featured Position 1', 'alphamedia-blacklab' ), 'settings_pages' => 'alphamedia-featured-content', 'tab' => 'featured_items', 'fields' => array( array( 'id' => 'featured_items_group_1', 'type' => 'group', 'clone' => true, 'fields' => array( array( 'name' => __( 'Featured Post', 'alphamedia-blacklab' ), 'id' => 'featured_item_1', 'type' => 'post', 'post_type' => 'any', 'field_type' => 'select_advanced', 'columns' => 4, ), array( 'name' => __( 'Schedule Start', 'alphamedia-blacklab' ), 'id' => 'featured_item_1_schedule_start', 'type' => 'datetime', 'js_options' => array( 'timeFormat' => 'hh:mm', ), 'columns' => 4, ), array( 'name' => __( 'Schedule End', 'alphamedia-blacklab' ), 'id' => 'featured_item_1_schedule_end', 'type' => 'datetime', 'js_options' => array( 'timeFormat' => 'hh:mm', ), 'columns' => 4, ), ), ), ), );That's the setup for the meta box. Basically every field has just a post, start date, and end date. My goal is to allow the user to schedule posts to appear in a featured section and have it remove end dates that have passed and sort by dates as well. Didn't know how flexible it would be but using Meta Box plugin and extensions really helps to get all the fields put in place. I guess i'm just struggling to gain access to the actual repeater fields that are appearing on the page and there values that are stored.
function edit_meta_boxes() { foreach ( $meta_boxes as $k => $meta_box ) { // Edit "Address Info" meta box if ( isset( $meta_box['id'] ) && 'featured_position_1' == $meta_box['id'] ) { // Loop through all fields foreach ( $meta_box['fields']['fields'] as $j => $field ) { // Add description for "Street" field if ( 'Featured Post' == $field['name'] ) { $meta_boxes[$k][$j]['name'] = 'Change Name As Test'; } } } } return $meta_boxes; } add_filter( 'rwmb_meta_boxes', 'edit_meta_boxes', 20 );alpha.media
ParticipantI've figured out fixes for both issues: the first problem can be fixed by re-calling Location.init() when a new group is added, and the second problem can be fixed by making the selectors on lines 105 and 107 of mb-geo.js match ".rwmb-group-clone" as well as ".rwmb-group-wrapper", as .rwmb-group-wrapper is not present around cloned groups.
alpha.media
ParticipantPlease delete this if you can. We found the error was not with a recent update. Sorry to bother the forum.
-
AuthorPosts