Support Forum » User Profile

Forum Replies Created

Viewing 13 posts - 16 through 28 (of 28 total)
  • Author
    Posts
  • in reply to: Query Args Confusion #33586
    Jeremy ParrottJeremy Parrott
    Participant

    I don't have that code... I tried this and many other combinations.

    $prefix = '';
    $post_parent = ($_POST['post_parent']);
    $post_id = null;
    if ( isset( $_GET['post'] ) ) {
    $post_id = intval( $_GET['post'] );
    } elseif ( isset( $_POST['post_ID'] ) ) {
    $post_id = intval( $_POST['post_ID'] );
    }

    in reply to: Tabs Doesn't Work #32336
    Jeremy ParrottJeremy Parrott
    Participant

    Any update on fixing the icons for the tabs?

    in reply to: Use Current Post ID as a QUERY ARG #32106
    Jeremy ParrottJeremy Parrott
    Participant

    That didn't work.

    I think the code is correct but I did change the post_types from "Monitor" to "Controller" in the first few lines of code to test.

        $meta_boxes[] = [
            'title'        => __( 'Monitor Fields', 'your-text-domain' ),
            'id'           => 'monitor-fields',
            'post_types'   => ['<strong>monitor</strong>'],
            'storage_type' => 'custom_table',
            'table'        => 'monitor_table',

    I left this code "as-is" and it looks correct to me:

                [
                    'name'       => __( 'Controller', 'your-text-domain' ),
                    'id'         => $prefix . 'controller',
                    'type'       => 'post',
                    'post_type'  => ['controller'],
                    'field_type' => 'select',
                    'query_args' => [
                        'orderby'     => 'post_title',
                        'order'       => 'ASC',
                        'post_parent' => $post_id,
                    ],
                    'tab'        => 'monitor_details',

    Here's a screenshot of what I'm trying to do: https://pasteboard.co/hquFYGyQQILC.png

    in reply to: Use Current Post ID as a QUERY ARG #32052
    Jeremy ParrottJeremy Parrott
    Participant

    I still can't get this to work. Here's example code in my functions.php file.

    function monitor_set_controller_number( $meta_boxes ) {
        
        $prefix = '';
        
        $post_id = null;
    // Method #1 - DID NOT WORK ($post_id is NULL)
    //    if ( isset( $_GET['post'] ) ) {
    //  $post_id = intval( $_GET['post'] );
    //    } elseif ( isset( $_POST['post_ID'] ) ) {
    //        $post_id = intval( $_POST['post_ID'] );
    //    }
    
    // Method #2 - DID NOT WORK ($post_id is NULL)
    //    $post_id = $GLOBALS['post']->ID;
    
    // Method #3 - DID NOT WORK ($post_id is NULL)
    //    $post_id = rwmb_meta( $field_id );
    
        $meta_boxes[] = [
            'title'        => __( 'Monitor Fields', 'your-text-domain' ),
            'id'           => 'monitor-fields',
            'post_types'   => ['monitor'],
            'storage_type' => 'custom_table',
            'table'        => 'monitor_table',
            'tabs'         => [
                'monitor_details'      => [
                    'label' => 'Monitor Details',
                    'icon'  => 'chart-bar',
                ],
                'tank_configuration'   => [
                    'label' => 'Tank Configuration',
                    'icon'  => 'category',
                ],
                'local_display_fields' => [
                    'label' => 'Local Display Fields',
                    'icon'  => 'money',
                ],
            ],
            'fields'       => [
                [
                    'name'       => __( 'Location', 'your-text-domain' ),
                    'id'         => $prefix . 'physical_location',
                    'type'       => 'post',
                    'post_type'  => ['location'],
                    'field_type' => 'select',
                    'order by'   => 'post_id',
                    'tab'        => 'monitor_details',
                ],
                [
                    'name'      => __( 'Active', 'your-text-domain' ),
                    'id'        => $prefix . 'monitor_active',
                    'type'      => 'switch',
                    'style'     => 'square',
                    'on_label'  => 'Active',
                    'off_label' => 'Inactive',
                    'std'       => true,
                    'tab'       => 'monitor_details',
                ],
                [
                    'name'       => __( 'Controller', 'your-text-domain' ),
                    'id'         => $prefix . 'controller',
                    'type'       => 'post',
                    'post_type'  => ['controller'],
                    'field_type' => 'select',
                    'query_args' => [
                        'orderby'     => 'post_title',
                        'order'       => 'ASC',
                        'post_parent' => $post_id,
                    ],
                    'tab'        => 'monitor_details',
                ],
                :

    It seems like the post doesn't exist at the time the functions.php is included so it's not defined.

    I know it's reading in the functions.php file because I can change $post_id to 200017 and it brings up the correct controllers.

    in reply to: Refresh contents of Metabox with Javascript #31762
    Jeremy ParrottJeremy Parrott
    Participant

    You can delete this post. I posted on the wrong site!

    Jeremy ParrottJeremy Parrott
    Participant

    There's also the "Set as parent" option in the Field group. Maybe that in combination with the above might work?

    Jeremy ParrottJeremy Parrott
    Participant

    Can I make this work if I use the "Hierarchical [X] Whether the post type is hierarchical." checkbox and make the Model CPT a child of the Make CPT or some combination thereof?

    in reply to: Tab icons do not display #31079
    Jeremy ParrottJeremy Parrott
    Participant

    Any word on when this will be working again?

    in reply to: Google Maps not reading API key from MB Builder #30702
    Jeremy ParrottJeremy Parrott
    Participant

    Has there been any progress on this? I am currently having the same issue where the map.rendered tag is not displaying my map...

    Jeremy ParrottJeremy Parrott
    Participant

    Thanks, I got it working. The screenshot helped a lot!

    Jeremy ParrottJeremy Parrott
    Participant

    I've added the following code to my functions.php but it is not updating the title.

    add_action( 'rwmb_monitor_after_save_post', 'update_post_title' );
    
    function update_post_title( $post_id ) {
        // Get the field value
        $my_meta = rwmb_meta( 'monitor_number', '', $post_id );
    
        // Get the post title
        //$my_post_title = get_the_title( $post_id ); NOT NEEDED - I'M OVERWRITING THE TITLE
        
        // Preprare update post
        $my_post = array(
            'ID' => $post_id,
            'post_title' => $my_meta,
        );
    
        wp_update_post( $my_post );
    }

    My CPT slug is "monitor" and my field slug is "monitor_number".

    What am I doing wrong?

    in reply to: Tabs Doesn't Work #29968
    Jeremy ParrottJeremy Parrott
    Participant

    Are you guys still working on the dashicons bug?

    in reply to: Import data is possible with custom table extensión? #29857
    Jeremy ParrottJeremy Parrott
    Participant

    Any updates on how I can import my data? I have 7 custom tables with up to 100,000 rows. I just purchased the plugin so I know I have 14 days to figure this out, but I was hoping to replace Toolset with Meta Box specifically for the custom table functionality. However, if I cannot import my data, I don't see this as an option.

    Otherwise, I love your plugin so far!

Viewing 13 posts - 16 through 28 (of 28 total)