[wp-trac] [WordPress Trac] #44194: Privacy Policy Page not editable by editor role

WordPress Trac noreply at wordpress.org
Sat May 26 12:18:32 UTC 2018


#44194: Privacy Policy Page not editable by editor role
--------------------------+------------------------
 Reporter:  Ov3rfly       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Privacy       |     Version:  4.9.6
 Severity:  normal        |  Resolution:  duplicate
 Keywords:                |     Focuses:
--------------------------+------------------------

Comment (by Ov3rfly):

 For interested readers, as long as editor role users can't edit the
 privacy policy page, instead of the core feature we are now using a simple
 custom solution for login and registration pages, which supports
 * multiple links,
 * the real post titles,
 * configurable order,
 * any post types
 {{{
 function my_login_footer() {
         $post_ids = get_posts( array(
                 'posts_per_page' => -1,
                 'post_type' => 'any',
                 'meta_key' => 'my_legal',
                 'order' => 'ASC',
                 'orderby' => 'meta_value_num',
                 'fields' => 'ids'
         ) );
         $links = array();
         foreach ( $post_ids as $post_id ) {
                 $links[] = '<a href="' . esc_url( get_permalink( $post_id
 ) ) . '" target="_top">' . get_the_title( $post_id ) . '</a>';
         }
         if ( !empty( $links ) ) {
                 echo '<p style="width:272px;margin:0 auto;">' . implode(
 $links, ' / ' ) . '</p>';
         }
 }
 add_action( 'login_footer', 'my_login_footer' );
 }}}
 Simply add a custom field `my_legal` with value `1` or `2` or other
 numeric order to any post you want to show.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44194#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list