and tags * @param string $option_label * @param string $option_name * @param string|int $option_value * @param array $elements * @param int $echo * @param string $tip * @return string */ function implecode_settings_radio( $option_label, $option_name, $option_value, $elements = array(), $echo = 1, $tip = '', $line = '
' ) { if ( !empty( $tip ) && !is_array( $tip ) ) { $tip = 'title="' . $tip . '"'; } $return = ''; $return .= '' . $option_label . ':'; $return .= ''; foreach ( $elements as $key => $element ) { $show_tip = is_array( $tip ) ? 'title="' . $tip[ $key ] . '" ' : $tip; $return .= '' . '' . $line; } $return .= ''; $return .= ''; return echo_ic_setting( $return, $echo ); } function implecode_settings_dropdown( $option_label, $option_name, $option_value, $elements = array(), $echo = 1 ) { $return = ''; $return .= '' . $option_label . ':'; $return .= ''; $return .= ''; $return .= ''; $return .= ''; return echo_ic_setting( $return, $echo ); } function implecode_settings_checkbox( $option_label, $option_name, $option_enabled, $echo = 1, $tip = '' ) { if ( !empty( $tip ) && !is_array( $tip ) ) { $tip = 'title="' . $tip . '" '; } $return = ''; $return .= '' . $option_label . ':'; $return .= ''; $return .= ''; return echo_ic_setting( $return, $echo ); } /** * Shows settings text fiels * * @param string $option_label * @param string $option_name * @param string|int $option_value * @param string $required * @param int $echo * @param string $class * @param string $tip * @param string $disabled * @return string */ function implecode_settings_text( $option_label, $option_name, $option_value, $required = null, $echo = 1, $class = null, $tip = null, $disabled = '' ) { if ( !empty( $disabled ) ) { $disabled .= ' '; } if ( $required != '' ) { $regired_field = 'required="required"'; $star = ' *'; } else { $regired_field = ''; $star = ''; } $tip = !empty( $tip ) ? 'title="' . $tip . '" ' : ''; $return = ''; if ( $option_label != '' ) { $return .= '' . $option_label . $star . ':'; } $return .= ''; $return .= ''; return echo_ic_setting( $return, $echo ); } /** * Generates number field within table tr tags * * @param string $option_label * @param string $option_name * @param float $option_value * @param string $unit * @param int $echo * @param float $step * @param string $tip * @param float $min * @param float $max * @return string */ function implecode_settings_number( $option_label, $option_name, $option_value, $unit, $echo = 1, $step = 1, $tip = null, $min = null, $max = null ) { $return = ''; $return .= '' . $option_label . ':'; $tip = !empty( $tip ) ? 'title="' . $tip . '" ' : ''; $min = isset( $min ) ? 'min="' . intval( $min ) . '" ' : ''; $max = isset( $max ) ? 'max="' . intval( $max ) . '" ' : ''; $return .= '' . $unit . ''; $return .= ''; return echo_ic_setting( $return, $echo ); } function implecode_settings_textarea( $option_label, $option_name, $option_value, $echo = 1 ) { $return = ''; $return .= '' . $option_label . ':'; $return .= ''; $return .= ''; return echo_ic_setting( $return, $echo ); } function implecode_upload_image( $button_value, $option_name, $option_value, $default_image = null, $upload_image_id = 'url', $echo = 1 ) { wp_enqueue_media(); $option_value = !empty( $option_value ) ? $option_value : $default_image; $image_src = $option_value; if ( $upload_image_id != 'url' ) { $upload_image_id = 'id'; if ( strpos( $image_src, 'http' ) === false ) { $image_src = wp_get_attachment_image_src( $option_value, 'medium' ); $image_src = $image_src[ 0 ]; } } $content = '
'; $content .= ''; $content .= ''; $content .= ''; //if ($image_src != '') { $class = ''; if ( $option_value == null ) { $class = 'empty'; } $content .= '
'; $style = ''; if ( $option_value == null ) { $style = 'style="display: none"'; } $content .= 'X'; $style = ''; if ( empty( $image_src ) ) { $style = ' style="display: none"'; } $content .= ''; $content .= '
'; //} $style = ''; if ( $option_value != null ) { $style = 'style="display: none"'; } $content .= ' ' . $button_value . ''; $content .= '
'; return echo_ic_setting( $content, $echo ); } function echo_ic_setting( $return, $echo = 1 ) { if ( $echo == 1 ) { echo $return; } else { return $return; } } function implecode_warning( $text, $echo = 1 ) { return echo_ic_setting( '
' . $text . '
', $echo ); } function implecode_info( $text, $echo = 1, $p = 1 ) { $return = '
'; if ( $p == 1 ) { $return .= '

' . $text . '

'; } else { $return .= $text; } $return .= '
'; return echo_ic_setting( $return, $echo ); } function implecode_success( $text, $echo = 1 ) { return echo_ic_setting( '

' . $text . '

', $echo ); } } if ( !function_exists( 'implecode_settings_text_color' ) ) { function implecode_settings_text_color( $option_label, $option_name, $option_value, $required = null, $echo = 1, $class = null, $change = null ) { if ( $required != '' ) { $regired_field = 'required="required"'; $star = ' *'; } else { $regired_field = ''; $star = ''; } $return = ''; $return .= '' . $option_label . $star . ':'; $return .= ''; $return .= ''; $return .= ''; return echo_ic_setting( $return, $echo ); } }