' . __( 'Sorry, this function does not exist', 'alchem' ) . '

'; } } } /** * Background option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_background' ) ) { function alchem_type_background( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* allow fields to be filtered */ $alchem_recognized_background_fields = apply_filters( 'alchem_recognized_background_fields', array( 'background-color', 'background-repeat', 'background-attachment', 'background-position', 'background-size', 'background-image' ), $field_id ); echo '
'; /* build background color */ if ( in_array( 'background-color', $alchem_recognized_background_fields ) ) { echo '
'; /* colorpicker JS */ echo ''; /* set background color */ $background_color = isset( $field_value['background-color'] ) ? esc_attr( $field_value['background-color'] ) : ''; /* input */ echo ''; echo '
'; } /* build background repeat */ if ( in_array( 'background-repeat', $alchem_recognized_background_fields ) ) { $background_repeat = isset( $field_value['background-repeat'] ) ? esc_attr( $field_value['background-repeat'] ) : ''; echo ''; } /* build background attachment */ if ( in_array( 'background-attachment', $alchem_recognized_background_fields ) ) { $background_attachment = isset( $field_value['background-attachment'] ) ? esc_attr( $field_value['background-attachment'] ) : ''; echo ''; } /* build background position */ if ( in_array( 'background-position', $alchem_recognized_background_fields ) ) { $background_position = isset( $field_value['background-position'] ) ? esc_attr( $field_value['background-position'] ) : ''; echo ''; } /* Build background size */ if ( in_array( 'background-size', $alchem_recognized_background_fields ) ) { /** * Use this filter to create a select instead of an text input. * Be sure to return the array in the correct format. Add an empty * value to the first choice so the user can leave it blank. * array( array( 'label' => 'background-size', 'value' => '' ), array( 'label' => 'cover', 'value' => 'cover' ), array( 'label' => 'contain', 'value' => 'contain' ) ) * */ $choices = apply_filters( 'alchem_type_background_size_choices', '', $field_id ); if ( is_array( $choices ) && ! empty( $choices ) ) { /* build select */ echo ''; } else { echo ''; } } echo '
'; /* build background image */ if ( in_array( 'background-image', $alchem_recognized_background_fields ) ) { echo '
'; /* input */ echo ''; /* add media button */ echo '' . __( 'Add Media', 'alchem' ) . ''; echo '
'; /* media */ if ( isset( $field_value['background-image'] ) && $field_value['background-image'] !== '' ) { echo '
'; if ( preg_match( '/\.(?:jpe?g|png|gif|ico)$/i', $field_value['background-image'] ) ) echo '
'; echo '' . __( 'Remove Media', 'alchem' ) . ''; echo '
'; } } echo '
'; echo '
'; } } /** * Category Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_category_checkbox' ) ) { function alchem_type_category_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* get category array */ $categories = get_categories( apply_filters( 'alchem_type_category_checkbox_query', array( 'hide_empty' => false ), $field_id ) ); /* build categories */ if ( ! empty( $categories ) ) { foreach ( $categories as $category ) { echo '

'; echo 'term_id] ) ? checked( $field_value[$category->term_id], $category->term_id, false ) : '' ) . ' class="option-tree-ui-checkbox ' . esc_attr( $field_class ) . '" />'; echo ''; echo '

'; } } else { echo '

' . __( 'No Categories Found', 'alchem' ) . '

'; } echo '
'; echo '
'; } } /** * Category Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_category_select' ) ) { function alchem_type_category_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build category */ echo ''; echo '
'; echo '
'; } } /** * Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_checkbox' ) ) { function alchem_type_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build checkbox */ foreach ( (array) $field_choices as $key => $choice ) { if ( isset( $choice['value'] ) && isset( $choice['label'] ) ) { echo '

'; echo ''; echo ''; echo '

'; } } echo '
'; echo '
'; } } /** * Colorpicker option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 * @updated 2.2.0 */ if ( ! function_exists( 'alchem_type_colorpicker' ) ) { function alchem_type_colorpicker( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build colorpicker */ echo '
'; /* colorpicker JS */ echo ''; /* set the default color */ $std = $field_std ? 'data-default-color="' . $field_std . '"' : ''; /* input */ echo ''; echo '
'; echo '
'; echo '
'; } } /** * CSS option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_css' ) ) { function alchem_type_css( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build textarea for CSS */ echo ''; /* build pre to convert it into ace editor later */ echo '
' . esc_textarea( $field_value ) . '
'; echo '
'; echo '
'; } } /** * Custom Post Type Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_custom_post_type_checkbox' ) ) { function alchem_type_custom_post_type_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* setup the post types */ $post_type = isset( $field_post_type ) ? explode( ',', $field_post_type ) : array( 'post' ); /* query posts array */ $my_posts = get_posts( apply_filters( 'alchem_type_custom_post_type_checkbox_query', array( 'post_type' => $post_type, 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => 'any' ), $field_id ) ); /* has posts */ if ( is_array( $my_posts ) && ! empty( $my_posts ) ) { foreach( $my_posts as $my_post ) { $post_title = '' != $my_post->post_title ? $my_post->post_title : 'Untitled'; echo '

'; echo 'ID] ) ? checked( $field_value[$my_post->ID], $my_post->ID, false ) : '' ) . ' class="option-tree-ui-checkbox ' . esc_attr( $field_class ) . '" />'; echo ''; echo '

'; } } else { echo '

' . __( 'No Posts Found', 'alchem' ) . '

'; } echo '
'; echo '
'; } } /** * Custom Post Type Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_custom_post_type_select' ) ) { function alchem_type_custom_post_type_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build category */ echo ''; echo '
'; echo '
'; } } /** * Date Picker option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.3 */ if ( ! function_exists( 'alchem_type_date_picker' ) ) { function alchem_type_date_picker( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* filter date format */ $date_format = apply_filters( 'alchem_type_date_picker_date_format', 'yy-mm-dd', $field_id ); /* format setting outer wrapper */ echo '
'; /* date picker JS */ echo ''; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build date picker */ echo ''; echo '
'; echo '
'; } } /** * Date Time Picker option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.3 */ if ( ! function_exists( 'alchem_type_date_time_picker' ) ) { function alchem_type_date_time_picker( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* filter date format */ $date_format = apply_filters( 'alchem_type_date_time_picker_date_format', 'yy-mm-dd', $field_id ); /* format setting outer wrapper */ echo '
'; /* date time picker JS */ echo ''; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build date time picker */ echo ''; echo '
'; echo '
'; } } /** * Gallery option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array The options arguments * @return string The gallery metabox markup. * * @access public * @since 2.2.0 */ if ( ! function_exists( 'alchem_type_gallery' ) ) { function alchem_type_gallery( $args = array() ) { // Turns arguments array into variables extract( $args ); // Verify a description $has_desc = $field_desc ? true : false; // Format setting outer wrapper echo ''; } } /** * List Item option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_list_item' ) ) { function alchem_type_list_item( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* pass the settings array arround */ echo ''; /** * settings pages have array wrappers like 'option_tree'. * So we need that value to create a proper array to save to. * This is only for NON metaboxes settings. */ if ( ! isset( $get_option ) ) $get_option = ''; /* build list items */ echo ''; /* button */ echo '' . __( 'Add New', 'alchem' ) . ''; /* description */ echo '
' . apply_filters( 'alchem_list_item_description', __( 'You can re-order with drag & drop, the order will update after saving.', 'alchem' ), $field_id ) . '
'; echo '
'; echo '
'; } } /** * Measurement option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_measurement' ) ) { function alchem_type_measurement( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; echo '
'; echo ''; echo '
'; /* build measurement */ echo ''; echo '
'; echo '
'; } } /** * Numeric Slider option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.1 */ if( ! function_exists( 'alchem_type_numeric_slider' ) ) { function alchem_type_numeric_slider( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; $_options = explode( ',', $field_min_max_step ); $min = isset( $_options[0] ) ? $_options[0] : 0; $max = isset( $_options[1] ) ? $_options[1] : 100; $step = isset( $_options[2] ) ? $_options[2] : 1; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; echo '
'; echo '
'; } } /** * On/Off option type * * See @alchem_display_by_type to see the full list of available arguments. * * @param array The options arguments * @return string The gallery metabox markup. * * @access public * @since 2.2.0 */ if ( ! function_exists( 'alchem_type_on_off' ) ) { function alchem_type_on_off( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; // Force choices $field_choices = array( array( 'value' => 'on', 'label' => __( 'On', 'alchem' ), ), array( 'value' => 'off', 'label' => __( 'Off', 'alchem' ), ) ); echo '
'; /* build radio */ foreach ( (array) $field_choices as $key => $choice ) { echo ' '; } echo ''; echo '
'; echo '
'; echo '
'; } } /** * Page Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_page_checkbox' ) ) { function alchem_type_page_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* query pages array */ $my_posts = get_posts( apply_filters( 'alchem_type_page_checkbox_query', array( 'post_type' => array( 'page' ), 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => 'any' ), $field_id ) ); /* has pages */ if ( is_array( $my_posts ) && ! empty( $my_posts ) ) { foreach( $my_posts as $my_post ) { $post_title = '' != $my_post->post_title ? $my_post->post_title : 'Untitled'; echo '

'; echo 'ID] ) ? checked( $field_value[$my_post->ID], $my_post->ID, false ) : '' ) . ' class="option-tree-ui-checkbox ' . esc_attr( $field_class ) . '" />'; echo ''; echo '

'; } } else { echo '

' . __( 'No Pages Found', 'alchem' ) . '

'; } echo '
'; echo '
'; } } /** * Page Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_page_select' ) ) { function alchem_type_page_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build page select */ echo ''; echo '
'; echo '
'; } } /** * List Item option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_slider' ) ) { function alchem_type_slider( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* pass the settings array arround */ echo ''; /** * settings pages have array wrappers like 'option_tree'. * So we need that value to create a proper array to save to. * This is only for NON metaboxes settings. */ if ( ! isset( $get_option ) ) $get_option = ''; /* build list items */ echo ''; /* button */ echo '' . __( 'Add New', 'alchem' ) . ''; /* description */ echo '
' . __( 'You can re-order with drag & drop, the order will update after saving.', 'alchem' ) . '
'; echo '
'; echo '
'; } } /** * Post Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_post_checkbox' ) ) { function alchem_type_post_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* query posts array */ $my_posts = get_posts( apply_filters( 'alchem_type_post_checkbox_query', array( 'post_type' => array( 'post' ), 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', 'post_status' => 'any' ), $field_id ) ); /* has posts */ if ( is_array( $my_posts ) && ! empty( $my_posts ) ) { foreach( $my_posts as $my_post ) { $post_title = '' != $my_post->post_title ? $my_post->post_title : 'Untitled'; echo '

'; echo 'ID] ) ? checked( $field_value[$my_post->ID], $my_post->ID, false ) : '' ) . ' class="option-tree-ui-checkbox ' . esc_attr( $field_class ) . '" />'; echo ''; echo '

'; } } else { echo '

' . __( 'No Posts Found', 'alchem' ) . '

'; } echo '
'; echo '
'; } } /** * Post Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_post_select' ) ) { function alchem_type_post_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build page select */ echo ''; echo '
'; echo '
'; } } /** * Radio option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_radio' ) ) { function alchem_type_radio( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build radio */ foreach ( (array) $field_choices as $key => $choice ) { echo '

'; } echo '
'; echo '
'; } } /** * Radio Images option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_radio_image' ) ) { function alchem_type_radio_image( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /** * load the default filterable images if nothing * has been set in the choices array. */ if ( empty( $field_choices ) ) $field_choices = alchem_radio_images( $field_id ); /* build radio image */ foreach ( (array) $field_choices as $key => $choice ) { $src = str_replace( 'ALCHEM_THEME_URI', ALCHEM_THEME_URI, $choice['src'] ); // $src = str_replace( 'alchem_THEME_URL', alchem_THEME_URL, $src ); /* make radio image source filterable */ $src = apply_filters( 'alchem_type_radio_image_src', $src, $field_id ); echo '
'; echo '

'; echo '' . esc_attr( $choice['label'] ) .''; echo '
'; } echo '
'; echo '
'; } } /** * Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_select' ) ) { function alchem_type_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build select */ echo ''; echo '
'; echo '
'; } } /** * Sidebar Select option type. * * This option type makes it possible for users to select a WordPress registered sidebar * to use on a specific area. By using the two provided filters, 'alchem_recognized_sidebars', * and 'alchem_recognized_sidebars_{$field_id}' we can be selective about which sidebars are * available on a specific content area. * * For example, if we create a WordPress theme that provides the ability to change the * Blog Sidebar and we don't want to have the footer sidebars available on this area, * we can unset those sidebars either manually or by using a regular expression if we * have a common name like footer-sidebar-$i. * * @param array An array of arguments. * @return string * * @access public * @since 2.1 */ if ( ! function_exists( 'alchem_type_sidebar_select' ) ) { function alchem_type_sidebar_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build page select */ echo ''; echo '
'; echo '
'; } } /** * Tab option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.3.0 */ if ( ! function_exists( 'alchem_type_tab' ) ) { function alchem_type_tab( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* format setting outer wrapper */ echo '
'; echo '
'; echo '
'; } } /** * Tag Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_tag_checkbox' ) ) { function alchem_type_tag_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* get tags */ $tags = get_tags( array( 'hide_empty' => false ) ); /* has tags */ if ( $tags ) { foreach( $tags as $tag ) { echo '

'; echo 'term_id] ) ? checked( $field_value[$tag->term_id], $tag->term_id, false ) : '' ) . ' class="option-tree-ui-checkbox ' . esc_attr( $field_class ) . '" />'; echo ''; echo '

'; } } else { echo '

' . __( 'No Tags Found', 'alchem' ) . '

'; } echo '
'; echo '
'; } } /** * Tag Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_tag_select' ) ) { function alchem_type_tag_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build tag select */ echo ''; echo '
'; echo '
'; } } /** * Taxonomy Checkbox option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_taxonomy_checkbox' ) ) { function alchem_type_taxonomy_checkbox( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* setup the taxonomy */ $taxonomy = isset( $field_taxonomy ) ? explode( ',', $field_taxonomy ) : array( 'category' ); /* get taxonomies */ $taxonomies = get_categories( apply_filters( 'alchem_type_taxonomy_checkbox_query', array( 'hide_empty' => false, 'taxonomy' => $taxonomy ), $field_id ) ); /* has tags */ if ( $taxonomies ) { foreach( $taxonomies as $taxonomy ) { echo '

'; echo 'term_id] ) ? checked( $field_value[$taxonomy->term_id], $taxonomy->term_id, false ) : '' ) . ' class="option-tree-ui-checkbox ' . esc_attr( $field_class ) . '" />'; echo ''; echo '

'; } } else { echo '

' . __( 'No Taxonomies Found', 'alchem' ) . '

'; } echo '
'; echo '
'; } } /** * Taxonomy Select option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_taxonomy_select' ) ) { function alchem_type_taxonomy_select( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build tag select */ echo ''; echo '
'; echo '
'; } } /** * Text option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_text' ) ) { function alchem_type_text( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build text input */ echo ''; echo '
'; echo '
'; } } /** * Textarea option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_textarea' ) ) { function alchem_type_textarea( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build textarea */ wp_editor( $field_value, esc_attr( $field_id ), array( 'editor_class' => esc_attr( $field_class ), 'wpautop' => apply_filters( 'alchem_wpautop', false, $field_id ), 'media_buttons' => apply_filters( 'alchem_media_buttons', true, $field_id ), 'textarea_name' => esc_attr( $field_name ), 'textarea_rows' => esc_attr( $field_rows ), 'tinymce' => apply_filters( 'alchem_tinymce', true, $field_id ), 'quicktags' => apply_filters( 'alchem_quicktags', array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' ), $field_id ) ) ); echo '
'; echo '
'; } } /** * Textarea Simple option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_textarea_simple' ) ) { function alchem_type_textarea_simple( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* filter to allow wpautop */ $wpautop = apply_filters( 'alchem_wpautop', false, $field_id ); /* wpautop $field_value */ if ( $wpautop == true ) $field_value = wpautop( $field_value ); /* build textarea simple */ echo ''; echo '
'; echo '
'; } } /** * Textblock option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_textblock' ) ) { function alchem_type_textblock( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* format setting outer wrapper */ echo '
'; /* description */ echo '
' . htmlspecialchars_decode( $field_desc ) . '
'; echo '
'; } } /** * Textblock Titled option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_textblock_titled' ) ) { function alchem_type_textblock_titled( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* format setting outer wrapper */ echo '
'; /* description */ echo '
' . htmlspecialchars_decode( $field_desc ) . '
'; echo '
'; } } /** * Typography option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_typography' ) ) { function alchem_type_typography( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* allow fields to be filtered */ $alchem_recognized_typography_fields = apply_filters( 'alchem_recognized_typography_fields', array( 'font-color', 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight', 'letter-spacing', 'line-height', 'text-decoration', 'text-transform' ), $field_id ); /* build font color */ if ( in_array( 'font-color', $alchem_recognized_typography_fields ) ) { /* build colorpicker */ echo '
'; /* colorpicker JS */ echo ''; /* set background color */ $background_color = isset( $field_value['font-color'] ) ? esc_attr( $field_value['font-color'] ) : ''; /* input */ echo ''; echo '
'; } /* build font family */ if ( in_array( 'font-family', $alchem_recognized_typography_fields ) ) { $font_family = isset( $field_value['font-family'] ) ? $field_value['font-family'] : ''; echo ''; } /* build font size */ if ( in_array( 'font-size', $alchem_recognized_typography_fields ) ) { $font_size = isset( $field_value['font-size'] ) ? esc_attr( $field_value['font-size'] ) : ''; echo ''; } /* build font style */ if ( in_array( 'font-style', $alchem_recognized_typography_fields ) ) { $font_style = isset( $field_value['font-style'] ) ? esc_attr( $field_value['font-style'] ) : ''; echo ''; } /* build font variant */ if ( in_array( 'font-variant', $alchem_recognized_typography_fields ) ) { $font_variant = isset( $field_value['font-variant'] ) ? esc_attr( $field_value['font-variant'] ) : ''; echo ''; } /* build font weight */ if ( in_array( 'font-weight', $alchem_recognized_typography_fields ) ) { $font_weight = isset( $field_value['font-weight'] ) ? esc_attr( $field_value['font-weight'] ) : ''; echo ''; } /* build letter spacing */ if ( in_array( 'letter-spacing', $alchem_recognized_typography_fields ) ) { $letter_spacing = isset( $field_value['letter-spacing'] ) ? esc_attr( $field_value['letter-spacing'] ) : ''; echo ''; } /* build line height */ if ( in_array( 'line-height', $alchem_recognized_typography_fields ) ) { $line_height = isset( $field_value['line-height'] ) ? esc_attr( $field_value['line-height'] ) : ''; echo ''; } /* build text decoration */ if ( in_array( 'text-decoration', $alchem_recognized_typography_fields ) ) { $text_decoration = isset( $field_value['text-decoration'] ) ? esc_attr( $field_value['text-decoration'] ) : ''; echo ''; } /* build text transform */ if ( in_array( 'text-transform', $alchem_recognized_typography_fields ) ) { $text_transform = isset( $field_value['text-transform'] ) ? esc_attr( $field_value['text-transform'] ) : ''; echo ''; } echo '
'; echo '
'; } } /** * Upload option type. * * See @alchem_display_by_type to see the full list of available arguments. * * @param array An array of arguments. * @return string * * @access public * @since 2.0 */ if ( ! function_exists( 'alchem_type_upload' ) ) { function alchem_type_upload( $args = array() ) { /* turns arguments array into variables */ extract( $args ); /* verify a description */ $has_desc = $field_desc ? true : false; /* format setting outer wrapper */ echo '
'; /* description */ echo $has_desc ? '
' . htmlspecialchars_decode( $field_desc ) . '
' : ''; /* format setting inner wrapper */ echo '
'; /* build upload */ echo '
'; /* input */ echo ''; /* add media button */ echo '' . __( 'Add Media', 'alchem' ) . ''; echo '
'; /* media */ if ( $field_value ) { echo '
'; if ( preg_match( '/\.(?:jpe?g|png|gif|ico)$/i', $field_value ) ) echo '
'; echo '' . __( 'Remove Media', 'alchem' ) . ''; echo '
'; } echo '
'; echo '
'; } } /* End of file alchem-functions-option-types.php */ /* Location: ./includes/alchem-functions-option-types.php */