สอนสร้าง Plugin WordPress (12) : ตัวอย่างการสร้าง Custom Post Types

ตอบกระทู้

รูปแสดงอารมณ์
:icon_plusone: :like: :plusone: :gfb: :-D :) :( :-o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :angry: :baa: :biggrin:
รูปแสดงอารมณ์อื่นๆ

BBCode เปิด
[img] เปิด
[url] เปิด
[Smile icon] เปิด

กระทู้แนะนำ
   

มุมมองที่ขยายได้ กระทู้แนะนำ: สอนสร้าง Plugin WordPress (12) : ตัวอย่างการสร้าง Custom Post Types

Re: สอนสร้าง Plugin WordPress (12) : ตัวอย่างการสร้าง Custom Post Types

โดย mindphp » 25/10/2016 9:49 pm

รวมกระทู้ บทความสอนสร้าง Plugin WordPress
https://www.mindphp.com/forums/viewtopic ... 25&t=36079

สอนสร้าง Plugin WordPress (12) : ตัวอย่างการสร้าง Custom Post Types

โดย thatsawan » 25/10/2016 12:02 pm

โค้ด: เลือกทั้งหมด

//create_post_type
add_action( 'init', 'create_post_type' );
function create_post_type() {
  register_post_type( 'type_post_product',
    array(
      'labels' => array(
        'name' => __( 'Products Demo' ),
        'singular_name' => __( 'Product Demo' )
      ),
      'public' => true,
      'has_archive' => true,
    )
  );
}
 
ผลที่ได้
รูปภาพ
รูปภาพ
รูปภาพ

ศึกษาเพิ่มเติมได้ที่นี่
https://codex.wordpress.org/Function_Re ... _post_type

ข้างบน