Viewing 3 reply threads
  • Author
    Posts
    • #3378
      pupppet
      Member

      This template to remove the group label (allowing a full width row) I found in the forum no longer seems to work-

      add_filter('piklist_field_templates', 'add_piklist_field_templates');
      
      function add_piklist_field_templates($templates)
      {
      	$templates['no_label'] = '[field_wrapper]
      		                          <div id="%1$s" class="%2$s">
      		                              [field_description_wrapper]
      		                                  <small>[field_description]</small>
      		                              [/field_description_wrapper]
      		                              [field]
      		                          </div>
      	                          [/field_wrapper]';
      
      	return $templates;
      }

      Any idea what needs to be updated?

    • #3383
      Steve
      Keymaster

      @pupppet– Which version of Piklist are you using?

    • #3385
      pupppet
      Member

      I’m on 0.9.4.25.

    • #3389
      Steve
      Keymaster

      @pupppet– The format for Field Templates changed a while ago. Please refer to the official docs in the future >

      The code you need is:

      add_filter('piklist_field_templates', 'add_piklist_field_templates');
      function add_piklist_field_templates($templates)
      {
          $templates['no_label'] = array(
                  'name' => __('No Label', 'piklist')
                  ,'description' => __('No label here.', 'piklist')
                  ,'template' => '[field_wrapper]
                                    
      [field_description_wrapper] [field_description] [/field_description_wrapper] [field]
      [/field_wrapper]' ); return $templates; }
Viewing 3 reply threads
  • You must be logged in to reply to this topic.