Reply To: Setting default on posts created programatically

#1847
duncanclarke
Participant

The plugin adds both categories and tags at the time of insertion. From the code that adds posts:

		$my_post = array(
			'post_title'	=> $publish[0],
			'post_content'	=> $publish[1],
			'post_date'		=> date("Y-m-d H:i:s",$publish[2]),
			'post_status'	=> 'publish',
			'post_author'	=> 2,
			'post_category'	=> $publish[3],
			'tags_input'	=> $publish[4]
		);
		$post_id = wp_insert_post($my_post);

So I’m hoping that this should be enough to trigger the attachment of a default image based on these two attributes and the configuration I posted earlier.

Choose your currency:

Close
Converted prices are for reference only - all orders are charged in € Euros (€) EUR.
  • USDUS Dollars ($)
  • EUREuros (€)
  • GBPPounds Sterling (£)
  • CADCanadian Dollars ($)
  • AUDAustralian Dollars ($)
  • BRLBrazilian Real (R$)
  • INRIndian Rupee (₹)
  • CZKCzech Koruna
  • DKKDanish Krone
  • HKDHong Kong Dollar ($)
  • HUFHungarian Forint
  • ILSIsraeli Shekel (₪)
  • JPYJapanese Yen (¥)
  • MYRMalaysian Ringgits
  • MXNMexican Peso ($)
  • NZDNew Zealand Dollar ($)
  • NOKNorwegian Krone
  • PHPPhilippine Pesos
  • PLNPolish Zloty
  • SGDSingapore Dollar ($)
  • SEKSwedish Krona
  • CHFSwiss Franc
  • TWDTaiwan New Dollars
  • THBThai Baht (฿)
  • TRYTurkish Lira (₺)
  • RUBRussian Rubles