I can’t seem to register for support, but I can provide you with the code currently active to organize admin columns:
/**
* Adiciona colunas ao admin Imóvel
*
***/
add_filter( 'manage_edit-imovel_columns', 'ssys_edit_imovel_columns' ) ;
function ssys_edit_imovel_columns( $columns ) {
$columns = array(
'cb' => '<input type="checkbox" />',
'ref' => __( 'Ref.' ),
'imagem' => __('Imagem'),
'title' => __( 'Imóvel' ),
'destaque' => __('<span class="dashicons dashicons-star-half"></span>'),
'valor' => __( 'Valor' ),
'angariacao' => __( 'Nº Ang.' ),
'author' => __( 'Comercial' ),
'date' => __( 'Date' )
);
return $columns;
}
add_action( 'manage_imovel_posts_custom_column', 'ssys_manage_imovel_columns', 10, 2 );
function ssys_manage_imovel_columns( $column, $post_id ) {
global $post;
switch( $column ) {
case 'ref' :
echo get_the_ID();
break;
case 'imagem' :
echo get_the_post_thumbnail( $post_id, array( 100, 100) );
break;
case 'imovel' :
break;
case 'valor' :
/* Get the post meta. */
$venda = get_post_meta( $post_id, '_ssys_valor_venda_imovel', true );
$arrendamento = get_post_meta( $post_id, '_ssys_valor_arrendamento_imovel', true );
$trespasse = get_post_meta( $post_id, '_ssys_valor_trespasse_imovel', true );
if( $venda != '0,00' )
echo '<strong> Venda:</strong> '. $venda;
if( $arrendamento != '0,00' )
echo '<strong> Arrendamento:</strong>'. $arrendamento;
if( $trespasse != '0,00' )
echo '<strong> Trespasse: </strong>'. $trespasse;
break;
case 'destaque' :
$destaque = get_post_meta( $post_id, '_ssys_destaque_imovel', true );
if($destaque){
echo '<span data-id="'. $post_id .'" data-action="unset" class="dashicons dashicons-star-filled"></span>';
}else{
echo '<span data-id="'. $post_id .'" data-action="set" class="dashicons dashicons-star-empty"></span>';
}
break;
case 'angariacao':
$refImovel = get_post_meta( get_the_ID(), '_ssys_num_angariacao_imovel', true );
echo $refImovel;
break;
/* Just break out of the switch statement for everything else. */
default :
break;
}
}
function column_title($item){
//Build row actions
$actions = array(
'edit' => sprintf('<a href="/wp-admin/post.php?post=%s&action=%s&imovel=%s">Edit</a>',$item->ID,'edit',$item->ID),
);
if($this->post_type == 'interacao'){
if( get_post_meta( $item->ID, '_ssys_privada_interacao', true ) == 'on')
$interacao_privada = '<strong>Privado </strong>';
//Return the title contents
return sprintf('%1$s %2$s %3$s',
/*$1%s*/ $interacao_privada,
/*$2%s*/ $item->post_title,
/*$3%s*/ $this->row_actions($actions)
);
}else{
//Return the title contents
return sprintf('%1$s %2$s',
/*$1%s*/ $item->post_title,
/*$2%s*/ $this->row_actions($actions)
);
}
}
Is it possible I have to add it there? This was not developed by my, so I wouldn’t know how to properly do so.