BuddyDev

Search

[Resolved] Prevent users’ access to other pages and articles

Tagged: 

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #41459

    Hi,

    I am using BuddyBoss

    Is there any way to prevent users from accessing Pages or Articles that are not created by them when they insert / edit a link?
    In my case (because I also have listings on the site) the best solution is to eliminate the related fields.
    Please see the image https://ibb.co/gVQy83f

    Thank you

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #41461

    Hi,
    Or the best ( for me ) would be to remove the button completely.
    https://ibb.co/LPwPCh1
    Thank you

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #41477

    Hello Niculae,

    Please try the following code. It will remove the link button from the editor toolbar.

    
    
    /**
     * Remove editr link button
     *
     * @param array $buttons Buttons list.
     *
     * @return array
     */
    function buddydev_remove_editor_link_button ( $buttons ) {
    	$buttons = array_diff( $buttons, array( 'link' ) );
    
    	return $buttons;
    }
    
    /**
     * Hook before rendering form fields.
     */
    function buddydev_before_form_before_form_fields() {
    	add_filter( 'mce_buttons', 'buddydev_remove_editor_link_button' );
    }
    
    /**
     * Hook after rendering form fields.
     */
    function buddydev_after_form_before_form_fields() {
    	remove_filter( 'mce_buttons', 'buddydev_remove_editor_link_button', 10 );
    }
    
    add_action( 'bblpro_form_before_form_fields', 'buddydev_before_form_before_form_fields' );
    add_action( 'bblpro_form_after_form_fields', 'buddydev_after_form_before_form_fields' );
    

    Regards
    Ravi

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #41481

    Hi,
    The code is perfect.
    Please tell me how to remove the Insert Read More Button as for me there is not point have it there.
    https://ibb.co/YyS4jvM
    Thank you

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #41490

    Hello Niculae,

    Thank you for the acknowledgement. Please update the following line of code:

    use

    
    $buttons = array_diff( $buttons, array( 'link', 'wp_more' ) );
    

    instead of

    
    $buttons = array_diff( $buttons, array( 'link' ) );
    

    Regards
    Ravi

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #41520

    Hi,

    The code is very good.

    However a user still can insert Links and Read More if he use Shortcuts.

    So it would be prefect if you can disable the shortcuts for Insert Link ( Ctrl+k ) and Read More ( Shift+Alt+T ).

    If it is not to much trouble it would also be best if you can remove the Help button and its shortcut ( Shift+Alt+H ).

    Thank you

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #41529

    Hello Niculae,

    Thank you for the acknowledgement. Sorry, But I can not help you much with this issue. For suggestion, Why don’t you disable the editor in the content field?

    Regards
    Ravi

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #41530
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 24212
    Brajesh Singh on #41533

    Hi Niculae,
    Please visit the BuddyBlog->Forms and edit the form.

    In the Post fields section, Please delete “Content” field and then add the “Content” field. while adding it, there should be an option for the same.

    Regards
    Brajesh

  • Participant
    Level: Master
    Posts: 196
    Niculae Constantinescu on #41535
    This reply has been marked as private.

The topic ‘ [Resolved] Prevent users’ access to other pages and articles’ is closed to new replies.

This topic is: resolved