';
echo '
' . __('Posts Settings', 'new_royalslider') .'
';
foreach ( $fields as $key => $field ) {
echo NewRoyalSliderOptions::get_field_html($field, 'posts');
}
echo '
';
echo self::get_taxonomies_fields( isset($opts['post_type']) ? $opts['post_type'] : 'post', isset($opts['taxonomies']) ? $opts['taxonomies'] : null );
echo '
';
echo '
' . __('If you need custom order, you can filter this query via PHP with help of WordPress filters. Read more') . '
';
echo '
';
}
private static function get_taxonomies_fields($post_type, $curr_value = null) {
$taxonomies = self::list_taxonomies( $post_type );
$new_arr = array();
if($curr_value) {
$new_arr['category'] = isset($curr_value['post_category']) ? $curr_value['post_category'] : '';
if(isset($curr_value['tax_input'])) {
foreach ($curr_value['tax_input'] as $key => $value) {
$new_arr[$key] = $value;
}
}
}
foreach ($taxonomies as $key => $taxonomy) {
$checked = null;
if($curr_value && isset($new_arr[$key]) ) {
$checked = $new_arr[$key];
}
self::newrs_post_categories_meta_box(null, array(
'args' => array(
'taxonomy' => $key,
'label' => $taxonomy,
'checked_texonomies' => $checked
)
));
}
}
/**
* Display post categories form fields. Based on default WP method.
*
* @param object $post
*/
private static function newrs_post_categories_meta_box( $post, $box ) {
$defaults = array('taxonomy' => 'category');
if ( !isset($box['args']) || !is_array($box['args']) )
$args = array();
else
$args = $box['args'];
extract( wp_parse_args($args, $defaults), EXTR_SKIP );
$tax = get_taxonomy($taxonomy);
//$checked_texonomies = isset($args['selected_cats']) ? $args['selected_cats'] : '';
echo '