Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets fields not saving #42

Closed
bilalmalkoc opened this issue Mar 10, 2019 · 2 comments
Closed

Widgets fields not saving #42

bilalmalkoc opened this issue Mar 10, 2019 · 2 comments

Comments

@bilalmalkoc
Copy link

When press save it must be saved . But it not happens. So when i try close window, browser warning me. But fields are saving to instance.

use Carbon_Fields\Field;
use Carbon_Fields\Widget;

class NeonTabWidget extends Widget {
    function __construct() {
        $this->setup( 'neon_tab_widget', esc_html__( '# Neon Tab Widget', 'neon' ), esc_html__( 'Display awesome neon tabs in anywhere!', 'neon' ), array(
            Field::make( 'text', 'title', esc_html_x( 'Title', 'Neon tab widget', 'neon' ) ),
            Field::make( 'set', 'fields', esc_html_x( 'Choose fields', 'Neon tab widget', 'neon' ) )
                ->set_options( array(
                    'w_titles'   => esc_html_x( 'Show titles', 'Neon tab widget', 'neon' ),
                    'tooltip'  => esc_html_x( 'Show tooltip', 'Neon tab widget', 'neon' ),
                ) ),
            Field::make( 'text', 'tab_fields', esc_html_x( 'Tab fields', 'Neon tab widget', 'neon' ) )
                ->set_default_value( 'p,l,c,t' )
                ->set_help_text( esc_html_x( 'p => Popular posts | l => Latest posts | c => Latest comments | t => Tags cloud', 'Neon tab widget', 'neon' ) ),
            Field::make( 'text', 'popular_count', esc_html_x( 'Popular count', 'Neon tab widget', 'neon' ) )
                ->set_attribute( 'type', 'number' )
                ->set_default_value( 5 )
                ->set_width( 33 ),
            Field::make( 'text', 'latest_count', esc_html_x( 'Latest post count', 'Neon tab widget', 'neon' ) )
                ->set_attribute( 'type', 'number' )
                ->set_default_value( 5 )
                ->set_width( 33 ),
            Field::make( 'text', 'comment_count', esc_html_x( 'Comment count', 'Neon tab widget', 'neon' ) )
                ->set_attribute( 'type', 'number' )
                ->set_default_value( 5 )
                ->set_width( 33 ),
        ) );
    }

    // Called when rendering the widget in the front-end
    function front_end( $args, $instance ) {
    }
}

register_widget( 'NeonTabWidget' );
@vvasilev-
Copy link

Hi @bilalmalkoc,

Thank you for your feedback! Please re-open your issue at the main repository of Carbon Fields because this one is only for the documentation.

@bilalmalkoc
Copy link
Author

Ok thanks.
htmlburger/carbon-fields#684

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants