0 ], $atts, self::TAG ); $id = absint( $atts['id'] ); if ( ! self::can_render( $id ) ) { return ''; } if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { $css = new \Elementor\Core\Files\CSS\Post( $id ); $css->enqueue(); } return Kses::filter( Renderer::get_content( $id ) ); } /** * Tells whether the current user can see the template through the shortcode. * * @param int $id Template ID. * @return bool */ public static function can_render( $id ) { $id = absint( $id ); if ( ! $id || Post_Type::POST_TYPE !== get_post_type( $id ) ) { return false; } if ( 'publish' !== get_post_status( $id ) && ! current_user_can( 'edit_post', $id ) ) { return false; } $roles = get_post_meta( $id, Post_Type::META_ROLES, true ); return Rules::role_matches( is_array( $roles ) ? $roles : [] ); } }