Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 46 total)
  • Author
    Posts
  • in reply to: Exclude specific posts from MB View and Ordering #41263
    KaraKara
    Participant

    Hi Peter -
    Thanks for getting back to me ๐Ÿ™‚

    Let me clarify a bit more on my first question:

    The code above is for a view embedded via shortcode on all Speaker Pages.
    It shows the topics that speaker is assigned to.

    Some speakers are assigned to 5 topics, but I only want to display 2.
    -->How do I exclude those 3 other topics from the view?

    I don't want to remove the relationship between the Speaker and Topic for those other 3 because I rely on that relationship on other pages of the site.

    Thank you!

    KaraKara
    Participant

    +1 for this!

    in reply to: Metabox Group Skin - Elementor Template #36862
    KaraKara
    Participant

    Hi Long - thanks for that, but I'm not totally following.

    How do I assign it when creating a MetaBox group skin?

    I'm specifically trying to use the Social Media Widget from Elementor
    Screenshot: https://tinyurl.com/2fmlps87

    in reply to: Metabox Group Subfields not Showing on Elementor #36518
    KaraKara
    Participant

    Hi is there any update on supporting Group Subfields?
    I'm specifically needing to pull URL fields.

    I understand it's a big task but thought I'd check before I change my fields ๐Ÿ™‚

    Thank you.

    KaraKara
    Participant

    Hi Long - see below. I did notice that I had "candidate" instead of "candidates" in my snippet. I updated that but it didn't fix the issue.

    The CPT is "Candidate" and featured image is enabled.
    The Custom field group id is "Candidate"

    For the field group:

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = '';
    
        $meta_boxes[] = [
            'title'      => __( 'Candidates', 'your-text-domain' ),
            'id'         => 'candidates',
            'post_types' => ['candidate'],
            'fields'     => [
                [
                    'name' => __( 'First Name', 'your-text-domain' ),
                    'id'   => $prefix . 'first_name',
                    'type' => 'text',
                ],
                [
                    'name' => __( 'Last Name', 'your-text-domain' ),
                    'id'   => $prefix . 'last_name',
                    'type' => 'text',
                ],
                [
                    'name'             => __( 'Headshot', 'your-text-domain' ),
                    'id'               => $prefix . ' _thumbnail_id',
                    'type'             => 'image_upload',
                    'image_size'       => 'medium_large',
                    'max_file_uploads' => 1,
                    'force_delete'     => true,
                    'max_status'       => false,
                ],
                [
                    'type' => 'divider',
                ],
                [
                    'name'              => __( 'Candidate Statement', 'your-text-domain' ),
                    'id'                => $prefix . 'candidate_statement',
                    'type'              => 'wysiwyg',
                    'label_description' => __( 'Please tell us why you wish to service in this office. You may include actions you wish to promote, or anything you would like members to know. Limit 500 words.', 'your-text-domain' ),
                    'required'          => true,
                ],
                [
                    'type' => 'divider',
                ],
                [
                    'name'              => __( 'Relevant Experience', 'your-text-domain' ),
                    'id'                => $prefix . 'relevant_experience',
                    'type'              => 'wysiwyg',
                    'label_description' => __( 'Please describe your relevant experience - what you bring to the office. Limit 500 words.', 'your-text-domain' ),
                    'required'          => true,
                ],
                [
                    'type' => 'divider',
                ],
                [
                    'name'   => __( 'Social Media', 'your-text-domain' ),
                    'id'     => $prefix . 'social_media',
                    'type'   => 'group',
                    'fields' => [
                        [
                            'name' => __( 'LinkedIn Profile', 'your-text-domain' ),
                            'id'   => $prefix . 'linkedin_profile',
                            'type' => 'url',
                        ],
                        [
                            'name' => __( 'Twitter Handle', 'your-text-domain' ),
                            'id'   => $prefix . 'twitter_handle',
                            'type' => 'url',
                        ],
                        [
                            'name' => __( 'Facebook Profile', 'your-text-domain' ),
                            'id'   => $prefix . 'facebook_profile',
                            'type' => 'url',
                        ],
                        [
                            'name' => __( 'Reddit Handle', 'your-text-domain' ),
                            'id'   => $prefix . 'reddit_handle',
                            'type' => 'url',
                        ],
                    ],
                ],
                [
                    'type' => 'divider',
                ],
                [
                    'name'       => __( 'Organizational Affiliations', 'your-text-domain' ),
                    'id'         => $prefix . 'organizational_affiliations',
                    'type'       => 'group',
                    'clone'      => true,
                    'add_button' => __( 'Add another organization', 'your-text-domain' ),
                    'fields'     => [
                        [
                            'name' => __( 'Name of Organization', 'your-text-domain' ),
                            'id'   => $prefix . 'name_of_organization',
                            'type' => 'text',
                        ],
                        [
                            'name' => __( 'Your Role', 'your-text-domain' ),
                            'id'   => $prefix . 'your_role',
                            'type' => 'text',
                        ],
                    ],
                ],
                [
                    'type' => 'divider',
                ],
                [
                    'name'     => __( 'Skills and experience you can bring', 'your-text-domain' ),
                    'id'       => $prefix . 'skills_and_experience_you_can_bring',
                    'type'     => 'checkbox_list',
                    'options'  => [
                        'Board development'               => __( 'Board development', 'your-text-domain' ),
                        'Program development'             => __( 'Program development', 'your-text-domain' ),
                        'Financial management'            => __( 'Financial management', 'your-text-domain' ),
                        'Staffing / HR'                   => __( 'Staffing / HR', 'your-text-domain' ),
                        'Fundraising'                     => __( 'Fundraising', 'your-text-domain' ),
                        'Strategic planning'              => __( 'Strategic planning', 'your-text-domain' ),
                        'Lobbying/Legislation'            => __( 'Lobbying/Legislation', 'your-text-domain' ),
                        'Training'                        => __( 'Training', 'your-text-domain' ),
                        'Marketing'                       => __( 'Marketing', 'your-text-domain' ),
                        'Volunteer management'            => __( 'Volunteer management', 'your-text-domain' ),
                        'Other Skills (not listed above)' => __( 'Other Skills (not listed above)', 'your-text-domain' ),
                    ],
                    'required' => true,
                ],
                [
                    'name'              => __( 'Additional skill not listed above', 'your-text-domain' ),
                    'id'                => $prefix . 'additional_skill_not_listed_above',
                    'type'              => 'text',
                    'label_description' => __( 'One per line', 'your-text-domain' ),
                    'clone'             => true,
                    'add_button'        => __( 'Add another skill', 'your-text-domain' ),
                ],
                [
                    'type' => 'divider',
                ],
                [
                    'name'     => __( 'Declaration of Accuracy', 'your-text-domain' ),
                    'id'       => $prefix . 'declaration_of_accuracy',
                    'type'     => 'checkbox_list',
                    'options'  => [
                        'I hereby declare that the information provided is true and correct. I also understand that any willful dishonesty may lead to removal from the election process and the NSITSP at large.' => __( 'I hereby declare that the information provided is true and correct. I also understand that any willful dishonesty may lead to removal from the election process and the NSITSP at large.', 'your-text-domain' ),
                    ],
                    'required' => true,
                ],
            ],
        ];
    
        return $meta_boxes;
    }

    My current validation snippet:

    add_filter( 'rwmb_frontend_validate', function( $validate, $config ) {
        if ( 'candidates' !== $config['id'] ) {
            return $validate;
        }
        if ( empty( $_POST['_thumbnail_id'] ) ) {
            $validate = 'Please select at least one image to upload'; // Return a custom error message
        }
        return $validate;
    }, 10, 2 );
    KaraKara
    Participant

    Thanks Long -

    I made the changes but the image is still not saving to the post, or as a featured image.
    It is, however, saving to the Media Library.

    add_filter( 'rwmb_frontend_validate', function( $validate, $config ) {
        if ( 'candidate' !== $config['id'] ) {
            return $validate;
        }
        if ( empty( $_POST['_thumbnail_id'] ) ) {
            $validate = 'Please select at least one image to upload'; // Return a custom error message
        }
        return $validate;
    }, 10, 2 );

    In case it's useful, here are screenshots of the custom field:
    https://www.awesomescreenshot.com/image/28499524?key=8ff840b5f2d8f12f5597455d36426661
    https://www.awesomescreenshot.com/image/28499595?key=21ed4f1eb276c229c449d473d04f1a16

    KaraKara
    Participant

    Hi Long - can you break this down a bit for me?

    I have a custom field set for a CPT. This set includes an Image Upload with these settings:
    - ID: _thumbnail_id
    - Max number of files: 1

    I have a snippet with the following where "candidate" is the Field Group ID:

    add_filter( 'rwmb_frontend_validate', function( $validate, $config ) {
        if ( 'candidate' !== $config['_thumbnail_id'] ) {
            return $validate;
        }
        if ( empty( $_POST['image_upload_field'] ) ) {
            $validate = 'Please select at least one image to upload'; // Return a custom error message
        }
        return $validate;
    }, 10, 2 );

    Can you tell me where I went wrong? The image is not saving to the post at all (as a regular field or as a Featured Image). This is true when using the front-end form or when editing the post from the backend.

    Thanks in advance for your help!

    in reply to: โœ…CSS not working for views #32803
    KaraKara
    Participant

    Thanks, Long! As always, appreciate your help ๐Ÿ™‚

    in reply to: โœ…CSS not working for views #32776
    KaraKara
    Participant

    Great - thanks, Long!

    Do you have an ETA for this fix, or in the meantime, is there a place I can download AIO 1.15.2 until it's available?

    in reply to: โœ…CSS not working for views #32724
    KaraKara
    Participant

    Yes - it's in the CSS tab of the View.

    It worked perfectly before updating the MB AIO plugin. I see in the changelog from 12/15 this update:

    1.15.3 - 2021-12-15
    MB VIEWS
    Output CSS in header if possible to make HTML validated

    Is it possible this update is causing the issue?
    I did update to WooCommerce 6.0 at the same time, but deactivating WooCommerce doesn't fix the CSS issue.

    I'd be happy to roll back the version of AIO but my local copy is 1.13.7 - is there somewhere to download previous versions?

    You can view the output here: https://www.itspu.com/shop/service-agreements-for-smb-consultants/ under the "Instructor" tab. I don't see any of the CSS in the inspector.

    Note this is a dev site.

    in reply to: โœ…Controlling post status in front end dashboard #31737
    KaraKara
    Participant

    Thanks Long - that works perfectly.

    By the way - the capitalized "Draft" and "Publish" was produced when I generated the code using MetaBox AIO. I just manually changed it to use lowercase, but the code to update the post status worked for me either way.

    Appreciate you help ๐Ÿ™‚

    in reply to: โœ…Controlling post status in front end dashboard #31721
    KaraKara
    Participant

    Hi Long - can you help me out with the function to update the post status? Users should be able to change a status to draft or published based on the radio buttons.

    Here's the code for the radio buttons.

     [
                    'name'     => __( 'Save As', 'your-text-domain' ),
                    'id'       => $prefix . 'save_as',
                    'type'     => 'radio',
                    'options'  => [
                        'Draft'   => __( 'Draft', 'your-text-domain' ),
                        'Publish' => __( 'Publish', 'your-text-domain' ),
                    ],
                    'std'      => 'Draft',
                    'required' => true,
                    'inline'   => false,
                ],

    Thanks a lot!

    in reply to: โœ…Add New post to existing CPT > White Screen #27436
    KaraKara
    Participant

    Hi Long -

    Yes, that was it. I had forgotten I had added a custom taxonomy with the slug: type last week. I recall seeing in the changelog that the plugin will now error when trying to use a reserved slug and sure enough, when I just checked on this, I see the error message.

    I've deleted the taxonomy and the problem is fixed.

    Thanks for your help!

    in reply to: โœ…Add New post to existing CPT > White Screen #27429
    KaraKara
    Participant

    Debug:
    Deactivating all but Meta box/Meta Box AIO --> same results as above

    WP Debug gives the following:

    Notice: register_taxonomy was called incorrectly. The "type" taxonomy "name" property (type) conflicts with an existing property on the REST API Posts Controller. Specify a custom "rest_base" when registering the taxonomy to avoid this error. Please see Debugging in WordPress for more information. (This message was added in version 5.4.0.) in /wordpress/wp-includes/functions.php on line 5313 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132 Warning: Illegal offset type in /wordpress/wp-includes/post.php on line 1953 Warning: Illegal offset type in /wordpress/wp-includes/post.php on line 1953 Warning: Illegal offset type in /wordpress/wp-includes/post.php on line 1953 Warning: Illegal offset type in /wordpress/wp-includes/post.php on line 1953 Notice: Undefined index: id in /www/wp-content/plugins/meta-box-aio/vendor/meta-box/mb-rest-api/class-mb-rest-api.php on line 132

    There shouldn't be anything else (besides this CPT) using "coaching" as it's taxonomy.

    in reply to: โœ…How to output a shortcode? #27237
    KaraKara
    Participant

    Hi Long - thanks for your quick response.

    Let me clarify - I don't want to create a shortcode of the Meta Box custom field, I need to add an existing shortcode from another plugin (in this case to show a registration form on the front end).

    Here's my workflow:
    Create CPT > Add custom field for shortcode > copy/paste registration form shortcode into custom field > registration form is visible on the front end.

    If it matters, I'll be using Elementor to pull the custom fields to a template for the CPT.

    Maybe there is a function I can add to my theme file to let me add shortcodes to the custom HTML field?

Viewing 15 posts - 31 through 45 (of 46 total)