Skip to content

Instantly share code, notes, and snippets.

@sbruner
Created April 18, 2016 19:41
Show Gist options
  • Select an option

  • Save sbruner/ff36c8c6810274baa0fa32f2c029dc78 to your computer and use it in GitHub Desktop.

Select an option

Save sbruner/ff36c8c6810274baa0fa32f2c029dc78 to your computer and use it in GitHub Desktop.
<?php
// Set the Post Title to "Order #" plus post ID:
function set_post_title_to_order_number($data, $post_array)
{
if ($post_array['post_type'] == 'MY-POST-TYPE')
{
return 'Order #' . $post_array['ID'];
}
else
{
return $data;
}
}
add_filter('piklist_empty_post_title', 'set_post_title_to_order_number', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment