protected function print_ori_field() { require_once NELIOAB_UTILS_DIR . '/html-generator.php'; NelioABHtmlGenerator::print_post_searcher_based_on_type('exp_original', $this->original_id, 'show-drafts', array(), true, array('product')); ?> <a class="button" style="text-align:center;" href="javascript:NelioABEditExperiment.previewOriginal()"><?php _e('Preview', 'nelioab'); ?> </a> <span class="description" style="display:block;"><?php _e('You will create alternative summaries (name, featured image, and description) for this product.', 'nelioab'); ?> </span><?php }
protected function print_ori_field() { require_once NELIOAB_UTILS_DIR . '/html-generator.php'; $change = false; if (!$this->post_type_name) { $post_type = reset($this->post_types); $this->post_type_name = $post_type->name; $change = true; } NelioABHtmlGenerator::print_post_searcher_based_on_type('exp_original', $this->original_id, 'no-drafts', array('search-' . $this->post_type_name), true, array($this->post_type_name)); ?> <a class="button" style="text-align:center;" href="javascript:NelioABEditExperiment.previewOriginal()"><?php _e('Preview', 'nelioab'); ?> </a> <?php foreach ($this->post_types as $post_type) { ?> <span class="description cpt-desc description-<?php echo $post_type->name; ?> " style="display:block;"> <?php printf(__('This is the %1$s for which alternatives will be created.', 'nelioab'), $post_type->name); ?> <small> <a href="http://support.nelioabtesting.com/support/solutions/articles/1000129193" target="_blank"> <?php _e('Help', 'nelioab'); ?> </a> </small> </span> <?php } ?> <script type="text/javascript"> (function($) { // Functions function switch_custom_post_type( value ) { $('span.cpt-desc').hide(); $('span.description-'+value).show(); NelioABPostSearcher.changeType($('#exp_original'), value); } // Events $('#custom_post_types').on('change', function() { switch_custom_post_type( $('#custom_post_types').attr('value') ); }); <?php if ($change) { ?> switch_custom_post_type( '<?php echo $this->post_type_name; ?> ' );<?php } ?> $('span.cpt-desc').hide(); $('span.description-'+'<?php echo $this->post_type_name; ?> ').show(); })(jQuery); </script><?php }