• Resolved nickwilmot

    (@nickwilmot)


    Love the new block access settings.

    Please could you consider making the ‘global’ Restricted Access Block Message message field in the settings accept HTML and shortcodes, like the Restricted Access Message global setting above it does?

    The ‘custom message’ option on the block settings will actually allow HTML and shortcodes, so it would make sense for the global setting to as well.

    I’d like to be able to add a <h2> element and a login form shortcode to prompt users to login from the block position.

    Thanks again for a great plugin,
    Nick

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @nickwilmot

    You can try adding the following code snippets to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code:

    
    add_filter("um_settings_map","um_120721_map_block_content_message");
    function um_120721_map_block_content_message( $map ){
        $map['restricted_block_message']['sanitize'] = 'wp_kses';
    
        return $map;
    }
    
    add_filter("um_settings_structure","um_120721_accept_block_content_html");
    function um_120721_accept_block_content_html( $fields ){
        $arr_fields = $fields['access']['sections']['']['fields'];
        foreach( $arr_fields as $i => $field ){
            if( "restricted_block_message" == $field['id'] ){
                $fields['access']['sections']['']['fields'][ $i ]["type"] = "wp_editor";
            }
        }
        return $fields;
    }

    The above code will enable the “Restricted Access Block Message” field to accept HTML as well as enable the WP Editor.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    To enable the shortcode, please add this code snippet:

    add_filter("um_get_option_filter__restricted_block_message",function( $value ){
        if( is_admin() ) return $value;
    
        if ( version_compare( get_bloginfo('version'),'5.4', '<' ) ) {
            return do_shortcode( $value );
        } else {
            return apply_shortcodes( $value );
        }
    
        return $value;
    });

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hey there!

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

    Thread Starter nickwilmot

    (@nickwilmot)

    Many thanks for this, I’ll give it a whirl. Perhaps this is something that could be adopted in an upcoming release?

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @nickwilmot

    I’ve created an issue for this on our public Github repository:
    https://github.com/ultimatemember/ultimatemember/issues/956

    Regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Full WYSIWYG for Restricted Access Block Message’ is closed to new replies.