* @license GPL-2.0+ * @link http://wordpress.org/plugins/quick-featured-images/ * @copyright 2014 */ #dambedei( $this->selected_rules ); // define some variables $no_thumb_url = includes_url() . 'images/blank.gif'; // store recurring translations only once for more performance $matches_label = esc_html__( 'matches', 'quick-featured-images' ); $number_label = esc_html__( 'No.', 'quick-featured-images' ); // WP core strings $text = 'Save Changes'; $button_label = __( $text ); // will be escaped by submin_button() $text = 'Choose Image'; $choose_image_label = esc_attr__( $text ); $text = 'Taxonomy:'; $taxonomy_label = esc_html__( $text ); $text = 'Action'; $action_label = esc_html__( $text ); $text = 'Description'; $description_label = esc_html__( $text ); $text = 'Image'; $image_label = esc_html__( $text ); $text = 'Value'; $value_label = esc_html__( $text ); $text = 'Author'; $user_label = esc_html__( $text ); $text = '— Select —'; $first_option_label = esc_html__( $text ); $text = 'Featured Image'; $feat_img_label = esc_attr( _x( $text, 'post' ) ); $text = 'Category'; $category_label = esc_html( _x( $text, 'taxonomy singular name' ) ); $text = 'Tag'; $tag_label = esc_html( _x( $text, 'taxonomy singular name' ) ); $text = 'Post'; $post_label = esc_html( _x( $text, 'post type singular name' ) ); $text = 'Page'; $page_label = esc_html( _x( $text, 'post type singular name' ) ); // set parameters for term queries $args = array( 'orderby' => 'name', 'order' => 'ASC', 'hide_empty' => false, 'hierarchical' => true, ); // set options fields $optionfields = array( 'post_type' => __( 'Post Type', 'quick-featured-images' ), 'category' => $category_label, 'post_tag' => $tag_label, 'user' => $user_label, ); // get stored tags $tags = get_tags( $args ); // get stored categories $categories = get_categories( $args ); // get authors: Return List all blog editors, return limited fields in resulting row objects: $user_query = new WP_User_Query( array( 'who' => 'authors', 'fields' => array( 'ID', 'user_nicename', 'display_name' ), 'order' => 'ASC', 'orderby' => 'display_name' ) ); $user_data = $user_query->get_results(); // make selection box entries $users = array(); if ( 0 < count( $user_data ) ) { // loop through each author foreach ( $user_data as $user ) { $users[] = array( 'id' => $user->ID, 'name' => sprintf( '%s (%s)', $user->display_name, $user->user_nicename ) ); } } // get stored post types $custom_post_types = $this->get_custom_post_types_labels(); // get stored taxonomies $custom_taxonomies = $this->get_custom_taxonomies_labels(); $custom_taxonomies_terms = array(); if ( $custom_taxonomies ) { foreach ( $custom_taxonomies as $key => $label ) { $options = array(); $terms = get_terms( $key, $args ); if ( is_wp_error( $terms ) ) { printf( '
%s
', esc_html( $terms->get_error_message() ) ); continue; } if ( 0 < count( $terms ) ) { foreach ( $terms as $term ) { $custom_taxonomies_terms[ $key ][ $term->term_id ] = $term->name; } if ( isset( $this->selected_custom_taxonomies[ $key ] ) ) { $selected_tax = $this->selected_custom_taxonomies[ $key ]; } else { $selected_tax = ''; } } } } // print jQuery for pulldowns ?>