• Resolved RS

    (@rsdotscot)


    Hi there,

    First off, happy new year, I hope it’s been a good one ??

    I’m looking to limit the ordering functionality to administrators only on a site I’m working on. I’ve tried removing the hooks wp_ajax_simple_page_ordering and wp_ajax_reset_simple_page_ordering for editor users, but it’s been ineffective. Any suggestions?

    Cheers,
    RS

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Siddharth Thevaril

    (@nomnom99)

    Hey Happy New Year!

    You can use the simple_page_ordering_is_sortable filter this way:

    /**
     * Limits the ability to sort pages to users with the administrator role.
     *
     * @param bool $sortable Whether or not the pages are sortable.
     */
    function spo_limit_sorting_by_role( $sortable ) {
        return current_user_can( 'administrator' );
    }
    add_filter( 'simple_page_ordering_is_sortable', 'spo_limit_sorting_by_role' );
    • This reply was modified 10 months, 4 weeks ago by Siddharth Thevaril. Reason: improved suggestion
    Thread Starter RS

    (@rsdotscot)

    Perfect, that works exactly as needed ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limiting ordering to administrators only’ is closed to new replies.