| @@ -28,8 +28,9 @@ | ||
| 28 | 28 | 'hidden' => array($this, 'hiddenCallback'), |
| 29 | 29 | 'file' => array($this, 'fileCallback'), |
| 30 | 30 | 'number' => array($this, 'numberCallback'), |
| 31 | 31 | 'inProButton' => array($this, 'inProButtonCallback'), |
| 32 | + 'html' => array($this, 'htmlCallback'), | |
| 32 | 33 | ); |
| 33 | 34 | |
| 34 | 35 | foreach ($settings as $sectionId => $section) { |
| 35 | 36 | $callback = isset($section['callback']) ? $section['callback'] : null; |
| @@ -107,13 +108,17 @@ | ||
| 107 | 108 | esc_attr($args['placeholder']), |
| 108 | 109 | esc_attr($args['id']) |
| 109 | 110 | ); |
| 110 | 111 | |
| 112 | + if(!empty($args['additional_link'])){ | |
| 113 | + echo '<a id="wpc-choose-selector-button" href="' . esc_url($args['additional_link']['url']) . '" class="button">' . esc_html($args['additional_link']['label']) . '</a>'; | |
| 114 | + } | |
| 115 | + | |
| 111 | 116 | if( isset($args['id']) && $args['id'] === 'posts_container' ){ |
| 112 | - | |
| 113 | 117 | if( flrt_get_option('enable_ajax') === 'on' && ! $value ){ |
| 114 | - printf( '<p class="wpc-warning">%s</p>', esc_html__( 'You must specify Posts Container, otherwise AJAX will not work properly', 'filter-everything' ) ); | |
| 118 | + printf( '<p class="wpc-warning">%s</p>', esc_html__( 'You must specify the Results container, otherwise AJAX will not work properly', 'filter-everything' ) ); | |
| 115 | 119 | } |
| 120 | + | |
| 116 | 121 | } |
| 117 | 122 | |
| 118 | 123 | if( isset( $args['description'] ) ){ |
| 119 | 124 | printf( '<p class="description">%s</p>', esc_html( $args['description'] ) ); |
| @@ -147,9 +152,9 @@ | ||
| 147 | 152 | |
| 148 | 153 | if( isset($args['id']) && $args['id'] === 'posts_container' ){ |
| 149 | 154 | |
| 150 | 155 | if( flrt_get_option('enable_ajax') === 'on' && ! $value ){ |
| 151 | - printf( '<p class="wpc-warning">%s</p>', esc_html__( 'You must specify Posts Container, otherwise AJAX will not work properly', 'filter-everything' ) ); | |
| 156 | + printf( '<p class="wpc-warning">%s</p>', esc_html__( 'You must specify the Results container, otherwise AJAX will not work properly', 'filter-everything' ) ); | |
| 152 | 157 | } |
| 153 | 158 | } |
| 154 | 159 | |
| 155 | 160 | if( isset( $args['description'] ) ){ |
| @@ -442,6 +447,27 @@ | ||
| 442 | 447 | |
| 443 | 448 | public function inProButtonCallback($args) |
| 444 | 449 | { |
| 445 | 450 | echo flrt_unlock_in_pro(); |
| 451 | + | |
| 452 | + if( isset( $args['description'] ) ){ | |
| 453 | + printf( '<p class="description">%s</p>', esc_html( $args['description'] ) ); | |
| 454 | + } | |
| 455 | + } | |
| 456 | + | |
| 457 | + /** | |
| 458 | + * Read-only field: delegates the cell markup to $args['render'] (callable | |
| 459 | + * receiving $args) or echoes pre-escaped $args['html']. Nothing is saved — | |
| 460 | + * for generated previews, hints and code blocks inside a settings table. | |
| 461 | + */ | |
| 462 | + public function htmlCallback($args) | |
| 463 | + { | |
| 464 | + if ( isset( $args['render'] ) && is_callable( $args['render'] ) ) { | |
| 465 | + call_user_func( $args['render'], $args ); | |
| 466 | + return; | |
| 467 | + } | |
| 468 | + | |
| 469 | + if ( isset( $args['html'] ) ) { | |
| 470 | + echo wp_kses_post( $args['html'] ); | |
| 471 | + } | |
| 446 | 472 | } |
| 447 | 473 | } |