You appear to be a bot. Output may be restricted
Description
Look up Download by title and create one if none is found
Usage
$int = EDD_Batch_Payments_Import::maybe_create_download( $title );
Parameters
- $title
- ( mixed ) optional –
Returns
int Download ID
Source
File name: easy-digital-downloads/includes/admin/import/class-batch-import-payments.php
Lines:
1 to 26 of 26
private function maybe_create_download( $title = '' ) { if( ! is_string( $title ) ) { return false; } $download = get_page_by_title( $title, OBJECT, 'download' ); if( $download ) { $download_id = $download->ID; } else { $args = array( 'post_type' => 'download', 'post_title' => $title, 'post_author' => get_current_user_id() ); $download_id = wp_insert_post( $args ); } return $download_id; }