Changeset 2162
- Timestamp:
- 12/03/2015 09:33:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/glossary.php
r16 r2162 85 85 $glossary = new WP_Query( array( 'post_status' => 'publish', 'post_type' => 'glossary', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' ) ); 86 86 87 $content = '<style> .glossary-entry { margin-top: -50px; padding-top: 50px; } </style>';87 $content = "<style> .glossary-entry { margin-top: -50px; padding-top: 50px; } </style>\n"; 88 88 foreach ( $glossary->posts as $post ) { 89 $entry = trim( apply_filters( 'the_content', '<strong>' . apply_filters( 'the_title', $post->post_title ) . ':</strong> ' . $post->post_content ) ); 89 $entry = '<strong>' . apply_filters( 'the_title', $post->post_title ) . ':</strong> ' . $post->post_content; 90 90 91 $edit = get_edit_post_link( $post ); 91 if ( $edit ) 92 $edit = ' - <a href="' . $edit . '">edit</a>'; 93 // if ( '<p>' === substr( $entry, 0, 3 ) && '</p>' === substr( $entry, -4 ) ) 94 $entry = '<p class="glossary-entry" id="' . $post->post_name . '">' . substr( substr( $entry, 3 ), 0, -4 ) . ' <a href="' . get_permalink( $post ) . '">#</a>' . $edit . '</p>'; 92 if ( $edit ) { 93 $edit = ' - <a href="' . esc_url( $edit ) . '">edit</a>'; 94 } 95 $entry .= ' <a href="' . esc_url( get_permalink( $post ) ) . '">#</a>' . $edit; 96 97 $entry = apply_filters( 'the_content', $entry ); 98 $entry = '<div class="glossary-entry" id="' . esc_attr( $post->post_name ) . '">' . $entry . '</div>' . "\n"; 95 99 96 100 $content .= $entry;
Note: See TracChangeset
for help on using the changeset viewer.