Function Reference: geodir_imex_get_custom_fields

Summary

Returns queried data from custom fields table.

Global Values

$wpdb
(object) (required) WordPress Database object.

Default: None

Package

GeoDirectory

Parameters

$post_type
(string) (required) The post type.

Default: None

Return Values

(object)
  • Queried object.

Change Log

Since: 1.0.0

1.5.4 Modified to fix empty columns in export csv file.

Source File

geodir_imex_get_custom_fields() is located in geodirectory-admin/admin_functions.php [Line: 5779]

Source Code

function geodir_imex_get_custom_fields( $post_type ) {
	global $wpdb;
	 
	$sql = $wpdb->prepare("SELECT htmlvar_name FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1' AND is_admin!='1' AND field_type != 'fieldset' AND htmlvar_name != '' ORDER BY id ASC", array( $post_type ) );
	$rows = $wpdb->get_results( $sql );
	 
	return $rows;
}