Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 2,866 through 2,880 (of 3,702 total)
  • Author
    Posts
  • in reply to: Metas for Attachment Post Type #5037
    Anh TranAnh Tran
    Keymaster

    I'm afraid not. The "Attactment Details" popup is created and triggered by JavaScript, while most of our work is PHP.

    in reply to: Include Exclude not working in MB Builder #5036
    Anh TranAnh Tran
    Keymaster

    This is the list of supported conditions for Include Exclude extension. But if you use it for user profile (with User Meta extension), then you can use only "user_role" and "user_id".

    If you want to show/hide fields for a certain ID/groups, you should use the Conditional Logic extension.

    See this for the difference between Include/Exclude and Conditional Logic.

    Regarding the 2nd question about MB Admin Columns: currently it works only for posts, pages and custom post types.

    Anh TranAnh Tran
    Keymaster

    Hi Tami, can you please post a screenshot for the Page/Post Attributes? I can't find it in the MB Builder extension.

    in reply to: Define the Order of the meta box #5033
    Anh TranAnh Tran
    Keymaster

    You can define the order of your meta boxes only. Doing that by organizing the PHP code.

    It's impossible to change the order of other sections in the user profile page, because they's hardcoded by WordPress or other plugins.

    in reply to: Define Metas for certain role (Contributor) #5032
    Anh TranAnh Tran
    Keymaster

    Using current_user_can only checks for the role of the current user, not the role of the being edited user. The MB Include Exclude extension can handle that.

    To make a field required, you can simply add 'required' => true. Docs here and here.

    in reply to: Custom_html callback markup is broken #5031
    Anh TranAnh Tran
    Keymaster

    If you want the callback print the content, you can try output buffering, like this:

    function hello() {
         ob_start();
         echo 'Your content';
         return ob_get_clean();
    }

    This makes the logic of the plugin consistent ('std' vs 'callback').

    in reply to: Include Exclude not working in MB Builder #5030
    Anh TranAnh Tran
    Keymaster

    Just go to your "My Account" page (click on your avatar) and download the "MB Include Exclude" extension.

    Also, read this guide to know about automatic update.

    in reply to: Define Metas for certain role (Contributor) #5023
    Anh TranAnh Tran
    Keymaster

    Hi, I've just updated the Include Exclude extension to support "user_role" and "user_id" rules. Please try this.

    in reply to: Include Exclude not working in MB Builder #5022
    Anh TranAnh Tran
    Keymaster

    Hi Dave,

    I've just updated the Include Exclude extension. It works with the MB User Meta extension now.

    in reply to: Define Metas for certain role (Contributor) #5011
    Anh TranAnh Tran
    Keymaster

    Hi, I will work on the Include Exclude extension for that. Currently, it has "user_role" rule (include/exclude meta boxes for a certain user role), but hasn't worked with MB User Meta yet.

    in reply to: โœ…Remove Cloned Field Conditional #4999
    Anh TranAnh Tran
    Keymaster

    That works but it affects your performance as the action "check-update" runs on every request to your website. This triggers the query to the database. Running only on your settings page reduces the load. But that also means the value is updated only when users visit the settings page, so it's kind of manual reset.

    in reply to: New plugin suggestion #4998
    Anh TranAnh Tran
    Keymaster

    Ah, I got it. I will check that ๐Ÿ™‚

    Thanks for your suggestion!

    in reply to: Custom_html callback markup is broken #4997
    Anh TranAnh Tran
    Keymaster

    Here it is:

    function hello() {
        return '<b style="color:red;">Hello</b>';
    }
    in reply to: rwmb_meta_boxes filter #4984
    Anh TranAnh Tran
    Keymaster

    Hi,

    How do you get the $post_id and how do you use the code above inside your code to register meta boxes?

    in reply to: โœ…Remove Cloned Field Conditional #4983
    Anh TranAnh Tran
    Keymaster

    I got it. In this case, the problem is handling the "saved meta value". I'd suggest using WP cron to perform a regular check on the meta value (posts). When a condition occurs (date is passed), then update the meta value.

    This is the pseudo code:

    register_activation_hook(__FILE__, 'prefix_activation');
    
    function prefix_activation() {
        if (! wp_next_scheduled ( 'prefix_daily_check' )) {
    	wp_schedule_event(time(), 'hourly', 'prefix_daily_check');
        }
    }
    
    add_action('prefix_daily_check', 'prefix_update_posts_daily');
    function prefix_update_posts_daily() {
        $now = time();
        $option = get_option( 'featured_position_1' );
        foreach ( $option as $key => $value ) {
            if ( $time > strtotime( $value['featured_item_1_schedule_start'] ) ) {
                unset( $option[$key] );
            }
        }
        update_option( 'featured_position_1', $option );
    }
Viewing 15 posts - 2,866 through 2,880 (of 3,702 total)