SHARE
TWEET

Untitled

a guest Jul 12th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function setup_custom_post_type() {
  2.     $args = array(
  3.         'thumbnail',
  4.         'public'    => true,
  5.         'label'     => __( 'Listing', 'textdomain' ),
  6.         'menu_icon' => 'dashicons-format-aside',
  7.         'rewrite' => array('slug' => 'listing'),
  8.     );
  9. }
  10.  
  11. add_action( 'init', 'setup_custom_post_type' );
  12.      
  13. function save_custom_post_tye(){
  14.     add_post_meta( get_the_ID(), 'date_cr', date("Y-m-d H:i:s") );
  15. }
  16.  
  17. add_action( 'wp_insert_post', 'save_custom_post_tye', 10, 3);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top