Forum Replies Created

Viewing 10 replies - 1 through 10 (of 29 total)
  • Author
    Replies
  • in reply to: Sortable Select #14043

    Jackky
    Participant

    I need this field too

    in reply to: Add clone id #7789

    Jackky
    Participant

    It’s hard to explain, but let me give you a comparison. You are holding collapse state of collapible group while ‘save_state’ is set to true. I want to have a simular logic for each cloned item. The result will be like:

    
    'group_name' => [
    'text' => 'value',
    'etc'  => 'value',
    ...
    '__clone_id' => 'group_XXX' // XXX - unque counter value
    ]
    
    in reply to: Type post field + clone + 2k posts #7279

    Jackky
    Participant

    also offtop: ‘default_state’=> ‘collapsed’, not working for me( Latest version installed, ofcourse

    in reply to: Type post field + clone + 2k posts #7278

    Jackky
    Participant

    yes, autocomplete, than typing 2-3 letters. Also you first thouth right – if you will make request via ajax to standart query for all posts – it will not reduce the number of requests, but it will improve the page loading time with requesting heavy query async. Also for now, I have reduced my admin page load time from 30s to 6s (it’s localhost, prod server more better) with simple construction:

    
    		$all_products = [];
    
    		$args = array(
    					'posts_per_page' => -1,
    					'post_type'      => 'product'
    		);
    
    		$query = new WP_Query( $args );
    		if ( $query->have_posts() ):
    			while ( $query->have_posts() ): $query->the_post();
    				$all_products[get_the_ID()] = get_the_title();
    		 	endwhile;
    		endif;
    

    and then

    
    array(
    					 'id'           => 'order_products',
    					 'type'         => 'group',
    					 'clone'        => true,
    					 'sort_clone'   => true,
    					 'collapsible'	=> true,
    					 'save_state'	  => true,
    					 'default_state'=> 'collapsed',
    					 'group_title'  => array( 'field' => 'product_id' ),
    					 'add_button'   => 'Добавить товар',
    					 'fields'       => array(
    							array(
    									'name'        => 'Товар',
    									'id' 	        => 'product_id',
    									'type'  			=> 'select_advanced',
    									'options' 		=> $all_products,
    									'class'				=> 'product_id'
    							),
    
    in reply to: Multiple maps #7062

    Jackky
    Participant

    figured out with address field – I have placed it outside of group field and using just for address searching (but there an issue – you need to update page after map clone)

    in reply to: Strange issue with tabs + columns #6413

    Jackky
    Participant

    Yep, looks good.

    My main idea was to create something, that will allow to create unlimited types of ui grid, not only strict 12 columns.

    in reply to: MB Term Meta Data not saving #6395

    Jackky
    Participant

    Note, that metaboxes appears only when you EDIT existing term, not when you are on the “main” page of all terms.

    If they still not working, set DEBUG to true in your wp_config.php and see what you get in errors.

    in reply to: Strange issue with tabs + columns #6389

    Jackky
    Participant
    
    $meta_boxes[] = array(
    	'title'      => 'Flex Metabox',
    	'tabs'      => array(
    		'tab_1' => array(
    			'label' => 'Sample tab 1',
    		),
    		'tab_2'  => array(
    			'label' => 'Sample tab 2',
    		),
    	),
    	'fields'     => array(
    
    		
    		'flex' => array( //defining, css display: flex; wrapper, can be used without any openssl_get_cert_locations
    
    				'align-items' 			=> 'center', //simular to css align-items prop.
    				'justify-content'		=> 'flex-end', //simular to css justify-content prop.
    				'flex-wrap'			    => 'wrap', //simular to css flex-wrap prop. Used in case when you want to build your metabox mobile-friendly
    				'flex-direction'		=> 'row-reverse', //simular to css flex-direction prop.
    				'class'								=> 'custom-class', //if user want to define it's own style for this flex wrapper
    				'tab'  				=> 'tab_1',
    				'fields'	=> array( //can hold single fields or new field types 'flex-item' or mixed
    							'flex-item' => array(
    								  'flex-basis' => '50%', //simular to css flex-basis prop. Could handle any type af value, for example 100px, 33%, calc(100% - 50px)
    									'flex-shrink' => '0', //simular to css flex-shrink prop.
    									'fields'	=> array(
    											array(
    												'name' => 'Sample Field 1',
    												'id'   => 'sf1',
    												'type' => 'text',
    											),
    											array(
    												'name' => 'Sample Field 2',
    												'id'   => 'sf2',
    												'type' => 'text',
    											)
    									)
    							),
    							array( //an example for single field without 'flex-item' div wrapper
    								'name' 				              => 'Sample Field 3',
    								'id'   				              => 'sf3',
    								'type' 				              => 'text',
    							  'flex-basis' => '200px', //can hold flex props too
    								'flex-shrink' => '0',
    							)
    				)
    
    			
    		),
    		array( //an example for single field outside flex wrapper. It's behave itself like common field
    			'name' 	=> 'Sample Field 4',
    			'id'   	=> 'sf4',
    			'type' 	=> 'text',
    			'tab'  	=> 'tab_1',
    		),
    		array( //an example for single field outside flex wrapper and in another tab. It's behave itself like common field
    			'name' 	=> 'Sample Field 5',
    			'id'   	=> 'sf5',
    			'type' 	=> 'text',
    			'tab'  	=> 'tab_2',
    		)
    		
    	)
    );
    

    It’s very heavy, I know. And this extension will be for pro users, who defenetely know for what they use it and know what css flex is.

    The advantages of this idea:
    1) Flexbox is native and, excepting lot’s of nested arrays, it’s very simple. Also if developer will have very heavy nested array – he can just define each block as single outside and use it like ‘fields’ => $product_attr_array – I have such experiense for one o my projects (social network)
    2) It’s allows to build any type of UI. Nested mobile-friendly columns, vertical-alignment ect. – anything you want. Some developers like me need this feature, I know (for now I need to break my mind with wrapping fields with ‘custom_html’ fields and other tricks)
    3) This extension is easy to create. Also if you don’t like my idea, I will try to make this extension by my own. I think it will not take lots of time.

    in reply to: Strange issue with tabs + columns #6377

    Jackky
    Participant

    Oh, suddenly I’ve got another great idea: just make a flex-grid based extension with a markup, such as I gave. If you like it, I can generate here the full list of options.

    in reply to: Optimize rwmb_meta_boxes filter #6373

    Jackky
    Participant
    if (is_admin()) {
       add_filter( 'rwmb_meta_boxes', 'user_profile' );
    }
Viewing 10 replies - 1 through 10 (of 29 total)