-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from AyeCode/master
pull
- Loading branch information
Showing
14 changed files
with
1,855 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -295,6 +295,53 @@ | |
<?php | ||
} | ||
|
||
// db_default, this only shows on first add | ||
if(isset($field->id) && !is_numeric($field->id)) { | ||
do_action( "geodir_cfa_before_db_default_{$field->field_type}", $cf, $field ); | ||
|
||
if ( has_filter( "geodir_cfa_db_default_{$field->field_type}" ) ) { | ||
|
||
echo apply_filters( "geodir_cfa_db_default_{$field->field_type}", '', $field->id, $cf, $field ); | ||
|
||
} else { | ||
$value = ''; | ||
if ( isset( $field->db_default ) ) { | ||
$value = esc_attr( $field->db_default ); | ||
} elseif ( isset( $cf['defaults']['db_default'] ) && $cf['defaults']['db_default'] ) { | ||
$value = $cf['defaults']['db_default']; | ||
} | ||
?> | ||
<p class="gd-advanced-setting" data-setting="db_default"> | ||
<label for="db_default" class="dd-setting-name"> | ||
<?php | ||
if ( $field->field_type == 'checkbox' ) { | ||
echo geodir_help_tip( __( 'Should the value be set by default in the database?', 'geodirectory' ) ); | ||
} else if ( $field->field_type == 'email' ) { | ||
echo geodir_help_tip( __( 'A default database value for the field, usually blank.', 'geodirectory' ) ); | ||
} else { | ||
echo geodir_help_tip( __( 'A default database value for the field, usually blank.', 'geodirectory' ) ); | ||
} | ||
_e( 'Database Default value', 'geodirectory' ); ?> | ||
<?php if ( $field->field_type == 'checkbox' ) { ?> | ||
<select name="db_default" id="db_default"> | ||
<option value=""><?php _e( 'Unchecked', 'geodirectory' ); ?></option> | ||
<option | ||
value="1" <?php selected( true, (int) $value === 1 ); ?>><?php _e( 'Checked', 'geodirectory' ); ?></option> | ||
</select> | ||
<?php } else if ( $field->field_type == 'email' ) { ?> | ||
<input type="email" name="db_default" | ||
placeholder="<?php _e( '[email protected]', 'geodirectory' ); ?>" | ||
id="db_default" value="<?php echo esc_attr( $value ); ?>"/><br/> | ||
<?php } else { ?> | ||
<input type="text" name="db_default" id="db_default" | ||
value="<?php echo esc_attr( $value ); ?>"/><br/> | ||
<?php } ?> | ||
</label> | ||
</p> | ||
<?php | ||
} | ||
} | ||
|
||
// placeholder_value | ||
do_action( "geodir_cfa_before_placeholder_value_{$field->field_type}", $cf, $field); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.