Changeset 3225
- Timestamp:
- 05/24/2016 04:49:07 AM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-plugin-categories.php
r3223 r3225 3 3 4 4 /** 5 * The Plugin Tags metabox5 * The Plugin Categories metabox 6 6 * 7 7 * @package WordPressdotorg\Plugin_Directory\Admin\Metabox 8 8 */ 9 class Plugin_ Tags {9 class Plugin_Categories { 10 10 /** 11 * Displays the Tags metabox for plugins.11 * Displays the categories metabox for plugins. 12 12 * The HTML here matches what Core uses. 13 13 * … … 16 16 static function display( $post ) { 17 17 ?> 18 <div id="taxonomy-plugin_ tag" class="categorydiv">19 <div id="plugin_ tag-all" class="tabs-panel">18 <div id="taxonomy-plugin_category" class="categorydiv"> 19 <div id="plugin_category-all" class="tabs-panel"> 20 20 <?php // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks. ?> 21 <input type='hidden' name='tax_input[plugin_ tag][]' value='0' />22 <ul id="plugin_tagchecklist" data-wp-lists="list:plugin_ tag" class="categorychecklist form-no-clear">23 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => 'plugin_ tag' ) ); ?>21 <input type='hidden' name='tax_input[plugin_category][]' value='0' /> 22 <ul id="plugin_tagchecklist" data-wp-lists="list:plugin_category" class="categorychecklist form-no-clear"> 23 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => 'plugin_category' ) ); ?> 24 24 </ul> 25 25 </div> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-capabilities.php
r3175 r3225 77 77 'plugin_dashboard_access' => true, 78 78 'plugin_edit_own' => true, 79 'plugin_set_ tags' => true,79 'plugin_set_category' => true, 80 80 'plugin_add_committer' => true, 81 81 'plugin_edit_others' => true, … … 93 93 'plugin_disable' => true, 94 94 'plugin_close' => true, 95 'plugin_set_ category' => true, // Special categories.95 'plugin_set_section' => true, // Special categories. 96 96 'manage_categories' => true, // Let them assign these special categories. 97 97 ) ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r3221 r3225 24 24 add_action( 'widgets_init', array( $this, 'register_widgets' ) ); 25 25 add_filter( 'post_type_link', array( $this, 'package_link' ), 10, 2 ); 26 add_filter( 'term_link', array( $this, 'term_link' ), 10, 3 ); 26 27 add_filter( 'pre_insert_term', array( $this, 'pre_insert_term_prevent' ) ); 27 28 add_action( 'pre_get_posts', array( $this, 'use_plugins_in_query' ) ); … … 95 96 ) ); 96 97 97 register_taxonomy( 'plugin_ category', 'plugin', array(98 register_taxonomy( 'plugin_section', 'plugin', array( 98 99 'hierarchical' => true, 99 'query_var' => 'plugin_ category',100 'query_var' => 'plugin_section', 100 101 'rewrite' => false, 101 102 'public' => true, 102 'show_ui' => current_user_can( 'plugin_set_ category' ),103 'show_admin_column' => current_user_can( 'plugin_set_ category' ),103 'show_ui' => current_user_can( 'plugin_set_section' ), 104 'show_admin_column' => current_user_can( 'plugin_set_section' ), 104 105 'meta_box_cb' => 'post_categories_meta_box', 105 106 'capabilities' => array( 106 'assign_terms' => 'manage_categories', 107 ) 108 ) ); 109 110 register_taxonomy( 'plugin_tag', 'plugin', array( 107 'assign_terms' => 'plugin_set_section', 108 ), 109 'labels' => array( 110 'name' => __( 'Plugin Sections', 'wporg-plugins' ), 111 ), 112 ) ); 113 114 register_taxonomy( 'plugin_category', 'plugin', array( 111 115 'hierarchical' => true, /* for tax_input[] handling on post saves. */ 112 'query_var' => 'plugin_ tag',116 'query_var' => 'plugin_category', 113 117 'rewrite' => array( 114 118 'hierarchical' => false, 115 'slug' => ' tags',119 'slug' => 'category', 116 120 'with_front' => false, 117 121 'ep_mask' => EP_TAGS, 118 122 ), 119 123 'labels' => array( 120 'name' => __( 'Plugin Tags', 'wporg-plugins' ),121 'singular_name' => __( 'Plugin Tag', 'wporg-plugins' ),122 'edit_item' => __( 'Edit Tag', 'wporg-plugins' ),123 'update_item' => __( 'Update Tag', 'wporg-plugins' ),124 'add_new_item' => __( 'Add New Tag', 'wporg-plugins' ),125 'new_item_name' => __( 'New TagName', 'wporg-plugins' ),126 'search_items' => __( 'Search Tags', 'wporg-plugins' ),124 'name' => __( 'Plugin Categories', 'wporg-plugins' ), 125 'singular_name' => __( 'Plugin Category', 'wporg-plugins' ), 126 'edit_item' => __( 'Edit Category', 'wporg-plugins' ), 127 'update_item' => __( 'Update Category', 'wporg-plugins' ), 128 'add_new_item' => __( 'Add New Category', 'wporg-plugins' ), 129 'new_item_name' => __( 'New Category Name', 'wporg-plugins' ), 130 'search_items' => __( 'Search Categories', 'wporg-plugins' ), 127 131 ), 128 132 'public' => true, 129 133 'show_ui' => true, 130 134 'show_admin_column' => true, 131 'meta_box_cb' => array( __NAMESPACE__ . '\Admin\Metabox\Plugin_ Tags', 'display' ),135 'meta_box_cb' => array( __NAMESPACE__ . '\Admin\Metabox\Plugin_Categories', 'display' ), 132 136 'capabilities' => array( 133 'assign_terms' => 'plugin_set_tags' 137 'assign_terms' => 'plugin_set_category' 138 ) 139 ) ); 140 141 register_taxonomy( 'plugin_built_for', 'plugin', array( 142 'hierarchical' => true, /* for tax_input[] handling on post saves. */ 143 'query_var' => 'plugin_built_for', 144 'rewrite' => false, 145 'labels' => array( 146 'name' => __( 'Built For', 'wporg-plugins' ), 147 ), 148 'public' => true, 149 'show_ui' => true, 150 'show_admin_column' => false, 151 //'meta_box_cb' => array( __NAMESPACE__ . '\Admin\Metabox\Plugin_Categories', 'display' ), 152 'capabilities' => array( 153 'assign_terms' => 'plugin_set_category' 154 ) 155 ) ); 156 157 register_taxonomy( 'plugin_business_model', 'plugin', array( 158 'hierarchical' => true, /* for tax_input[] handling on post saves. */ 159 'query_var' => 'plugin_business_model', 160 'rewrite' => false, 161 'labels' => array( 162 'name' => __( 'Business Model', 'wporg-plugins' ), 163 ), 164 'public' => true, 165 'show_ui' => true, 166 'show_admin_column' => false, 167 //'meta_box_cb' => array( __NAMESPACE__ . '\Admin\Metabox\Plugin_Categories', 'display' ), 168 'capabilities' => array( 169 'assign_terms' => 'plugin_set_category' 134 170 ) 135 171 ) ); … … 231 267 $wp_rewrite->set_permalink_structure( '/%postname%/' ); 232 268 233 // /tags/%slug% is required for tags. 234 $wp_rewrite->set_tag_base( '/tags' ); 269 // /tags/ & /category/ shouldn't conflict 270 $wp_rewrite->set_tag_base( '/post-tags' ); 271 $wp_rewrite->set_category_base( '/post-categories' ); 272 273 // Add our custom capabilitie and roles. 274 Capabilities::add_roles(); 235 275 236 276 // We require the WordPress.org Ratings plugin also be active. … … 319 359 320 360 /** 361 * Filter the permalink for terms to be more useful. 362 * 363 * @param string $termlink The generated term link. 364 * @param \WP_Term $term The term the link is for. 365 * @param string $taxonomy The taxonomy the term is in. 366 */ 367 public function term_link( $termlink, $term, $taxonomy ) { 368 if ( 'plugin_business_model' == $taxonomy ) { 369 return false; 370 } 371 if ( 'plugin_built_for' == $taxonomy ) { 372 return $this->package_link( false, $this->get_plugin_post( $term->slug ) ); 373 } 374 375 return $termlink; 376 } 377 378 /** 321 379 * Checks if the current users is a super admin before allowing terms to be added. 322 380 * … … 351 409 switch ( get_query_var( 'browse' ) ) { 352 410 case 'beta': 353 $wp_query->query_vars['plugin_ category'] = 'beta';411 $wp_query->query_vars['plugin_section'] = 'beta'; 354 412 break; 355 413 356 414 case 'featured': 357 $wp_query->query_vars['plugin_ category'] = 'featured';415 $wp_query->query_vars['plugin_section'] = 'featured'; 358 416 break; 359 417 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/widgets/class-meta.php
r3201 r3225 43 43 <li><?php printf( __( 'Active installs: %s', 'wporg-plugins' ), Template::active_installs( false ) ); ?></li> 44 44 <li><?php printf( __( 'Category: %s', 'wporg-plugins' ), get_the_term_list( get_post()->ID, 'plugin_category', '', ', ' ) ); ?></li> 45 <li><?php printf( __( 'Designed to work with: %s', 'wporg-plugins' ), get_the_term_list( get_post()->ID, 'plugin_category', '', ', ' ) ); ?></li> 45 <?php if ( $works_with = get_the_term_list( get_post()->ID, 'plugin_built_for', '', ', ' ) ) : ?> 46 <li><?php printf( __( 'Designed to work with: %s', 'wporg-plugins' ), $works_with ); ?></li> 47 <?php endif; ?> 48 <?php if ( $business_model = get_the_term_list( get_post()->ID, 'plugin_business_model', '', ', ' ) ) : ?> 49 <li><?php printf( __( 'Business Model: %s', 'wporg-plugins' ), $business_model ); ?></li> 50 <?php endif; ?> 46 51 </ul> 47 52 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/front-page.php
r3224 r3225 30 30 'post_type' => 'plugin', 31 31 'posts_per_page' => 4, 32 'plugin_ category' => $section_slug,32 'plugin_section' => $section_slug, 33 33 ); 34 34 … … 36 36 $section_args['meta_key'] = 'active_installs'; 37 37 $section_args['orderby'] = 'meta_value_num'; 38 unset( $section_args['plugin_ category'] );38 unset( $section_args['plugin_section'] ); 39 39 endif; 40 40
Note: See TracChangeset
for help on using the changeset viewer.