'1', 'rotate_ms' => '4000', 'image_size' => 'medium', ), $atts, 'aieo_related_brands' ); return $this->render( 'aieo/post-related-brands', array( 'autoRotate' => in_array( strtolower( (string) $atts['auto_rotate'] ), array( '1', 'true', 'yes', 'on' ), true ), 'rotateMs' => max( 1500, (int) $atts['rotate_ms'] ), 'imageSize' => (string) $atts['image_size'], ) ); } public function sc_related_categories( $atts = array() ) { $atts = shortcode_atts( array( 'label' => '', ), $atts, 'aieo_related_categories' ); return $this->render( 'aieo/post-related-categories', array( 'label' => (string) $atts['label'], ) ); } public function sc_related_needs( $atts = array() ) { $atts = shortcode_atts( array( 'heading' => '', ), $atts, 'aieo_related_needs' ); return $this->render( 'aieo/post-related-needs', array( 'heading' => (string) $atts['heading'], ) ); } private function render( $name, array $attrs ) { if ( ! function_exists( 'render_block' ) ) { return ''; } return (string) render_block( array( 'blockName' => $name, 'attrs' => $attrs, 'innerBlocks' => array(), 'innerHTML' => '', 'innerContent' => array(), ) ); } } AIEO_Post_Relations_Shortcodes::instance();