Changeset 8867 for sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/glossary.php
- Timestamp:
- 05/23/2019 11:49:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/glossary.php
r7935 r8867 91 91 $glossary = new WP_Query( array( 'post_status' => 'publish', 'post_type' => 'glossary', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' ) ); 92 92 93 $content = "<style> .glossary-entry { margin-top: -50px; padding-top: 50px; } </style>\n"; 93 $content = "<style>dl.glossary-list dd { margin-top: -50px; padding-top: 50px; }</style>\n"; 94 $content .= '<dl class="glossary-list">'; 94 95 foreach ( $glossary->posts as $post ) { 95 $entry = '<strong>' . apply_filters( 'the_title', $post->post_title ) . ':</strong> ' . $post->post_content; 96 $entry = '<dt id="' . esc_attr( $post->post_name ) . '">' . apply_filters( 'the_title', $post->post_title ) . '</dt>'; 97 $entry .= '<dd>' . $post->post_content; 96 98 97 99 $edit = get_edit_post_link( $post ); … … 99 101 $edit = ' - <a href="' . esc_url( $edit ) . '">edit</a>'; 100 102 } 101 $entry .= ' <a href="' . esc_url( get_permalink( $post ) ) . '">#</a>' . $edit ;103 $entry .= ' <a href="' . esc_url( get_permalink( $post ) ) . '">#</a>' . $edit . '</dd>'; 102 104 103 105 $entry = apply_filters( 'the_content', $entry ); 104 $entry = '<div class="glossary-entry" id="' . esc_attr( $post->post_name ) . '">' . $entry . '</div>' . "\n";105 106 106 $content .= $entry ;107 $content .= $entry . "\n"; 107 108 } 109 $content .= '</dl>'; 110 108 111 if ( current_user_can( get_post_type_object('glossary')->cap->edit_posts ) ) 109 112 $content .= '<p><a href="' . admin_url( 'post-new.php?post_type=glossary' ) . '">add new entry</a>'; 113 110 114 return $content; 111 115 }
Note: See TracChangeset
for help on using the changeset viewer.