RCCWP_CustomWritePanel::GetStandardFields PHP Method

GetStandardFields() public static method

Get a list of the standard fields of a the write panel
public static GetStandardFields ( integer $customWritePanelId ) : array
$customWritePanelId integer panel id
return array of ids of the standard fields (see $STANDARD_FIELDS defined in MF_Constant.php)
    public static function GetStandardFields($customWritePanelId)
    {
        global $wpdb;
        $sql = $wpdb->prepare("SELECT standard_field_id FROM " . MF_TABLE_PANEL_STANDARD_FIELD . " WHERE panel_id = %d", array($customWritePanelId));
        $results = $wpdb->get_col($sql);
        if (!isset($results)) {
            $results = array();
        }
        return $results;
    }

Usage Example

コード例 #1
0
 function GetStandardFieldsString($customWritePanel)
 {
     $results = RCCWP_CustomWritePanel::GetStandardFields($customWritePanel);
     foreach ($results as $r) {
         $str .= $r->name . ', ';
     }
     $str = substr($str, 0, strlen($str) - 2);
     // deletes last comma and whitespace
     return $str;
 }
All Usage Examples Of RCCWP_CustomWritePanel::GetStandardFields