Changeset 1232305
- Timestamp:
- 08/27/2015 04:12:43 PM (11 years ago)
- File:
-
- 1 edited
-
simple-wp-glossary/trunk/simple-wp-glossary.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-wp-glossary/trunk/simple-wp-glossary.php
r1232303 r1232305 11 11 add_filter( 'the_content', 'wr_swpg_add_definitions' ); 12 12 add_action( 'wp_enqueue_scripts', 'wr_swpg_enqueue_js' ); 13 add_action( 'init', 'wr_swpg_cpt' ); 13 14 14 15 function wr_swpg_add_definitions( $content ) { … … 21 22 $replacements[] = "<dfn title=\"{$definition}\">$1</dfn>"; 22 23 } 23 return preg_replace( $regex, $replacements, $content, 1 ); 24 return preg_replace( $regex, $replacements, $content, 1 ); 24 25 } else { 25 26 return $content; … … 28 29 29 30 function wr_swpg_get_glossary_items() { 30 $args = array( 31 $args = array( 31 32 'post_type' => 'glossary', 32 33 'post_status' => 'publish', … … 50 51 wp_enqueue_style( 'wr-swpg', $src, false, null ); 51 52 } 53 54 function wr_swpg_cpt() { 55 $labels = array( 56 'name' => 'Glossary items', 57 'singular_name' => 'Glossary item', 58 ); 59 60 $args = array( 61 'labels' => $labels, 62 'description' => 'Defining terms', 63 'public' => true, 64 'show_ui' => true, 65 'has_archive' => false, 66 'show_in_menu' => true, 67 'exclude_from_search' => false, 68 'capability_type' => 'post', 69 'map_meta_cap' => true, 70 'hierarchical' => false, 71 'rewrite' => array( 'slug' => 'glossary', 'with_front' => true ), 72 'query_var' => true, 73 'supports' => array( 'title', 'excerpt' ), 74 ); 75 76 register_post_type( 'glossary', $args ); 77 }
Note: See TracChangeset
for help on using the changeset viewer.