'Languages', // Do not translate ( used for css class )
'ajax' => false,
)
);
}
/**
* Displays the item information in a column ( default case )
*
* @since 1.0
* @update 1.3.56 remove count(Post) Columm
*
* @param object $item
* @param string $column_name
* @return string
*/
public function column_default( $item, $column_name ) {
switch ( $column_name ) {
case 'locale':
case 'slug':
return esc_html( $item->$column_name );
default:
return $item->$column_name; // flag
}
}
/**
* Displays the edit and delete action links in the column 'action'
*
* @since 1.0
*
* @param object $item
* @return string
*/
public function column_action( $item ) {
$actions = array(
'edit' => sprintf(
'%s',
esc_attr__( 'Edit this language', 'falang' ),
esc_url( admin_url( 'admin.php?page=falang-language&action=edit&id=' . $item->term_id ) ),
esc_html__( 'Edit', 'falang' )
),
);
/**
* Filter the list of row actions in the languages list table
*
* @since 1.8
*
* @param array $actions list of html markup actions
* @param object $item
*/
$actions = apply_filters( 'falang_languages_row_actions', $actions, $item );
return $this->row_actions( $actions,true );
}
/**
* Displays the sortable handle
*
* @since 1.3.9
*
* @param object $item
* @return string
*/
public function column_ordering( $item ) {
return '';
}
/**
* Displays the sortable handle
*
* @since 1.3.9
* @update 1.3.10 return empty for undefine order
*
* @param object $item
* @return string
*/
public function column_order( $item ) {
if (isset($item->order)){
return esc_html( $item->order );
} else {
return '';
}
}
/**
* Displays the item information in the column 'name'
*
* @since 1.0
*
* @param object $item
* @return string
*/
public function column_name( $item ) {
return esc_html( $item->name );
}
/**
* Displays the item information in the column 'flag'
*
* @since 1.0
*
* @param object $item
* @return string
*/
public function column_flag( $item ) {
//TODO it's not slug bug flag_code
$flag_url ='';
$file = FALANG_DIR.'/flags/' . $item->flag_code . '.png';
if ( ! empty( $item->flag_code ) && file_exists( $file) ) {
$flag_url = plugins_url( 'flags/'.$item->flag_code . '.png', FALANG_FILE );
}
return sprintf(
'',
$flag_url,
/* translators: accessibility text */
esc_html( sprintf( __( 'Flags %s', 'falang' ), $item->name ) )
);
}
/**
* Displays the item information in the default language
* Displays the 'make default' action link
*
* @since 1.8
*
* @param object $item
* @return string
*/
public function column_default_language( $item ) {
$options = get_option( 'falang' );
if ( $options['default_language'] != $item->locale ) {
$s = sprintf(
'