getBaseDir()) )
|| !current_user_can( 'edit_post', $post->ID ) ) {
return $post->ID;
}
$shortcodes_meta['_name'] = !empty($_POST['_name']) ? $_POST['_name'] : 'fac_shortcode_' . $post->ID;
foreach ($shortcodes_meta as $key => $value) {
if( $post->post_type == 'revision' ) return;
$value = implode(',', (array) $value);
if ( !$value ) {
delete_post_meta($post->ID, $key);
} else {
update_post_meta($post->ID, $key, esc_attr( $value ));
}
}
}
public function viewNameMetabox() {
global $post;
// Noncename needed to verify where the data originated
echo '';
// Get the location data if its already been entered
$name = get_post_meta($post->ID, '_name', true);
$name = !empty($name) ? $name : 'fac_shortcode_' . $post->ID;
// Echo out the field
echo '';
}
public function viewPreviewMetabox() {
global $post;
echo do_shortcode( get_post_field('post_content', $post->ID) );
}
}