html_attributes = array( 'v-model' => 'value', ); } /** * Output input field. * * @param string $value * @param string $view * @return string */ public function outputInput( $value = null, $view = null ) { $view = $view ? $view : $this->getView(); $attachment = wp_get_attachment_metadata( $value ) ?: []; $urls = (array) wp_get_attachment_image_src( $value, 'medium' ); $attachment['url'] = array_shift( $urls ); return Cuztom::view( 'fields/' . $view, array( 'field' => $this, 'value' => $value, 'attachment' => $attachment, ) ); } /** * Output column content. * * @param string $post_id * @return string */ public function outputColumnContent( $post_id ) { $meta = get_post_meta( $post_id, $this->id, true ); echo wp_get_attachment_image( $meta, array( 100, 100 ) ); } }