Force event importer title
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @category Admin
|
* @category Admin
|
||||||
* @package SportsPress/Admin/Importers
|
* @package SportsPress/Admin/Importers
|
||||||
* @version 1.6
|
* @version 2.0.2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
@@ -147,7 +147,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
|||||||
endif;
|
endif;
|
||||||
|
|
||||||
// Define post type args
|
// Define post type args
|
||||||
$args = array( 'post_type' => 'sp_event', 'post_status' => 'publish', 'post_date' => $date );
|
$args = array( 'post_type' => 'sp_event', 'post_status' => 'publish', 'post_date' => $date, 'post_title' => __( 'Event', 'sportspress' ) );
|
||||||
|
|
||||||
// Insert event
|
// Insert event
|
||||||
$id = wp_insert_post( $args );
|
$id = wp_insert_post( $args );
|
||||||
@@ -317,6 +317,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
|||||||
$post = array(
|
$post = array(
|
||||||
'ID' => $id,
|
'ID' => $id,
|
||||||
'post_title' => $title,
|
'post_title' => $title,
|
||||||
|
'post_name' => $id,
|
||||||
);
|
);
|
||||||
wp_update_post( $post );
|
wp_update_post( $post );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user