Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: show metabox only for top-level pages #5421
    abmcr
    Member

    Yes: i confirm
    In the new 0.9.9.6 the code you post and my also are not working
    The filter don’t exist

    in reply to: show metabox only for top-level pages #5419
    abmcr
    Member

    In the last 0.9.9.6 the
    piklist_get_file_data filter don’t exist?
    I have try to use the code

    add_filter('piklist_get_file_data', 'my_custom_comment_block', 10, 2);
    function my_custom_comment_block($data, $type)
    {
         // If not a Meta-box section than bail
      if($type != 'meta-boxes')
      {
        return $data;
      }
     
      // Allow Piklist to read our custom comment block attribute: "Hide for Template", and set it to hide_for_template
      $data['hide_for_template'] = 'Hide for Template';
    
      return $data;
    }
    
    add_filter('piklist_add_part', 'my_hide_for_template', 10, 2);
    function my_hide_for_template($data, $type)
    {
      global $post;
     
      // If not a meta box than bail
      if($type != 'meta-boxes')
      {
        return $data;
      }
     
      // Check if any page template is set in the comment block
      if (!empty($data['hide_for_template'])) 
      {
        // Get the active page template
        $active_template = pathinfo(get_page_template_slug($post->ID), PATHINFO_FILENAME);
        //valuta se pagina è front page
    
         if($post->ID !== get_option( 'show_on_front' ) ){
     
            // Change meta-box access to user role: no-role
            $data['role'] = 'no-role'; 
          
        }
      }
      return $data;
    }

    And it not work; i have serached the filter and i have not found it

    in reply to: required but conditional filed is validated #5352
    abmcr
    Member

    I also need a required condition into a validation.
    May be as future feature in new version
    Thank you

    in reply to: Widget not work #5096
    abmcr
    Member

    OK, thank you… very simple…

Viewing 4 posts - 1 through 4 (of 4 total)