__('Users', 'admin-column-custom'), ); // change 'public' to 'show_in_menu' $list = array_merge($list, wp_filter_object_list($wp_post_types, ['show_in_menu' => true], 'AND', 'label')); unset($list['attachment']); if($field == 'key') { $list = array_keys($list); } return $list; } /* * Since 1.0.10 * * @param string $type * * @return string; */ function ad_column_get_option($type = '') { return get_option('ad_column_' . $type); } /* * Since 1.0.15 * * @param integer $post_id * * @return string; */ function ad_column_get_page_path($post_id = 0) { if ($post_id == 0) return ''; $p = get_post($post_id); $path = $p->post_name; while ($p->post_parent > 0) { $p = get_post($p->post_parent); $path = $p->post_name . '/' . $path; } return $path; } /* * Since 1.0.20 * * @refer get_field (ACF) * * @param string $selector * * @return string; */ function ad_column_get_field($selector, $post_id = false, $format_value = true, $escape_html = false) { $value = ''; if (function_exists('get_field')) { $value = get_field($selector, $post_id, $format_value, $escape_html); if (is_array($value) || is_object($value)) { return ''; } } return $value; }