• Resolved JTS_IL

    (@jts_il)


    While trying to RTL the admin panel I dicovered that the iPhone like button for the slider actualy contains 6 nested instances on the YES/NO slide button for the slider.
    Some digging into the code got me to this function in in class-admin-meta-boxes.php :

    /**
         * Adds layout and slider metaboxes to pages and posts
         * @package Customizr
         * @since Customizr 1.0
         */
          function tc_post_meta_boxes() {//id, title, callback, post_type, context, priority, callback_args
               /***
                Determines which screens we display the box
              **/
              //1 - retrieves the custom post types
              $args                 = array(
              //'public'   => true,
              '_builtin' => false
              );
              $custom_post_types    = get_post_types($args);
    
              //2 - Merging with the builtin post types, pages and posts
              $builtin_post_types   = array(
                'page' => 'page',
                'post' => 'post'
                );
              $screens              = array_merge( $custom_post_types, $builtin_post_types );
    
              //3- Adding the meta-boxes to those screens
              foreach ( $screens as $key => $screen) {
                  //skip if acf
                  if ('acf' == $screen )
                    continue;
    	      else //JTS 2015 <<<<*** new line *********************
                  add_meta_box(
                      'layout_sectionid' ,
                      __( 'Layout Options' , 'customizr' ),
                      array( $this , 'tc_post_layout_box' ),
                      $screen,
                      ( 'page' == $screen | 'post' == $screen ) ? 'side' : 'normal',//displays meta box below editor for custom post types
                      apply_filters('tc_post_meta_boxes_priority' , 'high', $screen )
                  );
                  add_meta_box(
                      'slider_sectionid' ,
                      __( 'Slider Options' , 'customizr' ),
                      array( $this , 'tc_post_slider_box' ),
                      $screen,
                      'normal' ,
                      apply_filters('tc_post_meta_boxes_priority' , 'high', $screen)
                  );
    	    endif // JTS 2015  <<<<*** new line *********************
              }//end foreach
          }

    the two lines marked with // JTS 2015 are my addition, since it seems that the if statement does not skip the rest of the code as mention in the text above it.

    Am I right?
    Or I’ve done some damage? ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • Sorry don’t understand.. why doesn’t skip the rest of the code?
    continue

    And what do you mean with 6 nested instances?

    Thread Starter JTS_IL

    (@jts_il)

    OOPS!!!

    Maybe I was jumping too early ??

    The multiple instances occur after switching On/Off several times.
    it looks like this:
    #slider_sectionid > div.inside > div.meta-box-item-content > div > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer > div.iPhoneCheckContainer

    Please ignore this one.
    I’ll digg into it today / tomorrow and post a new support question

    Hi JTS_IL,
    I wasn’t saying you were wrong, it’s just I didn’t get what you meant ??

    And yes you’re right about multiple instances, I can reproduce it.

    Thread Starter JTS_IL

    (@jts_il)

    ??
    The OOPS was because I was a bit confused between the structure of PHP and VB

    Thread Starter JTS_IL

    (@jts_il)

    Well,
    My first suggestion was wrong (of course)…

    found a reasonable fix, submitted a suggestion on github.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multiple instance of iPhoneCheck’ is closed to new replies.