PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 4.0.3
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v4.0.3
4.0.3 4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 341 releases
← All changes | assets/lib/wck-api/fields/cpt select.php +25 -25 2.0.3 → 4.0.3 View file →
@@ -1,26 +1,26 @@
1 -<?php
2 -/* @param string $meta Meta name.
3 - * @param array $details Contains the details for the field.
4 - * @param string $value Contains input value;
5 - * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6 - * @return string $element input element html string. */
7 -
8 -$args = apply_filters( 'wck-cpt-select-args', array( 'post_type' => $details['cpt'], 'orderby' => 'menu_order title', 'order' => 'ASC', 'posts_per_page' => '200', 'post_status' => 'publish' ), $details );
9 -
10 -$cpt_query = new WP_Query($args);
11 -
12 -if( !empty( $cpt_query->posts ) ){
13 - $element .= '<select name="'. esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" id="';
14 - if( !empty( $frontend_prefix ) )
15 - $element .= $frontend_prefix;
16 - $element .= esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" class="mb-user-select mb-field" >';
17 - $element .= '<option value="">'. __('...Chose', 'wck') .'</option>';
18 - foreach( $cpt_query->posts as $cpt ){
19 - if ( $cpt->post_title == '' )
20 - $cpt->post_title = 'No title. ID: ' . $cpt->ID;
21 -
22 - $element .= '<option value="'. esc_attr( $cpt->ID ) .'" '. selected( $cpt->ID, $value, false ) .' >'. esc_html( $cpt->post_title ) .'</option>';
23 - }
24 - $element .= '</select>';
25 -}
1 +<?php
2 +/* @param string $meta Meta name.
3 + * @param array $details Contains the details for the field.
4 + * @param string $value Contains input value;
5 + * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6 + * @return string $element input element html string. */
7 +
8 +$args = apply_filters( 'wck-cpt-select-args', array( 'post_type' => $details['cpt'], 'orderby' => 'menu_order title', 'order' => 'ASC', 'posts_per_page' => '200', 'post_status' => 'publish' ), $details );
9 +
10 +$cpt_query = new WP_Query($args);
11 +
12 +if( !empty( $cpt_query->posts ) ){
13 + $element .= '<select name="'. $single_prefix . esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" id="';
14 + if( !empty( $frontend_prefix ) )
15 + $element .= $frontend_prefix;
16 + $element .= esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" class="mb-user-select mb-field" >';
17 + $element .= '<option value="">'. __('...Choose', 'profile-builder') .'</option>';
18 + foreach( $cpt_query->posts as $cpt ){
19 + if ( $cpt->post_title == '' )
20 + $cpt->post_title = 'No title. ID: ' . $cpt->ID;
21 +
22 + $element .= '<option value="'. esc_attr( $cpt->ID ) .'" '. selected( $cpt->ID, $value, false ) .' >'. esc_html( $cpt->post_title ) .'</option>';
23 + }
24 + $element .= '</select>';
25 +}
26 26 ?>