'; // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a price field with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_price( $args ) { // Get the field name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the value of this setting $values = get_option( $args['option_name'], array() ); $value = isset( $values[ $args['field_name'] ] ) ? esc_attr( $values[ $args['field_name'] ] ) : 0; $value = acadp_format_amount( $value ); // Echo proper textarea echo ''; // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a textarea with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_textarea( $args ) { // Get the field name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the value of this setting $values = get_option( $args['option_name'], array() ); $value = isset( $values[ $args['field_name'] ] ) ? esc_textarea( $values[ $args['field_name'] ] ) : ''; // Echo proper textarea echo ''; // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a rich text textarea with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_wysiwyg( $args ) { // Get the field name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the value of this setting $values = get_option( $args['option_name'], array() ); $value = isset( $values[ $args['field_name'] ] ) ? $values[ $args['field_name'] ] : ''; // Echo wordpress editor wp_editor( $value, $id, array( 'textarea_name' => $name, 'media_buttons' => false, 'quicktags' => true, 'editor_height' => 250 ) ); // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '
' . $args['description'] . '
'; } } /** * Displays a checkbox with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_checkbox( $args ) { // Get the field name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the value of this setting $values = get_option( $args['option_name'], array() ); $checked = ( isset( $values[ $args['field_name'] ] ) && $values[ $args['field_name'] ] == 1 ) ? ' checked="checked"' : ''; // Echo proper input type="checkbox" echo ''; // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays multiple checkboxes with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_multicheck( $args ) { // Get the field id & name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the values of this setting $values = get_option( $args['option_name'], array() ); $values = isset( $values[ $args['field_name'] ] ) ? (array) $values[ $args['field_name'] ] : array(); // Echo proper input type="checkbox" foreach( $args['options'] as $value => $label ) { $checked = in_array( $value, $values ) ? ' checked="checked"' : ''; echo '

'; echo ''; echo '

'; } // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a radio button group with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_radio( $args ) { // Get the field id & name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the values of this setting $values = get_option( $args['option_name'], array() ); $checked = isset( $values[ $args['field_name'] ] ) ? $values[ $args['field_name'] ] : ''; // Echo proper input type="radio" foreach( $args['options'] as $key => $label ) { echo '

'; echo ""; echo "

"; } // Echo the field description (only if applicable) if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a selectbox with the field description for a settings field. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_select( $args ) { // Get the field id & name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the values of this setting $values = get_option( $args['option_name'], array() ); $selected = isset( $values[ $args['field_name'] ] ) ? $values[ $args['field_name'] ] : ''; // Echo proper selectbox echo ''; // Echo the field description from the $args array if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a list of wordpress pages in a select with the field description. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_pages( $args ) { // Get the field id & name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the values of this setting $values = get_option( $args['option_name'], array() ); $selected = isset( $values[ $args['field_name'] ] ) ? $values[ $args['field_name'] ] : -1; // Echo proper selectbox echo ''; // Echo the field description from the $args array if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } } /** * Displays a list of ACADP locations in a select with the field description. * * @since 1.6.5 * @param array $args Settings field args. */ function acadp_settings_callback_locations( $args ) { // Get the field id & name from the $args array $id = $args['option_name'] . '_' . $args['field_name']; $name = $args['option_name'] . '[' . $args['field_name'] . ']'; // Get the values of this setting $values = get_option( $args['option_name'], array() ); $value = isset( $values[ $args['field_name'] ] ) ? $values[ $args['field_name'] ] : -1; // Echo proper selectbox wp_dropdown_categories( array( 'show_option_none' => '-- ' . __( 'Select a location', 'advanced-classifieds-and-directory-pro' ) . ' --', 'taxonomy' => 'acadp_locations', 'name' => $name, 'id' => $id, 'orderby' => 'name', 'selected' => $value, 'hierarchical' => true, 'depth' => 10, 'show_count' => false, 'hide_empty' => false, ) ); // Echo the field description from the $args array if ( isset( $args['description'] ) ) { echo '

' . $args['description'] . '

'; } }