Changeset 2983 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
- Timestamp:
- 04/19/2016 08:09:35 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r2976 r2983 467 467 * @type int $author The ID of the plugin author. 468 468 * @type string $description The short description of the plugin. 469 * @type string $content The long description of the plugin. 470 * @type array $tags The tags associated with the plugin. 471 * @type array $tags The meta information of the plugin. 469 472 * } 470 473 * @return \WP_Post|\WP_Error 471 474 */ 472 475 static public function create_plugin_post( array $plugin_info ) { 473 $title = !empty( $plugin_info['title'] ) ? $plugin_info['title'] : ''; 474 $slug = !empty( $plugin_info['slug'] ) ? $plugin_info['slug'] : sanitize_title( $title ); 475 $status = !empty( $plugin_info['status'] ) ? $plugin_info['status'] : 'pending'; 476 $author = !empty( $plugin_info['author'] ) ? $plugin_info['author'] : 0; 477 $desc = !empty( $plugin_info['description'] ) ? $plugin_info['description'] : ''; 476 $title = ! empty( $plugin_info['title'] ) ? $plugin_info['title'] : ''; 477 $slug = ! empty( $plugin_info['slug'] ) ? $plugin_info['slug'] : sanitize_title( $title ); 478 $status = ! empty( $plugin_info['status'] ) ? $plugin_info['status'] : 'pending'; 479 $author = ! empty( $plugin_info['author'] ) ? $plugin_info['author'] : 0; 480 $desc = ! empty( $plugin_info['description'] ) ? $plugin_info['description'] : ''; 481 $content = ! empty( $plugin_info['content'] ) ? $plugin_info['content'] : ''; 482 $tags = ! empty( $plugin_info['tags'] ) ? $plugin_info['tags'] : array(); 483 $meta = ! empty( $plugin_info['meta'] ) ? $plugin_info['meta'] : array(); 478 484 479 485 $id = wp_insert_post( array( … … 483 489 'post_title' => $title ?: $slug, 484 490 'post_author' => $author, 485 'post_content' => '',491 'post_content' => $content, 486 492 'post_excerpt' => $desc, 493 'tags_input' => $tags, 494 'meta_input' => $meta, 487 495 ), true ); 488 496
Note: See TracChangeset
for help on using the changeset viewer.