Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<div class="wpuf-form-builder-field-options">
<div v-if="!parseInt(editing_field_id)" class="options-fileds-section text-center">
<p>
<span class="loader"></span>
</p>
<p class="wpuf-text-gray-500 wpuf-text-lg wpuf-font-medium">{{ i18n.empty_field_options_msg }}</p>
</div>

<div v-else>
Expand Down
1 change: 1 addition & 0 deletions admin/form-builder/assets/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@
delete_form_field_element: function (state, index) {
state.current_panel = 'form-fields-v4-1';
state.form_fields.splice(index, 1);
state.editing_field_id = 0;
},

// set fields for a panel section
Expand Down
2 changes: 1 addition & 1 deletion admin/form-builder/views/form-builder-v4.1.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
</nav>

<?php
$form_id = isset( $_GET['id'] ) ? intval( wp_unslash( $_GET['id'] ) ) : 0;

Check warning on line 54 in admin/form-builder/views/form-builder-v4.1.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Processing form data without nonce verification.

Check warning on line 54 in admin/form-builder/views/form-builder-v4.1.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Processing form data without nonce verification.

if ( count( $shortcodes ) > 1 && isset( $shortcodes[0]['type'] ) ) {
foreach ( $shortcodes as $shortcode ) {
?>
<span
class="form-id wpuf-group wpuf-flex wpuf-items-center wpuf-px-[18px] wpuf-py-[10px] wpuf-rounded-md wpuf-border wpuf-border-gray-300 hover:wpuf-cursor-pointer wpuf-ml-6 wpuf-text-gray-700 wpuf-text-base wpuf-leading-none wpuf-shadow-sm"
title="<?php printf( esc_attr( __( 'Click to copy %s shortcode', 'wp-user-frontend' ) ), $shortcode['type'] ); ?>"

Check failure on line 61 in admin/form-builder/views/form-builder-v4.1.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

A function call to __() with texts containing placeholders was found, but was not accompanied by a "translators:" comment on the line above to clarify the meaning of the placeholders.
data-clipboard-text="<?php printf( esc_attr( '[' . $shortcode['name'] . ' type="' . esc_attr( $shortcode['type'] ) . '" id="' . esc_attr( $form_id ) . '"]' ) ); ?>"><?php echo esc_attr( ucwords( $shortcode['type'] ) ); ?>: #{{ post.ID }}
<span id="default-icon" class="wpuf-ml-2">
<svg
Expand Down Expand Up @@ -140,7 +140,7 @@
class="wpuf-nav-tab wpuf-nav-tab-active wpuf-py-2 wpuf-px-4 wpuf-text-base hover:wpuf-bg-white hover:wpuf-text-gray-800 hover:wpuf-rounded-md hover:wpuf-drop-shadow-sm focus:wpuf-shadow-none wpuf-mr-2 hover:wpuf-cursor-pointer">
<?php esc_html_e( 'Settings', 'wp-user-frontend' ); ?>
</a>
<?php do_action( "wpuf-form-builder-tabs-{$form_type}" ); ?>

Check warning on line 143 in admin/form-builder/views/form-builder-v4.1.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Words in hook names should be separated using underscores. Expected: "wpuf_form_builder_tabs_{$form_type}", but found: "wpuf-form-builder-tabs-{$form_type}".
</div>
</div>
</div>
Expand Down Expand Up @@ -176,7 +176,7 @@
</div>
</section>
</div>
</div>
</div>
</div>
<div
v-show="active_tab === 'form-settings'"
Expand All @@ -185,7 +185,7 @@
do_action( "wpuf_form_builder_settings_tabs_{$form_type}" );
?>
</div><!-- #wpuf-form-builder-settings -->
<?php do_action( "wpuf-form-builder-tab-contents-{$form_type}" ); ?>

Check warning on line 188 in admin/form-builder/views/form-builder-v4.1.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Words in hook names should be separated using underscores. Expected: "wpuf_form_builder_tab_contents_{$form_type}", but found: "wpuf-form-builder-tab-contents-{$form_type}".

<?php if ( ! empty( $form_settings_key ) ) { ?>
<input type="hidden" name="form_settings_key" value="<?php echo esc_attr( $form_settings_key ); ?>">
Expand Down
4 changes: 1 addition & 3 deletions assets/js-templates/form-components.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,7 @@ class="wpuf-pro-text-alert wpuf-ml-2 wpuf-tooltip-top"
<script type="text/x-template" id="tmpl-wpuf-field-options">
<div class="wpuf-form-builder-field-options">
<div v-if="!parseInt(editing_field_id)" class="options-fileds-section text-center">
<p>
<span class="loader"></span>
</p>
<p class="wpuf-text-gray-500 wpuf-text-lg wpuf-font-medium">{{ i18n.empty_field_options_msg }}</p>
</div>

<div v-else>
Expand Down
1 change: 1 addition & 0 deletions assets/js/wpuf-form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@
delete_form_field_element: function (state, index) {
state.current_panel = 'form-fields-v4-1';
state.form_fields.splice(index, 1);
state.editing_field_id = 0;
},

// set fields for a panel section
Expand Down
1 change: 1 addition & 0 deletions includes/Admin/Forms/Admin_Form_Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
'form_settings_key' => '',
'post_id' => 0,
'shortcodes' => [],
// [ [ 'name' => 'wpuf_form', 'type' => 'profile' ], [ 'name' => 'wpuf_form', 'type' => 'registration' ] ]

Check warning on line 46 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

This comment is 56% valid code; is this commented out code?
];
$this->settings = wp_parse_args( $settings, $defaults );
// set post data to global $post
$post = get_post( $this->settings['post_id'] );

Check failure on line 50 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Overriding WordPress globals is prohibited. Found assignment to $post
// if we have an existing post, then let's start
if ( ! empty( $post->ID ) ) {
add_action( 'in_admin_header', 'wpuf_remove_admin_notices' );
Expand Down Expand Up @@ -125,14 +125,14 @@

$single_objects = apply_filters(
'wpuf_single_form_field',
[

Check failure on line 128 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Multi-line function call not indented correctly; expected 12 spaces but found 16
'post_title',

Check failure on line 129 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'post_content',

Check failure on line 130 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'post_excerpt',

Check failure on line 131 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'featured_image',

Check failure on line 132 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'user_login',

Check failure on line 133 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'first_name',

Check failure on line 134 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'last_name',

Check failure on line 135 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Array item not aligned correctly; expected 20 spaces but found 16
'nickname',
'user_email',
'user_url',
Expand Down Expand Up @@ -338,7 +338,7 @@
'last_column_warn_msg' => __( 'This field must contain at least one column', 'wp-user-frontend' ),
'is_a_pro_feature' => __( 'is a pro feature', 'wp-user-frontend' ),
'pro_feature_msg' => __(
'<p class="wpuf-text-gray-500 wpuf-font-medium wpuf-text-xl">Please upgrade to the Pro version to unlock all these awesome features</p>',

Check warning on line 341 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Translatable string should not be wrapped in HTML. Found: '<p class="wpuf-text-gray-500 wpuf-font-medium wpuf-text-xl">Please upgrade to the Pro version to unlock all these awesome features</p>'
'wp-user-frontend'
),
'upgrade_to_pro' => __( 'Upgrade to PRO', 'wp-user-frontend' ),
Expand All @@ -346,6 +346,7 @@
'saved_form_data' => __( 'Saved form data', 'wp-user-frontend' ),
'unsaved_changes' => __( 'You have unsaved changes.', 'wp-user-frontend' ),
'copy_shortcode' => __( 'Click to copy shortcode', 'wp-user-frontend' ),
'empty_field_options_msg' => __( 'To view field options, please start adding fields in the builder', 'wp-user-frontend' ),
'pro_field_message' => $field_messages,
]
);
Expand All @@ -362,11 +363,11 @@
*/
public static function save_form( $data ) {
$saved_wpuf_inputs = [];
wp_update_post( [ 'ID' => $data['form_id'], 'post_status' => 'publish', 'post_title' => $data['post_title'] ] );

Check warning on line 366 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

When a multi-item array uses associative keys, each value should start on a new line.
$existing_wpuf_input_ids = get_children( [
'post_parent' => $data['form_id'],

Check warning on line 368 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found precision alignment of 1 spaces.
'post_status' => 'publish',

Check warning on line 369 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found precision alignment of 1 spaces.
'post_type' => 'wpuf_input',

Check warning on line 370 in includes/Admin/Forms/Admin_Form_Builder.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

Found precision alignment of 1 spaces.
'numberposts' => '-1',
'orderby' => 'menu_order',
'order' => 'ASC',
Expand Down
Loading