'#f0f0f0', 'text_color' => '#262525', 'image_height' => 100, 'image_border_radius' => 0, 'navigation' => 'yes', 'indicators' => 'yes', 'transition_speed' => 500, 'auto_slide' => 'yes', 'interval' => 5000, 'pause_on_hover' => 'yes', ); public function __construct() { add_action( 'add_meta_boxes', array( $this, 'register_meta_boxes' ) ); add_action( 'save_post_bridgehub_slider', array( $this, 'save_slider_meta' ), 10, 2 ); } public function register_meta_boxes() { add_meta_box( 'bridgehub_testimonial_manager', __( 'Testimonials', 'aj-square-testimonial-slider' ), array( $this, 'render_testimonial_manager_metabox' ), 'bridgehub_slider', 'normal', 'high' ); add_meta_box( 'bridgehub_slider_settings', __( 'Slider Settings', 'aj-square-testimonial-slider' ), array( $this, 'render_slider_tabs_metabox' ), 'bridgehub_slider', 'normal', 'high' ); add_meta_box( 'bridgehub_developer', __( 'Developer', 'aj-square-testimonial-slider' ), array( $this, 'render_developer_metabox' ), 'bridgehub_slider', 'side', 'low' ); } private function get_value( $post_id, $key ) { $value = get_post_meta( $post_id, 'bridgehub_slider_' . $key, true ); if ( '' === $value || false === $value ) { return isset( $this->defaults[ $key ] ) ? $this->defaults[ $key ] : ''; } return $value; } private function get_testimonials_for_slider( $slider_id ) { $testimonial_ids = get_post_meta( $slider_id, 'bridgehub_testimonial_ids', true ); if ( is_array( $testimonial_ids ) && ! empty( $testimonial_ids ) ) { $testimonial_ids = array_map( 'absint', $testimonial_ids ); $query = new WP_Query( array( 'post_type' => 'bhub_testimonial', 'post__in' => $testimonial_ids, 'posts_per_page' => -1, 'post_status' => 'any', 'orderby' => 'post__in', ) ); $testimonials = $query->posts; wp_reset_postdata(); return $testimonials; } return array(); } public function render_testimonial_manager_metabox( $post ) { if ( 'auto-draft' === $post->post_status ) { ?>
ID ); ?>
ID ) )->label ); ?>