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

แชร์ ความรู้สำหรับพัฒนา plugin ของ Wordpress

Moderator: mindphp, ผู้ดูแลกระดาน

ภาพประจำตัวสมาชิก
thatsawan
PHP VIP Members
PHP VIP Members
โพสต์: 28508
ลงทะเบียนเมื่อ: 31/03/2014 10:02 am
ติดต่อ:

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

โพสต์ที่ยังไม่ได้อ่าน โดย thatsawan »

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

//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
ภาพประจำตัวสมาชิก
mindphp
ผู้ดูแลระบบ MindPHP
ผู้ดูแลระบบ MindPHP
โพสต์: 41125
ลงทะเบียนเมื่อ: 22/09/2008 6:18 pm
ติดต่อ:

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

โพสต์ที่ยังไม่ได้อ่าน โดย mindphp »

รวมกระทู้ บทความสอนสร้าง Plugin WordPress
https://www.mindphp.com/forums/viewtopic ... 25&t=36079
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ตอบกลับโพส
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 32