Skip to content

Commit

Permalink
Fix for issue reduxframework#252
Browse files Browse the repository at this point in the history
  • Loading branch information
dovy committed Nov 20, 2013
1 parent e363843 commit 50ad0c2
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions ReduxCore/framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,29 @@ function get_wordpress_data($type = false, $args = array()) {
}//foreach
}//if
} else if ($type == "post_type" || $type == "post_types") {
$post_types = get_post_types($args, 'object');
if (!empty($post_types)) {
foreach ( $post_types as $k => $post_type ) {
$data[$k] = $post_type->labels->name;
}//foreach
}//if
global $wp_post_types;
$defaults = array(
'public' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'_builtin' => false,
);
$args = wp_parse_args( $args, $defaults );
$output = 'names';
$operator = 'and';
$post_types = get_post_types($args, $output, $operator);
$post_types['page'] = 'page';
$post_types['post'] = 'post';
ksort($post_types);

foreach ( $post_types as $name => $title ) {
if ( isset($wp_post_types[$name]->labels->menu_name) ) {
$data[$name] = $wp_post_types[$name]->labels->menu_name;
} else {
$data[$name] = ucfirst($name);
}
}
} else if ($type == "tags" || $type == "tag") {
$tags = get_tags($args);
if (!empty($tags)) {
Expand Down

0 comments on commit 50ad0c2

Please sign in to comment.