Created
June 29, 2016 01:36
-
-
Save jdcauley/6661b21d968020376aae2063583a3fde to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: MINC | |
*/ | |
require_once('lib/CMB2/init.php'); | |
class MINC_Fields { | |
function __contruct(){ | |
add_action( 'init', array($this, 'add_origin_header') ); | |
add_action( 'cmb2_admin_init', array($this, 'minc_fields') ); | |
} | |
function add_origin_header(){ | |
header('Access-Control-Allow-Origin: *'); | |
} | |
public function minc_fields(){ | |
$prefix = '_minc_'; | |
$minc_cmb = new_cmb2_box( array( | |
'id' => 'minc', | |
'title' => 'MINC Fields', | |
'object_types' => array( 'post' ), | |
'context' => 'normal', | |
'priority' => 'high', | |
'show_names' => true, | |
) ); | |
$minc_cmb->add_field( array( | |
'name' => __( 'Website URL', 'cmb2' ), | |
'id' => $prefix . 'website', | |
'type' => 'text_url' | |
) ); | |
$minc_cmb->add_field( array( | |
'name' => __( 'Facebook URL', 'cmb2' ), | |
'id' => $prefix . 'facebook', | |
'type' => 'text_url' | |
) ) ; | |
$minc_cmb->add_field( array( | |
'name' => __( 'Twitter URL', 'cmb2' ), | |
'id' => $prefix . 'twitter', | |
'type' => 'text_url' | |
) ); | |
$minc_cmb->add_field( array( | |
'name' => __('Email', 'cmb2' ), | |
'id' => $prefix . 'email', | |
'type' => 'text_email' | |
) ); | |
} | |
} | |
new MINC_Fields(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment