Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,521 through 2,535 (of 3,839 total)
  • Author
    Posts
  • PeterPeter
    Moderator

    Hello,

    Follow the WordPress documentation https://developer.wordpress.org/reference/functions/update_post_meta/
    you have to pass the post/page ID to the function update_post_meta() to update the field value (post meta) for a post/page.

    If you want to update that value for all posts/pages, please create a custom WP query to get posts/pages and use the function update_post_meta() in the loop. You can read more about WP query here https://developer.wordpress.org/reference/classes/wp_query/

    PeterPeter
    Moderator

    There are two issues on your site:

    1. The code is added inside an if statement and the condition is not true so the code is not executed. Screenshot https://imgur.com/bSTMLbH

    2. The field group Location Details has the field ID prefix location_details so the field image_of_town_1 in this field group has the correct ID location_detailsimage_of_town_1. The code should be

        if ( $field['id'] == 'location_detailsimage_of_town_1' && is_admin() ) {
    

    I fixed those issues on your site and now it works fine.

    PeterPeter
    Moderator

    Hello,

    Please share your site admin account via this contact form https://metabox.io/contact/
    I will take a closer look.

    PeterPeter
    Moderator

    Hello,

    The code works fine on my local site, here is the screen record https://drive.google.com/file/d/1mdEJhBQdb5XB6xik_fEsR0ymQP5DPwFa/view?usp=sharing

    You can try to add the code to the file functions.php in the theme/child theme folder and deactivate all other plugins except Meta Box, MB plugins to see if it works.

    PeterPeter
    Moderator

    Strange. Please share your site credentials via this contact form https://metabox.io/contact/
    I will take a closer look.

    in reply to: No A #42767
    PeterPeter
    Moderator

    Hello,

    Can you please share some screenshots of the capabilities for the custom role? Or you can try to contact User Role Editor support to get more information.

    PeterPeter
    Moderator

    Hello,

    It is possible. You can create a custom callback function to get the settings page value and return an array of values and labels. For example:

    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    function your_prefix_function_name( $meta_boxes ) {
        $meta_boxes[] = [
            'title'  => __( 'My Custom Fields', 'your-text-domain' ),
            'id'     => 'my-custom-fields',
            'fields' => [
                [
                    'type'          => 'select_advanced',
                    'name'          => esc_html__( 'Supervisor', 'apms' ),
                    'id'            => 'supervisor_id',
                    'options'       => my_func9999(),
                ]
            ],
        ];
        return $meta_boxes;
    }
    
    function my_func9999() {
        $settings_page = get_option( 'option_name' );
        // do your stuff
        return [
                'a' => 'A',
                1 => 1,
                2 => 2,
                'b' => 'B'
           ];
    }
    PeterPeter
    Moderator

    Hello,

    I think it's good, except for one point, it could not work because the settings page is not a post type. So you should remove this condition

    get_post_type( $object_id ) === 'settings_page'

    in reply to: Conditional Logic - Advanced Taxonomy with 2 rules #42761
    PeterPeter
    Moderator

    Hello,

    If a field training_category or community_category is shown/hidden by another conditional logic then the second logic does not work. This issue has been escalated to the development team and they are still working on it. Hopefully, it will be fixed soon.

    in reply to: Woocommerce & Tabs #42760
    PeterPeter
    Moderator

    Hello Joe,

    First, you need to remove the default product description and product excerpt by using this code

    add_action( 'init', function () {
        remove_post_type_support( 'product', 'editor' );
    } );
    
    function remove_short_description() {
         remove_meta_box( 'postexcerpt', 'product', 'normal');
    }
    add_action('add_meta_boxes', 'remove_short_description', 999);

    Then register two custom fields with the ID content and excerpt and put them anywhere in a field group then assign the field group to the Product post type.

    $meta_boxes[] = [
        'title'      => __( 'Product meta', 'your-text-domain' ),
        'id'         => 'product-meta',
        'post_types' => ['product'],
        'fields'     => [
            [
                'name' => __( 'Product Content', 'your-text-domain' ),
                'id'   => 'content',
                'type' => 'wysiwyg',
            ],
            [
                'name' => __( 'Product Excerpt', 'your-text-domain' ),
                'id'   => 'excerpt',
                'type' => 'wysiwyg',
            ],
        ],
    ];
    PeterPeter
    Moderator

    Hello,

    Meta Box supports adding the value in the admin area and outputting it in the frontend. In your case, it is possible. You can output all descriptions in your form and show/hide each description based on the type of travel selection with Javascript code, like tabs/accordion.

    Read more in the documentation https://docs.metabox.io/extensions/mb-settings-page/

    PeterPeter
    Moderator

    Hello,

    If you want to update the image on the settings page to the image custom field on a/some posts, you can try to use the action hook rwmb_{$field_id}_after_save_field. Follow the documentation https://docs.metabox.io/actions/rwmb-after-save-field/

    If you just want to display the image on the frontend, you can use the shortcode. For example:

    [rwmb_meta id="image_field_id" object_id="settings_page_option" object_type="setting"]

    Follow the documentation https://docs.metabox.io/shortcode/

    in reply to: Conditional Logic - Advanced Taxonomy with 2 rules #42755
    PeterPeter
    Moderator

    Hello,

    I've tested this case on my demo site but do not see any issues. Please try to deactivate all plugins except Meta Box, MB extension plugins, switch to a standard theme and remove all other field groups then check this again.

    in reply to: confirmation-email.php #42754
    PeterPeter
    Moderator

    Hello,

    Please go to the My Account page and download a fresh version of MB User Profile 2.4.1 and re-install it on your site then let me know how it goes.

    PeterPeter
    Moderator

    Hello,

    Can you please share a screenshot of the description field in the Blog Meta Box field group? The option "Save field value" needs to be enabled to display the field value.

Viewing 15 posts - 2,521 through 2,535 (of 3,839 total)