RCCWP_WritePostPage::CustomFieldCollectionInterface PHP 메소드

CustomFieldCollectionInterface() 공개 정적인 메소드

Drawing our custom fields
public static CustomFieldCollectionInterface ( )
    public static function CustomFieldCollectionInterface()
    {
        global $CUSTOM_WRITE_PANEL, $wpdb, $mf_domain, $post;
        if (empty($CUSTOM_WRITE_PANEL)) {
            return false;
        }
        //getting information of the CustomWrite Panel
        $groups = RCCWP_CustomWritePanel::GetCustomGroups($CUSTOM_WRITE_PANEL->id, "id");
        foreach ($groups as $group) {
            //Only is drawed the group if has at least one field
            $hasfields = RCCWP_CustomGroup::HasCustomfields($group->id);
            if (!$hasfields) {
                continue;
            }
            if ($group->name == "__default") {
                $lang = get_bloginfo('language');
                $name = "Magic Fields Custom Fields";
                if ($lang == "en-US") {
                    $name = Inflect::singularize($CUSTOM_WRITE_PANEL->name);
                }
            } else {
                $name = $group->name;
            }
            add_meta_box('panel_' . $group->id, $name, array('RCCWP_WritePostPage', 'metaboxContent'), $CUSTOM_WRITE_PANEL->type, 'normal', 'high', $group);
        }
    }

Usage Example

예제 #1
0
 function CustomFieldCollectionInterfaceRight()
 {
     RCCWP_WritePostPage::CustomFieldCollectionInterface(true);
 }