*/ class Apci_Gist_Api_Nice_Response { protected $files; protected $raw; /** * @param $files */ public function set_files($files) { if(empty($files)) { $this->files = false; } else { $this->files = json_decode($files); } } /** * @param $raw */ public function set_raw($raw) { $this->raw = $raw; } /** * @return string */ public function get_code_files_html() { $html = ''; if(false == $this->files) { return '
'.
                ''
                .__('Can not load code by gist id, please check your shortcode and make sure gist exists', 'apci-gist-api-ci').
                ''.
            '
'; } foreach ($this->files as $file) { $raw_link = ''; if('yes' == $this->raw) { $raw_link = ''. $file->filename. ''; $raw_link = '
'.$raw_link.'
'; } $html .= $raw_link. '
'.
                    ''
                    .esc_html($file->content).
                    ''.
                '
'; } return $html; } }